本文整理汇总了C#中Artist.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Artist.Update方法的具体用法?C# Artist.Update怎么用?C# Artist.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Artist
的用法示例。
在下文中一共展示了Artist.Update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
art = string.IsNullOrEmpty(hfArtistID.Value) ? new Artist() : new Artist(Convert.ToInt32(hfArtistID.Value));
art.IsHidden = chkIsHidden.Checked;
art.AltName = txtArtistAltName.Text;
art.Name = txtArtistName.Text;
if (art.ArtistID == 0)
{
if (art.Create() > 0)
{
}
else
{
return;
}
}
else
{
if (art.Update())
{
}
else
{
return;
}
}
artprop = new ArtistProperty();
artprop.GetArtistPropertyForTypeArtist(art.ArtistID, SiteEnums.ArtistPropertyType.LD.ToString());
artprop.PropertyContent = txtArtistDescription.Text;
if (artprop.ArtistPropertyID == 0)
{
artprop.Create();
}
else
{
artprop.Update();
}
artprop = new ArtistProperty();
artprop.GetArtistPropertyForTypeArtist(art.ArtistID, SiteEnums.ArtistPropertyType.MD.ToString());
artprop.PropertyContent = txtArtistMetaDescription.Text;
if (artprop.ArtistPropertyID == 0)
{
artprop.Create();
}
else
{
artprop.Update();
}
if (fupArtistPhoto.HasFile)
{
artprop = new ArtistProperty();
artprop.GetArtistPropertyForTypeArtist(art.ArtistID, SiteEnums.ArtistPropertyType.PH.ToString());
artprop.PropertyContent = imgArtistPhoto.ImageUrl;
var b = new Bitmap(fupArtistPhoto.FileContent);
string saveS = string.Empty;
Image imgPhoto = null;
Color theBGColor = Color.Black;
string fileRoot = ArtistProperty.Artistimageprefix;
Guid fileGuid = Guid.NewGuid();
if (ddlBGColor.SelectedValue.ToLower() == "black")
{
theBGColor = Color.Black;
}
else if (ddlBGColor.SelectedValue.ToLower() == "white")
{
theBGColor = Color.White;
}
// delete main image if exists
if (!string.IsNullOrEmpty(artprop.PropertyContent))
{
// delete the existing file
try
{
File.Delete(Server.MapPath(artprop.PropertyContent));
}
catch (Exception ex)
{
Utilities.LogError(ex);
}
}
// 300 x 300
imgPhoto = b;
imgPhoto = ImageResize.FixedSize(imgPhoto, 300, 300, theBGColor);
saveS = fileRoot + artprop.ArtistID + "/" + fileGuid + "_main.jpg";
string artistFolder = ArtistProperty.Artistimageprefix + artprop.ArtistID;
if (!Directory.Exists(artistFolder))
//.........这里部分代码省略.........