示例#1
0
        public bool CreateNewBankDisplay()
        {
            Bank bank = new Bank();

            Console.Clear();
            InputForm.CreateNewBankField();
            bank.Name     = ValidatorHelper.NameValidator(40, 10);
            bank.Currency = "INR";
            bank.BankId   = bank.Name.Substring(0, 3) + DateHelper.GetTodayDate(1);
            bank.SameTransferCharge.ImpsCharge  = 0.05;
            bank.SameTransferCharge.RtgsCharge  = 0.0;
            bank.OtherTransferCharge.ImpsCharge = 0.06;
            bank.OtherTransferCharge.RtgsCharge = 0.02;
            try
            {
                bankService.CreateNewBank(bank);
            }
            catch (Exception)
            {
                DisplayHelper.PrintTextAtXY(80, 40, "BANK ALREADY EXIST WITH THE SAME NAME");
                return(false);
            }
            DisplayHelper.PrintTextAtXY(80, 40, "BANK CREATED SUCCESSFULLY");
            return(true);
        }
 public ActionResult AddNewBank(BankDTO model)
 {
     if (!ModelState.IsValid)
         return View(model);
     try
     {
         model.SetCreateNewLog("System");
         bankService.CreateNewBank(model.BankCode, model.BankName, "Dimas");
         return RedirectToAction("Index");
     }
     catch (Exception ex)
     {
         AddErrors(new[] { ex.Message });
         return View(model);
     }
     
 }