예제 #1
0
 private void tsbDebtActionsChange_Click(object sender, System.EventArgs e)
 {
     DebtAction debtAction = (this.bsDebtActions.get_Current() as DebtAction) ?? DebtAction.Null;
     if (debtAction == DebtAction.Null)
     {
         Messages.ShowMessage("Выберите элемент для редактирования");
     }
     else
     {
         DebtActionAddChangeForm form = new DebtActionAddChangeForm(debtAction);
         if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
         {
             this.bsDebtActions.set_Sort(this.bsDebtActions.get_Sort());
             this.bsDebtActions.set_Position(this.bsDebtActions.IndexOf(debtAction));
             this.bsDebtActions.set_Sort(this.bsDebtActions.get_Sort());
             this.bsDebtActions.set_Position(this.bsDebtActions.IndexOf(debtAction));
         }
     }
 }
예제 #2
0
 private void tsbDebtActionAdd_Click(object sender, System.EventArgs e)
 {
     if (this.m_debtAffair != DebtAffair.Null)
     {
         DebtAction debtAction = new DebtAction {
             DebtAffairId = this.m_debtAffair.Id
         };
         DebtActionAddChangeForm form = new DebtActionAddChangeForm(debtAction);
         if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
         {
             this.bsDebtActions.Add(debtAction);
             this.bsDebtActions.set_Sort(this.bsDebtActions.get_Sort());
             this.bsDebtActions.set_Position(this.bsDebtActions.IndexOf(debtAction));
         }
     }
 }