本文整理汇总了C#中Company.CopyPropertiesFrom方法的典型用法代码示例。如果您正苦于以下问题:C# Company.CopyPropertiesFrom方法的具体用法?C# Company.CopyPropertiesFrom怎么用?C# Company.CopyPropertiesFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Company
的用法示例。
在下文中一共展示了Company.CopyPropertiesFrom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
Company company = new Company();
// Clone the original company for the linq track changes
if (originalCompany != null)
company.CopyPropertiesFrom(originalCompany);
//
// Set the company properties
//
company.ReferenceCompanyId = Company.ReferenceCompanyId;
company.MatrixId = String.IsNullOrEmpty(cboMatrixId.SelectedValue) ? company.CompanyId : Convert.ToInt32(cboMatrixId.SelectedValue);
company.StartDate = DateTime.Now;
company.NextStatementDueDate = DateTime.Now;
company.ModifiedDate = DateTime.Now;
company.LegalEntityProfileId = Profile_LegalEntity1.CompanyProfileEntity.LegalEntityProfileId;
//
// Add entity for insert
//
if (company.LegalEntityProfileId == 0)
company.LegalEntityProfile = Profile_LegalEntity1.CompanyProfileEntity;
if (Page.ViewState["CompanyId"] == null && Page.ViewState["ProfileExists"] != "0")
{
InsertCompanyStatus status = companyManager.InsertCompany(company, User.Identity.UserId, Company.CompanyId);
if (status != InsertCompanyStatus.Success)
{
ShowError("Ocorreu um erro ao inserir uma empresa!");
return;
}
}
else
companyManager.Update(originalCompany, company);
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "top.ResetHeader();", true);
if (!String.IsNullOrEmpty(Request["host"]))
Response.Redirect("~/Infocontrol/Host/Companies.aspx");
else
Response.Redirect("Companies.aspx");
}
}