public void Fill(NonresidentialApartmentHouseCounter nonresidentialApartmentHouse) { if (this.m_NonresidentialApartmentHouseCounter != nonresidentialApartmentHouse) { this.m_NonresidentialApartmentHouseCounter = nonresidentialApartmentHouse; if (this.m_NonresidentialApartmentHouseCounter == NonresidentialApartmentHouseCounter.Null) { this.Clear(); } else { this.bsConsumptions.set_DataSource(this.m_NonresidentialApartmentHouseCounter.GetHouseCounterNonresidentialApartmentConsumptions()); } } }
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_NonresidentialApartment == NonresidentialApartment.Null) { Messages.ShowMessage("Не выбрано жилое помещение"); } else { NonresidentialApartmentHouseCounter nonresidentialApartmentHouseCounter = new NonresidentialApartmentHouseCounter { NonresidentialApartmentId = this.m_NonresidentialApartment.Id }; if (new NonresidentialApartmentHouseCounterAddChangeForm(nonresidentialApartmentHouseCounter).ShowDialog(this) == System.Windows.Forms.DialogResult.Yes) { this.bsNonresidentialApartmentHouseCounters.Add(nonresidentialApartmentHouseCounter); this.bsNonresidentialApartmentHouseCounters.set_Position(this.bsNonresidentialApartmentHouseCounters.IndexOf(nonresidentialApartmentHouseCounter)); } } }
public NonresidentialApartmentHouseCounterAddChangeForm(NonresidentialApartmentHouseCounter nonresidentialApartmentHouseCounter) : this() { this.m_NonresidentialApartmentHouseCounter = nonresidentialApartmentHouseCounter; }
public NonresidentialApartmentHouseCounterAddChangeForm() { this.m_NonresidentialApartmentHouseCounter = NonresidentialApartmentHouseCounter.Null; this.InitializeComponent(); }
public int CountRows(NonresidentialApartmentHouseCounter nonresidentialApartmentHouse) { return this.bsConsumptions.get_Count(); }
public void Clear() { this.m_NonresidentialApartmentHouseCounter = NonresidentialApartmentHouseCounter.Null; this.bsConsumptions.Clear(); }