private void btOK_Click(object sender, System.EventArgs e)
 {
     if (((this.selectTypeEDK.SelectedFasetItem == FasetItem.Null) || this.dbxFromDate.IsNull) || this.dbxCreated.IsNull)
     {
         Messages.ShowWarning("Заполнены не все поля");
     }
     else
     {
         if (this.m_ApartmentResidentBenefitProperty == null)
         {
             this.m_ApartmentResidentBenefitProperty = new ApartmentResidentBenefitProperty();
             this.m_ApartmentResidentBenefitProperty.ApartmentResidentId = this.m_ApartmentResident.Id;
         }
         this.m_ApartmentResidentBenefitProperty.BankId = ((Bank) this.bsBank.get_Current()).Id;
         this.m_ApartmentResidentBenefitProperty.Kind = this.selectTypeEDK.SelectedFasetItem.Id;
         this.m_ApartmentResidentBenefitProperty.FromDate = this.dbxFromDate.Value;
         this.m_ApartmentResidentBenefitProperty.Created = this.dbxCreated.Value;
         this.m_ApartmentResidentBenefitProperty.SaveChanges();
         base.Close();
     }
 }
 public ApartmentResidentBenefitPropertiesForm(ApartmentResident apartmentResident, ApartmentResidentBenefitProperty apartmentResidentBenefitProperty)
     : this()
 {
     this.m_ApartmentResident = apartmentResident;
     this.m_ApartmentResidentBenefitProperty = (apartmentResidentBenefitProperty != null) ? apartmentResidentBenefitProperty : null;
 }