private void tsbChange_Click(object sender, System.EventArgs e) { AccountServiceSubQuality accountServiceSubQuality = (this.bsAccountServiceSubQualities.get_Current() as AccountServiceSubQuality) ?? AccountServiceSubQuality.Null; if (accountServiceSubQuality == AccountServiceSubQuality.Null) { Messages.ShowMessage("Выберите элемент для изменения"); } else { AccountServiceSubQualityAddChangeForm form = new AccountServiceSubQualityAddChangeForm(accountServiceSubQuality); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.bsAccountServiceSubQualities.set_Sort(this.bsAccountServiceSubQualities.get_Sort()); this.bsAccountServiceSubQualities.set_Position(this.bsAccountServiceSubQualities.IndexOf(accountServiceSubQuality)); } } }
private void tsbAdd_Click(object sender, System.EventArgs e) { if (this.m_AccountService != AccountService.Null) { AccountServiceSubQuality accountServiceSubQuality = new AccountServiceSubQuality { AccountServiceId = this.m_AccountService.Id }; AccountServiceSubQualityAddChangeForm form = new AccountServiceSubQualityAddChangeForm(accountServiceSubQuality); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.Yes) { this.bsAccountServiceSubQualities.set_DataSource(this.m_AccountService.GetAccountServiceSubQuality()); this.bsAccountServiceSubQualities.set_Position(this.bsAccountServiceSubQualities.Find("Id", (long) accountServiceSubQuality.Id)); } } }