public ApartmentEquipmentCounterAddChangeForm(ApartmentEquipmentCounter aec)
 {
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
     this.m_ApartmentEqCnt = aec;
     this.set_Text(this.m_ApartmentEqCnt.IsNew ? ((string) "Добавление новой связи приборов учета с оборудованием") : ((string) "Изменение связи приборов учета с оборудование"));
     this.btOk.set_Text(this.m_ApartmentEqCnt.IsNew ? ((string) "Добавить") : ((string) "Изменить"));
     this.bsApartmentEquipmentCounters.set_DataSource(this.m_ApartmentEqCnt);
     this.m_ApartmentEqCnt.BeginEdit();
 }
 private void btnCounterEquipmentsAdd_Click(object sender, System.EventArgs e)
 {
     ApartmentEquipmentCounter aec = new ApartmentEquipmentCounter {
         ApartmentId = this.m_ApartmentCounter.ApartmentId
     };
     ApartmentEquipmentCounterAddChangeForm form = new ApartmentEquipmentCounterAddChangeForm(aec);
     if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
     {
         this.bsApartmentCounterEquipments.Add(aec);
         this.bsApartmentCounterEquipments.set_Sort(this.bsApartmentCounterEquipments.get_Sort());
     }
 }