本文整理汇总了C#中Portfolio.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Portfolio.Save方法的具体用法?C# Portfolio.Save怎么用?C# Portfolio.Save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Portfolio
的用法示例。
在下文中一共展示了Portfolio.Save方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
public void Update(int PortfolioId,string ProjectName,string ProjectDescription,string ToolsAndTechniques,string ProjectURL,string PortfolioImage)
{
Portfolio item = new Portfolio();
item.MarkOld();
item.IsLoaded = true;
item.PortfolioId = PortfolioId;
item.ProjectName = ProjectName;
item.ProjectDescription = ProjectDescription;
item.ToolsAndTechniques = ToolsAndTechniques;
item.ProjectURL = ProjectURL;
item.PortfolioImage = PortfolioImage;
item.Save(UserName);
}
示例2: Insert
public void Insert(string ProjectName,string ProjectDescription,string ToolsAndTechniques,string ProjectURL,string PortfolioImage)
{
Portfolio item = new Portfolio();
item.ProjectName = ProjectName;
item.ProjectDescription = ProjectDescription;
item.ToolsAndTechniques = ToolsAndTechniques;
item.ProjectURL = ProjectURL;
item.PortfolioImage = PortfolioImage;
item.Save(UserName);
}
示例3: UploadPrintableFile
string UploadPrintableFile(Portfolio portfolio)
{
string NewFileName = portfolio.PortfolioId + "-" + Path.GetFileName(fuPortfolioImage.PostedFile.FileName);
string FileNameWithoutExt = portfolio.PortfolioId + "-" + Path.GetFileNameWithoutExtension(fuPortfolioImage.PostedFile.FileName);
string error;
if (fuPortfolioImage.PostedFile.FileName == null || fuPortfolioImage.PostedFile.FileName.Equals("") && portfolioId == 0)
{
portfolio = new Portfolio(Portfolio.Columns.PortfolioId, portfolio.PortfolioId);
portfolio.IsNew = false;
portfolio.PortfolioImage = "NoImage.jpg";
portfolio.Save(Guid.NewGuid());
return string.Empty;
}
if (fuPortfolioImage.PostedFile.ContentLength > 1)
{
Utility.DeleteFile(AdminSite.Global.PortFolio + portfolio.PortfolioImage);
if (Utility.UploadFile(fuPortfolioImage, FileNameWithoutExt, AdminSite.Global.PortFolio, out error))
{
portfolio = new Portfolio(Portfolio.Columns.PortfolioId, portfolio.PortfolioId);
portfolio.IsNew = false;
portfolio.PortfolioImage = NewFileName;
portfolio.Save(Guid.NewGuid());
}
else
{
Client.Destroy(portfolio.PortfolioId);
return error.ToString();
}
}
return String.Empty;
}
示例4: Save
public void Save()
{
Portfolio portfolio = new Portfolio();
portfolio.IsNew = true;
portfolio.ProjectName = txtProjectName.Text;
portfolio.ProjectDescription = txtProjectDescription.Text;
portfolio.ProjectURL = txtProjectURL.Text;
String toolsAndTechniques = String.Empty;
foreach (ListItem item in chkBoxList1.Items)
{
if (item.Selected)
{
toolsAndTechniques = String.Concat(toolsAndTechniques,item.Value, ",");
}
}
portfolio.ToolsAndTechniques = toolsAndTechniques;
portfolio.Save();
//Now Save Picture As Well..
string result = UploadPrintableFile(portfolio);
if (result.Equals(""))
{
divStatusError.Visible = false;
divStatusSuccess.Visible = true;
lblStatusSuccess.Text = AdminSite.Global.SuccessLabelStatus;
//lblStatusSuccess.ForeColor = System.Drawing.Color.Green;
}
else
{
divStatusSuccess.Visible = false;
divStatusError.Visible = true;
labelStatusError.Text = AdminSite.Global.ErrorLabelStatus + result;
//labelStatusError.ForeColor = System.Drawing.Color.Red;
}
ClearForm();
}
示例5: btnAddProject_Click
protected void btnAddProject_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
if (portfolioId > 0)
{
Portfolio portfolio = new Portfolio(portfolioId);
portfolio.IsNew = false;
portfolio.ProjectName = txtProjectName.Text;
portfolio.ProjectDescription = txtProjectDescription.Text;
portfolio.ProjectURL = txtProjectURL.Text;
String toolsAndTechniques = String.Empty;
foreach (ListItem item in chkBoxList1.Items)
{
if (item.Selected)
{
toolsAndTechniques = String.Concat(toolsAndTechniques,item.Value, ",");
}
}
portfolio.ToolsAndTechniques = toolsAndTechniques;
try
{
portfolio.Save();
UploadPrintableFile(portfolio);
divStatusError.Visible = false;
divStatusSuccess.Visible = true;
lblStatusSuccess.Text = AdminSite.Global.UpdatedLabelStatus;
//lblStatusSuccess.ForeColor = System.Drawing.Color.Green;
}
catch (Exception ex)
{
divStatusSuccess.Visible = false;
divStatusError.Visible = true;
labelStatusError.Text = AdminSite.Global.ErrorLabelStatus + ex.ToString();
//labelStatusError.ForeColor = System.Drawing.Color.Red;
}
}
else
{
try
{
Save();
}
catch (Exception ex)
{
divStatusSuccess.Visible = false;
divStatusError.Visible = true;
labelStatusError.Text = AdminSite.Global.ErrorLabelStatus + ex.ToString();
}
}
}
}