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