public AddChangeBankAccountForm()
 {
     this.p_BankAccount = AIS.SN.Model.DomainObjects.BankAccount.Null;
     this.InitializeComponent();
     this.btnAccept.set_Text("Добавить");
     this.set_Text("Добавление расчётного счёта");
 }
 public AddChangeBankAccountForm(string accountNumber, Owner owner, Bank bank, bool isPrimary)
 {
     this.p_BankAccount = AIS.SN.Model.DomainObjects.BankAccount.Null;
     this.InitializeComponent();
     this.btnAccept.set_Text("Добавить");
     this.set_Text("Добавление расчётного счёта");
     this.mtbAccountNumber.set_Text(accountNumber);
     this.selectOwner.SelectedOwner = owner;
     this.selectBank.SelectedBank = bank;
     this.cbOwnersPrimary.set_Checked(isPrimary);
 }
Esempio n. 3
0
 public BankAccountsForm(BankAccount bankAccount, BankAccountHandler handler)
     : this()
 {
     this.handler = handler;
     System.Collections.Generic.List<BankAccount> list = new System.Collections.Generic.List<BankAccount>();
     if (bankAccount != null)
     {
         list.Add(bankAccount);
     }
     for (int i = (int) (Register.BankAccountCache.get_Count() - 1); i >= 0; i = (int) (i - 1))
     {
         if ((bankAccount == null) || (bankAccount.Id != Register.BankAccountCache.get_Item(i).Id))
         {
             list.Add(Register.BankAccountCache.get_Item(i));
         }
     }
     if (bankAccount != null)
     {
         list.Add(bankAccount);
     }
     this.bsBankAccounts.set_DataSource(list);
 }
 private void btnAccept_Click(object sender, System.EventArgs e)
 {
     if (this.mtbAccountNumber.get_Text() == string.Empty)
     {
         BalloonWindow.Show(this.mtbAccountNumber, "Не указан номер расчётного счёта");
     }
     else if ((this.selectOwner.SelectedOwner == null) || (this.selectOwner.SelectedOwner == Owner.Null))
     {
         BalloonWindow.Show(this.gbOwner, "Не указан владелец расчётного счёта");
     }
     else if ((this.selectBank.SelectedBank == null) || (this.selectBank.SelectedBank == Bank.Null))
     {
         BalloonWindow.Show(this.selectBank, "Не указан банк расчётного счёта");
     }
     else if (System.Convert.ToDecimal(this.mtbAccountNumber.get_Text()).ToString().get_Length() < 20)
     {
         BalloonWindow.Show(this.mtbAccountNumber, "Номер расчётного счёта должен состоять из 20 цифр и не начинаться с нуля");
     }
     else
     {
         string message = "Информация о расчётном счёте успешно изменена.";
         if (this.p_BankAccount == AIS.SN.Model.DomainObjects.BankAccount.Null)
         {
             this.p_BankAccount = new AIS.SN.Model.DomainObjects.BankAccount();
             message = "Расчётной счёт успешно создан.";
         }
         this.p_BankAccount.AccountNumber = System.Convert.ToDecimal(this.mtbAccountNumber.get_Text());
         this.p_BankAccount.OwnerId = this.selectOwner.SelectedOwner.Id;
         this.p_BankAccount.BankId = this.selectBank.SelectedBank.Id;
         this.p_BankAccount.IsPrimary = this.cbOwnersPrimary.get_Checked();
         try
         {
             this.p_BankAccount.SaveChanges();
         }
         catch (System.Exception)
         {
             Messages.ShowError("При сохранении расчётного счёта произошла ошибка!");
             base.Close();
             return;
         }
         Messages.ShowMessage(message);
         base.set_DialogResult(System.Windows.Forms.DialogResult.OK);
         base.Close();
     }
 }
Esempio n. 5
0
 public BankAccountsForm()
 {
     this.selectBankAccount = new BankAccount();
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
 }