Example #1
0
 public AddChangeBankForm()
 {
     this.p_Bank = AIS.SN.Model.DomainObjects.Bank.Null;
     this.InitializeComponent();
     this.btnAccept.set_Text("Добавить");
     this.set_Text("Добавление банка");
 }
Example #2
0
 public AddChangeBankForm(AIS.SN.Model.DomainObjects.Bank bank)
 {
     this.p_Bank = AIS.SN.Model.DomainObjects.Bank.Null;
     this.InitializeComponent();
     this.btnAccept.set_Text("Изменить");
     this.set_Text("Изменение банка");
     this.p_Bank = bank;
 }
Example #3
0
 protected override void ClearText(object sender, System.EventArgs e)
 {
     this.SelectedBank = Bank.Null;
     if (this.OnBankSelected != null)
     {
         this.OnBankSelected(null);
     }
 }
Example #4
0
 public void Selected(Bank Bank)
 {
     this.SelectedBank = Bank;
     if (this.OnBankSelected != null)
     {
         this.OnBankSelected(Bank);
     }
 }
 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);
 }
Example #6
0
 public AddChangeBankForm(string name, string city, string code, string bik, string loro)
 {
     string str;
     this.p_Bank = AIS.SN.Model.DomainObjects.Bank.Null;
     this.InitializeComponent();
     this.btnAccept.set_Text("Добавить");
     this.set_Text("Добавление банка");
     this.tbShortName.set_Text(str = name);
     this.tbLongName.set_Text(str);
     this.tbCity.set_Text(city);
     this.mtbCode.set_Text(code);
     this.mtbBIK.set_Text(bik);
     this.mtbLoro.set_Text(loro);
 }
Example #7
0
 public BanksForm(Bank bank, BankHandler handler)
 {
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
     this.bankHandler = handler;
     if ((bank != null) && (bank != Bank.Null))
     {
         this.tbName.set_Text(bank.ShortName);
         this.mtbCode.set_Text(((long) bank.Code).ToString());
         this.mtbBIK.set_Text(bank.BIK);
         this.mtbLoro.set_Text(bank.LoroAccount.ToString());
         this.tbCity.set_Text(bank.City);
     }
     this.tsBtnSearch_Click(null, null);
     this.tsBtnSelect.set_Visible((bool) (this.selecting = true));
 }
Example #8
0
 private void btnAccept_Click(object sender, System.EventArgs e)
 {
     if (this.tbShortName.get_Text() == string.Empty)
     {
         BalloonWindow.Show(this.tbShortName, "Не указано короткое наименование банка");
     }
     else
     {
         if (this.tbLongName.get_Text() == string.Empty)
         {
             this.tbLongName.set_Text(this.tbShortName.get_Text());
         }
         if (this.mtbBIK.get_Text().get_Length() != 9)
         {
             BalloonWindow.Show(this.mtbBIK, "Банковский идентификационный номер должен быть указан и состоять из 9 цифр");
         }
         else if (System.Convert.ToDecimal(this.mtbLoro.get_Text()).ToString().get_Length() != 20)
         {
             BalloonWindow.Show(this.mtbLoro, "Номер корреспондентского счёта банка должен быть указан и состоять из 20 цифр и не начинаться с нуля");
         }
         else
         {
             string message = "Информация о банке успешно изменена.";
             if (this.p_Bank == AIS.SN.Model.DomainObjects.Bank.Null)
             {
                 this.p_Bank = new AIS.SN.Model.DomainObjects.Bank();
                 message = "Банк успешно создан.";
             }
             this.p_Bank.ShortName = this.tbShortName.get_Text();
             this.p_Bank.LongName = this.tbLongName.get_Text();
             this.p_Bank.City = this.tbCity.get_Text();
             this.p_Bank.Code = (this.mtbCode.get_Text() == string.Empty) ? ObjectWithId.GetNewColumnValue<AIS.SN.Model.DomainObjects.Bank>("sn", string.Empty) : ((long) System.Convert.ToInt32(this.mtbCode.get_Text()));
             this.p_Bank.BIK = this.mtbBIK.get_Text();
             this.p_Bank.LoroAccount = System.Convert.ToDecimal(this.mtbLoro.get_Text());
             try
             {
                 this.p_Bank.SaveChanges();
             }
             catch (System.Exception)
             {
                 Messages.ShowError("При сохранении банка произошла ошибка!\nВозможно, банк с таким БИК уже существует.");
                 base.Close();
                 return;
             }
             Messages.ShowMessage(message);
             base.set_DialogResult(System.Windows.Forms.DialogResult.OK);
             base.Close();
         }
     }
 }
Example #9
0
 public static ObjectList<BankAccount> Search(decimal accountNumber, Bank bank, Owner owner, bool isPrimary)
 {
     return Mappers.BankAccountMapper.Search(accountNumber, bank.Id, owner.Id, isPrimary);
 }