public void Fill(NonresidentialApartment nonresidentialApartment)
 {
     if (this.m_NonresidentialApartment != nonresidentialApartment)
     {
         this.Clear();
         this.m_NonresidentialApartment = nonresidentialApartment;
         this.UpdateBindingSourceNonresidentialApartmentHouseCounters();
     }
 }
 public NonresidentialApartmentsAddChangeForm(NonresidentialApartment nonresidentialApartment)
     : this()
 {
     this.m_NonresidentialApartment = nonresidentialApartment;
 }
 public NonresidentialApartmentsAddChangeForm()
 {
     this.m_NonresidentialApartment = NonresidentialApartment.Null;
     this.InitializeComponent();
 }
 public void Clear()
 {
     this.m_NonresidentialApartment = NonresidentialApartment.Null;
     this.bsNonresidentialApartmentHouseCounters.Clear();
     this.houseCounterNonresidentialApartmentConsumptionsView.Clear();
 }
 private void tsbtnAdd_Click(object sender, System.EventArgs e)
 {
     if (System.Windows.Forms.Application.OpenForms.get_Item(0).GetType().ToString() == "AIS.SN.UI.Provider.ProviderMainForm")
     {
         string valueByName = Setting.GetValueByName("Работа с приборами учета", "Диапазон в который разрешено редактирование в Поставщике");
         if ((System.Convert.ToInt32(valueByName.Substring(0, valueByName.IndexOf('-'))) > System.DateTime.Now.get_Day()) || (System.Convert.ToInt32(valueByName.Substring((int) (valueByName.IndexOf('-') + 1), (int) ((valueByName.get_Length() - valueByName.IndexOf('-')) - 1))) < System.DateTime.Now.get_Day()))
         {
             System.Windows.Forms.MessageBox.Show(string.Concat((string[]) new string[] { "Вам разрешено редактирование данных только с ", valueByName.Substring(0, valueByName.IndexOf('-')), " по ", valueByName.Substring((int) (valueByName.IndexOf('-') + 1), (int) ((valueByName.get_Length() - valueByName.IndexOf('-')) - 1)), " числа месяца" }), "Редактирование запрещено", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Hand);
             return;
         }
     }
     if (this.m_House == House.Null)
     {
         Messages.ShowMessage("Не выбран паспорт дома");
     }
     else
     {
         NonresidentialApartment nonresidentialApartment = new NonresidentialApartment {
             HouseId = this.m_House.Id
         };
         new NonresidentialApartmentsAddChangeForm(nonresidentialApartment).ShowDialog(this);
         if (!nonresidentialApartment.IsNew)
         {
             this.bsNonresidentialApartments.Add(nonresidentialApartment);
             this.bsNonresidentialApartments.set_Position(this.bsNonresidentialApartments.IndexOf(nonresidentialApartment));
         }
     }
 }