private void HouseApartmentTypeForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { if ((!this.save && (System.Windows.Forms.MessageBox.Show("Данные не сохраны. Сохранить данные перед закрытием?", "Предупреждение", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)) && !this.SaveChange()) { e.set_Cancel(true); } }
private void reportsTree_BeforeSelect(object sender, System.Windows.Forms.TreeViewCancelEventArgs e) { if (e.Node.ForeColor == System.Drawing.Color.Gray) { e.set_Cancel(true); } }
protected override void OnBeforeSelect(System.Windows.Forms.TreeViewCancelEventArgs e) { try { base.set_SelectedNode(null); e.set_Cancel(true); base.OnBeforeSelect(e); } catch (System.Exception exception) { this.HandleException(exception); } }
private void SplitApartmentForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { if (this.bckWrkrProcessSpliting.get_IsBusy() && (Messages.QuestionYesNo(this, "Выполнятеся фоновый процесс разделения паспорта жилья, закрытие окна приведёт к прерыванию этого процесса, которое может привести к непредсказуемым результатм." + System.Environment.get_NewLine() + " вы уверены, что хотите закрыть форму?") == System.Windows.Forms.DialogResult.No)) { e.set_Cancel(true); } }
private void CalcPeriodsForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { e.set_Cancel(this.m_CalcWorker.get_IsBusy()); }
private void dgTariffView_CellValidating(object sender, System.Windows.Forms.DataGridViewCellValidatingEventArgs e) { try { if ((this.dgTariffView.Columns.get_Item(e.get_ColumnIndex()) == this.NewRateDataGridViewTextBoxColumn) && (((string) e.get_FormattedValue()) != string.Empty)) { decimal.Parse((string) ((string) e.get_FormattedValue())); } } catch (System.Exception exception) { Messages.ShowException(this, exception); e.set_Cancel(true); } }
private void LoadPayReestersForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { if (this.m_MailExLoadWorker.get_IsBusy() || this.m_FileLoadWorker.get_IsBusy()) { e.set_Cancel(true); } }
private void m_ServicesGrid_CellBeginEdit(object sender, System.Windows.Forms.DataGridViewCellCancelEventArgs e) { if ((this.m_ServicesGrid.Columns.get_Item(e.get_ColumnIndex()) == this.newCounterIndicationDataGridViewTextBoxColumn) && (this.m_OrderDate != Constants.NullDate)) { bool flag = ((PayRequestService) this.m_ServicesGrid.Rows.get_Item(e.get_RowIndex()).get_DataBoundItem()).ValidatedApartmentCounterIndicationDate(this.m_OrderDate); this.m_ServicesGrid.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).set_ReadOnly(flag); e.set_Cancel(flag); if (flag) { Messages.ShowMessage("Редактирование показаний невозможно,т.к. на данном счетчике есть показания с датой больше или равной " + this.m_OrderDate.ToShortDateString()); } } }
private void dgvApartmentCounterIndicationsView_RowValidating(object sender, System.Windows.Forms.DataGridViewCellCancelEventArgs e) { if (this.m_CancelRowValidation) { e.set_Cancel(true); this.m_CancelRowValidation = false; } this.m_CancelRowValidation = false; }
private void ChangeAdditionalServiceNormForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { if ((base.DialogResult != System.Windows.Forms.DialogResult.OK) && (System.Windows.Forms.MessageBox.Show("Внесенные изменения не будут сохранены. Закрыть окно?", "Предупреждение", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)) { e.set_Cancel(true); } }
private void dgvNotes_CellValidating(object sender, System.Windows.Forms.DataGridViewCellValidatingEventArgs e) { try { if (this.dgvNotes.Columns.get_Item(e.get_ColumnIndex()) == this.serviceCodeDataGridViewTextBoxColumn) { if (((string) e.get_FormattedValue()) != string.Empty) { int.Parse((string) ((string) e.get_FormattedValue())); } } else if (((this.dgvNotes.Columns.get_Item(e.get_ColumnIndex()) == this.counterIndDataGridViewTextBoxColumn) || (this.dgvNotes.Columns.get_Item(e.get_ColumnIndex()) == this.paidSummDataGridViewTextBoxColumn)) && ((((string) e.get_FormattedValue()) != string.Empty) && (decimal.Parse((string) ((string) e.get_FormattedValue())) < 0M))) { Messages.ShowMessage("Введите неотрицательное число"); e.set_Cancel(true); } } catch (System.Exception exception) { Messages.ShowException(this, exception); e.set_Cancel(true); } }
private void m_Grid_CellValidating(object sender, System.Windows.Forms.DataGridViewCellValidatingEventArgs e) { try { if (this.m_Grid.Columns.get_Item(e.get_ColumnIndex()) == this.fromDateDataGridViewTextBoxColumn) { if (((string) e.get_FormattedValue()) != string.Empty) { System.DateTime.Parse((string) ((string) e.get_FormattedValue())); } } else if (((this.m_Grid.Columns.get_Item(e.get_ColumnIndex()) == this.chargeSummDataGridViewTextBoxColumn) && this.chbxValidateNegativeSumm.get_Checked()) && (decimal.Parse((string) ((string) e.get_FormattedValue())) < 0M)) { Messages.ShowMessage("Ввод отрицательной суммы ограничен!"); e.set_Cancel(true); } } catch (System.Exception exception) { Messages.ShowException(this, exception); e.set_Cancel(true); } }
private void dgvTargetAccountServices_CellValidating(object sender, System.Windows.Forms.DataGridViewCellValidatingEventArgs e) { if (e.get_ColumnIndex() == this.dgvTargetAccountServices.Columns.get_Item("Summ").get_Index()) { decimal num; string str = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.get_NumberDecimalSeparator(); if (!decimal.TryParse(((string) e.get_FormattedValue()).Replace(".", str).Replace(",", str), ref num)) { e.set_Cancel(true); Messages.ShowWarning("Введенная сумма не является числом! Для отмены ввода нажмите ESCAPE."); } if (num < 0M) { e.set_Cancel(true); Messages.ShowWarning("Введенная сумма должна быть положительной! Для отмены ввода нажмите ESCAPE."); } } }
private void dgvServices_CellValidating(object sender, System.Windows.Forms.DataGridViewCellValidatingEventArgs e) { try { if ((this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.CurrentRateFromDate) || (this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.ServiceNormFromDate)) { if (((string) e.get_FormattedValue()) != string.Empty) { System.DateTime.Parse((string) ((string) e.get_FormattedValue())); } else { this.dgvServices.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).set_Value(Constants.NullDate); ServiceOld old = (ServiceOld) this.dgvServices.Rows.get_Item(e.get_RowIndex()).get_DataBoundItem(); if (this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.CurrentRateFromDate) { old.CurrentRateFromDate = Constants.NullDate; old.CurrentRate = 0M; } if (this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.ServiceNormFromDate) { old.ServiceNormFromDate = Constants.NullDate; old.ServiceNormRate = 0M; } this.bsServices.ResumeBinding(); } } else if (((this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.CurrentRate) || (this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.ServiceNormRate)) && (((string) e.get_FormattedValue()) != string.Empty)) { decimal.Parse((string) ((string) e.get_FormattedValue())); } } catch (System.Exception exception) { Messages.ShowException(this, exception); e.set_Cancel(true); } }
private void dgvServices_CellBeginEdit(object sender, System.Windows.Forms.DataGridViewCellCancelEventArgs e) { if (((this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.ServiceNormRate) || (this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.ServiceNormFromDate)) && (this._mServiceOld.ServiceNormId == ServiceNorm.Null.Id)) { Messages.ShowMessage("Необходимо сначала задать норматив на исходной услуге"); e.set_Cancel(true); } }