public ApartmentCounterSealAddChangeForm(ApartmentCounterSeal apartmentCounterSeal) : this() { this.m_ApartmentCounterSeals = apartmentCounterSeal; this.set_Text(apartmentCounterSeal.IsNew ? ((string) "Добавление опломбировки") : ((string) "Редактирование опломбировки")); this.btOk.set_Text(apartmentCounterSeal.IsNew ? ((string) "Добавить") : ((string) "Изменить")); this.m_ApartmentCounterSeals.BeginEdit(); this.bsApartmentCounterSeal.set_DataSource(this.m_ApartmentCounterSeals); }
private void toolStripButton1_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_ApartmentCounter != ApartmentCounter.Null) { ApartmentCounterSeal apartmentCounterSeal = new ApartmentCounterSeal { CounterId = this.m_ApartmentCounter.Id }; ApartmentCounterSealAddChangeForm form = new ApartmentCounterSealAddChangeForm(apartmentCounterSeal); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.bsApartmentCounterSeals.Add(apartmentCounterSeal); this.bsApartmentCounterSeals.set_Position(this.bsApartmentCounterSeals.IndexOf(apartmentCounterSeal)); } } }
public ApartmentCounterSealAddChangeForm() { this.m_ApartmentCounterSeals = ApartmentCounterSeal.Null; this.m_act = true; this.InitializeComponent(); }