public ApartmentHousekeepingEquipmentChangeForm(ApartmentEquipmentHousekeeping aeh)
 {
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
     this.m_ApartmentEqHk = aeh;
     this.set_Text(this.m_ApartmentEqHk.IsNew ? ((string) "Добавление новой связи приусадебного хозяйства с оборудование") : ((string) "Изменение связи приусадебного хозяйства с оборудование"));
     this.btOk.set_Text(this.m_ApartmentEqHk.IsNew ? ((string) "Добавить") : ((string) "Изменить"));
     this.bsApartmentHousekeepingEquipments.set_DataSource(this.m_ApartmentEqHk);
     this.m_ApartmentEqHk.BeginEdit();
 }
 private void btnEquipmentHousekeepingAdd_Click(object sender, System.EventArgs e)
 {
     if (this.m_Apartment != Apartment.Null)
     {
         ApartmentEquipmentHousekeeping aeh = new ApartmentEquipmentHousekeeping {
             ApartmentId = this.m_Apartment.Id
         };
         ApartmentHousekeepingEquipmentChangeForm form = new ApartmentHousekeepingEquipmentChangeForm(aeh);
         if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
         {
             this.bsHousekeepingEquipments.Add(aeh);
             this.bsHousekeepingEquipments.set_Sort(this.bsHousekeepingEquipments.get_Sort());
         }
     }
 }