当前位置: 首页>>代码示例>>C#>>正文


C# Property.Save方法代码示例

本文整理汇总了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;
 }
开发者ID:Devang83,项目名称:csc131,代码行数:30,代码来源:Property.ascx.cs

示例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;
    }
开发者ID:Devang83,项目名称:csc131,代码行数:41,代码来源:Property.ascx.cs


注:本文中的Property.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。