private void tsbEdit_Click(object sender, System.EventArgs e) { RepReportTemplate currentRepReportTemplate = this.GetCurrentRepReportTemplate(); if ((currentRepReportTemplate != null) && (currentRepReportTemplate != RepReportTemplate.Null)) { AdminReportAddChangeForm form = new AdminReportAddChangeForm(currentRepReportTemplate); form.set_Text("Изменение отчета"); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.bsReportTemplate.set_Sort(this.bsReportTemplate.get_Sort()); this.UpdateBindingSourceReportTemplate(); this.bsReportTemplate.set_Position(this.bsReportTemplate.IndexOf(currentRepReportTemplate)); } } }
private void tbsAdd_Click(object sender, System.EventArgs e) { RepReportTemplate reportTemplate = new RepReportTemplate(); AdminReportAddChangeForm form = new AdminReportAddChangeForm(reportTemplate); form.set_Text("Добавление отчета"); if (form.ShowDialog(this) != System.Windows.Forms.DialogResult.OK) { this.bsReportTemplate.set_Sort(this.bsReportTemplate.get_Sort()); this.UpdateBindingSourceReportTemplate(); this.bsReportTemplate.set_Position(this.bsReportTemplate.IndexOf(reportTemplate)); } }