本文整理汇总了C#中Property.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Property.Save方法的具体用法?C# Property.Save怎么用?C# Property.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property.Save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SubmitChanges
private void SubmitChanges()
{
Property property = new Property(long.Parse(TextBoxPropertyId.Text));
property.Name = TextBoxPropertyName.Text;
property.LegalName = TextBoxLegalName.Text;
property.Active = RadioButtonActive.Checked;
try
{
//property.Active = true;
property.Address = TextBoxPhysicalAddress.Text;
RemitInfo remit = new RemitInfo((int)property.Id);
remit.Address = TextBoxRemitAddress.Text;
remit.City = TextBoxRemitCity.Text;
remit.Email = TextBoxRemitEmail.Text;
remit.Fax = TextBoxRemitFax.Text;
remit.Name = TextBoxRemitName.Text;
remit.State = TextBoxRemitState.Text;
remit.Telephone = TextBoxRemitTelephone.Text;
remit.Zip = TextBoxRemitZip.Text;
remit.Id = (int)property.Id;
remit.Save();
property.Save();
}
catch (Exception ex)
{
Session["PropertyErrorMessage"] = ex.Message;
return;
}
Session["PropertyChangesSubmitted"] = true;
}
示例2: AddProperty
private void AddProperty()
{
Property property = new Property();
property.Name = TextBoxPropertyName.Text;
property.Active = true;
property.LegalName = TextBoxLegalName.Text;
property.Id = Int32.Parse(TextBoxPropertyId.Text);
List<Property> properties = Property.Util.GetProperties();
foreach (Property prop in properties)
{
if (prop.Id == property.Id)
{
Session["PropertyErrorMessage"] = "<h2>Property number " + property.Id + " is already used.</h2>";
return;
}
}
try
{
property.Active = true;
property.Address = TextBoxPhysicalAddress.Text;
RemitInfo remit = new RemitInfo();
remit.Address = TextBoxRemitAddress.Text;
remit.City = TextBoxRemitCity.Text;
remit.Email = TextBoxRemitEmail.Text;
remit.Fax = TextBoxRemitFax.Text;
remit.Name = TextBoxRemitName.Text;
remit.State = TextBoxRemitState.Text;
remit.Telephone = TextBoxRemitTelephone.Text;
remit.Zip = TextBoxRemitZip.Text;
remit.Id = (int)property.Id;
remit.Save();
property.Save();
}
catch (Exception ex)
{
Session["PropertyErrorMessage"] = ex.Message;
return;
}
Session["AddPropertyFinished"] = true;
}