public void CreateDefaultAdminDisplay() { MasterBank.currentBank = MasterBank.bankList[MasterBank.bankList.Count - 1]; Console.Clear(); string bankStaffId; InputForm.AddEmployeeField(); BankStaff admin = new BankStaff(); admin.FirstName = ValidatorHelper.StringValidator(40, 10); admin.LastName = ValidatorHelper.StringValidator(40, 12); admin.Dob = ValidatorHelper.DateValidator(40, 14); admin.Email = ValidatorHelper.EmailValidator(40, 16); admin.PanNumber = ValidatorHelper.PanValidator(40, 18); admin.ContactNumber = ValidatorHelper.PhoneValidator(40, 20); admin.address.addressLine1 = ValidatorHelper.StringValidator(40, 22); admin.address.addressLine2 = ValidatorHelper.StringValidator(40, 24); admin.address.city = ValidatorHelper.StringValidator(40, 26); admin.address.state = ValidatorHelper.StringValidator(40, 28); admin.address.pincode = ValidatorHelper.StringValidator(40, 30); admin.BankStaffRole = "Admin"; do { bankStaffId = ValidatorHelper.StringValidator(40, 34); if (adminService.IsDuplicateBankStaff(bankStaffId)) { break; } } while (true); admin.BankStaffId = (bankStaffId); admin.Password = (ValidatorHelper.StringValidator(40, 36)); adminService.AddNewAdmin(admin); }
public void CreateEmployeeDisplay() { Console.Clear(); string bankStaffId; InputForm.AddEmployeeField(); BankStaff employee = new BankStaff(); employee.FirstName = ValidatorHelper.StringValidator(40, 10); employee.LastName = ValidatorHelper.StringValidator(40, 12); employee.Dob = ValidatorHelper.DateValidator(40, 14); employee.Email = ValidatorHelper.EmailValidator(40, 16); employee.PanNumber = ValidatorHelper.PanValidator(40, 18); employee.ContactNumber = ValidatorHelper.PhoneValidator(40, 20); employee.address.addressLine1 = ValidatorHelper.StringValidator(40, 22); employee.address.addressLine2 = ValidatorHelper.StringValidator(40, 24); employee.address.city = ValidatorHelper.StringValidator(40, 26); employee.address.state = ValidatorHelper.StringValidator(40, 28); employee.address.pincode = ValidatorHelper.StringValidator(40, 30); employee.BankStaffRole = ValidatorHelper.StringValidator(40, 32);; do { bankStaffId = ValidatorHelper.StringValidator(40, 34); if (employeeService.IsDuplicateBankStaff(bankStaffId)) { break; } } while (true); employee.BankStaffId = (bankStaffId); employee.Password = (ValidatorHelper.StringValidator(40, 36)); employeeService.AddNewBankStaff(employee); }
public void WithdrawDisplay() { Console.Clear(); InputForm.DepositField(); double amount = Validator.ValidatorHelper.DoubleValidator(40, 10); accountService.Withdraw(amount); }
public void AddCurrencyExchangeRateDisplay() { Console.Clear(); InputForm.AddCurrencyExchangeRateField(); string currency = ValidatorHelper.StringValidator(40, 10); double rate = ValidatorHelper.DoubleValidator(40, 12); bankService.AddCurrencyExchangeRate(currency, rate); }
public void SameBankTransferDisplay(string type) { Console.Clear(); InputForm.SameTransferFundField(); double amount = Validator.ValidatorHelper.DoubleValidator(40, 10); string destinationAccountId = Validator.ValidatorHelper.StringValidator(40, 12); accountService.SameBankTransfer(amount, destinationAccountId, type); }
public void AddServiceChargeDisplay() { Console.Clear(); InputForm.AddServiceChargeField(); MasterBank.currentBank.SameTransferCharge.ImpsCharge = ValidatorHelper.DoubleValidator(40, 10); MasterBank.currentBank.SameTransferCharge.RtgsCharge = ValidatorHelper.DoubleValidator(40, 12); MasterBank.currentBank.OtherTransferCharge.ImpsCharge = ValidatorHelper.DoubleValidator(40, 14); MasterBank.currentBank.OtherTransferCharge.RtgsCharge = ValidatorHelper.DoubleValidator(40, 16); bankService.AddServiceCharge(); }
public void OtherBankTransferDisplay(string type) { Console.Clear(); InputForm.OtherTransferFundField(); double amount = Validator.ValidatorHelper.DoubleValidator(40, 10); string destinationBankId = Validator.ValidatorHelper.StringValidator(40, 12); string destinationAccountId = Validator.ValidatorHelper.StringValidator(40, 14); accountService.OtherBankTransfer(amount, destinationAccountId, MasterBank.GetBankById(destinationBankId), type); }
public void CreateAccountDisplay() { Console.Clear(); string accountHolderId, accountNumber; InputForm.AddAccountField(); Account account = new Account(); AccountHolder accountHolder = new AccountHolder(); accountHolder.FirstName = ValidatorHelper.StringValidator(40, 10); accountHolder.LastName = ValidatorHelper.StringValidator(40, 12); accountHolder.Dob = ValidatorHelper.DateValidator(40, 14); accountHolder.Email = ValidatorHelper.EmailValidator(40, 16); accountHolder.PanNumber = ValidatorHelper.PanValidator(40, 18); accountHolder.ContactNumber = ValidatorHelper.PhoneValidator(40, 20); accountHolder.address.addressLine1 = ValidatorHelper.StringValidator(40, 22); accountHolder.address.addressLine2 = ValidatorHelper.StringValidator(40, 24); accountHolder.address.city = ValidatorHelper.StringValidator(40, 26); accountHolder.address.state = ValidatorHelper.StringValidator(40, 28); accountHolder.address.pincode = ValidatorHelper.StringValidator(40, 30); do { accountHolderId = ValidatorHelper.StringValidator(40, 32); MasterBank.checkFor = 1; if (accountService.IsDuplicateAccountHolder(accountHolderId)) { break; } } while (true); accountHolder.AccountHolderId = (accountHolderId); accountHolder.Password = ValidatorHelper.StringValidator(40, 34); account.AccountHolderId = accountHolderId; Console.Clear(); InputForm.AddAccountInformation(); do { MasterBank.checkFor = 2; accountNumber = ValidatorHelper.StringValidator(40, 10); if (accountService.IsDuplicateAccountNumber(accountNumber)) { break; } } while (true); account.AccountNumber = accountNumber; account.Balance = ValidatorHelper.DoubleValidator(40, 12); account.AccountId = accountHolder.FirstName.Substring(0, 3) + DateHelper.GetTodayDate(2) + account.AccountNumber.Substring(0, 3); account.OpeningDate = DateHelper.GetTodayDate(2); accountService.AddNewAccount(accountHolder, account); }
public bool AdminLoginDisplay() { Console.Clear(); InputForm.LoginInputField(); string adminId = ValidatorHelper.StringValidator(40, 10); string password = ValidatorHelper.StringValidator(40, 12); bool isValid = adminService.AdminLogin(adminId, password); if (isValid == true) { return(true); } else { return(false); } }
public bool EmployeeLoginDisplay() { Console.Clear(); InputForm.LoginInputField(); string employeeId = ValidatorHelper.StringValidator(40, 10); string password = ValidatorHelper.StringValidator(40, 12); bool isValid = employeeService.EmployeeLogIn(employeeId, password); if (isValid == true) { return(true); } else { return(false); } }
public bool AccountLoginDisplay() { Console.Clear(); InputForm.LoginInputField(); /* ValidatorHelper has methods which takes input from user and validate it. * If input matches regex then it returns the input else ask again. * The parameters in those methods tells the x and y coordinate where * cursor will start taking input */ string accountHolderId = ValidatorHelper.StringValidator(40, 10); string password = ValidatorHelper.StringValidator(40, 12); bool isValid = accountService.LogIn(accountHolderId, password); if (isValid == true) { MasterBank.currentAccountHolder = accountHolderId; return(true); } else { Console.WriteLine("WRONG ID PASSWORD"); return(false); } }
public void UpdateAccountDisplay() { Console.Clear(); ViewAllAccounts(); Console.WriteLine("\t\t\tEnter AccountHolderID to update\n\t\t\tEnter B to go back"); string UpdateResponse = ValidatorHelper.StringValidator(120, 13); if (UpdateResponse != "B") { Console.Clear(); InputForm.AddAccountField(); AccountHolder accountHolder = accountService.GetAccountHolderById(UpdateResponse); if (accountHolder != null) { DisplayHelper.PrintTextAtXY(40, 10, accountHolder.FirstName); DisplayHelper.PrintTextAtXY(40, 12, accountHolder.LastName); DisplayHelper.PrintTextAtXY(40, 14, accountHolder.Dob.ToString()); DisplayHelper.PrintTextAtXY(40, 16, accountHolder.Email); DisplayHelper.PrintTextAtXY(40, 18, accountHolder.PanNumber); DisplayHelper.PrintTextAtXY(40, 20, accountHolder.ContactNumber.ToString()); DisplayHelper.PrintTextAtXY(40, 22, accountHolder.address.addressLine1); DisplayHelper.PrintTextAtXY(40, 24, accountHolder.address.addressLine2); DisplayHelper.PrintTextAtXY(40, 26, accountHolder.address.city); DisplayHelper.PrintTextAtXY(40, 28, accountHolder.address.state); DisplayHelper.PrintTextAtXY(40, 30, accountHolder.address.pincode); DisplayHelper.PrintTextAtXY(40, 34, accountHolder.AccountHolderId); DisplayHelper.PrintTextAtXY(40, 36, "**********"); string FieldToUpdate; do { DisplayHelper.PrintTextAtXY(40, 40, "Enter The Field No To Update or Q to go back"); FieldToUpdate = ValidatorHelper.StringValidator(40, 42); if (FieldToUpdate == "1") { accountHolder.FirstName = ValidatorHelper.StringValidator(40, 10); } else if (FieldToUpdate == "2") { accountHolder.LastName = ValidatorHelper.StringValidator(40, 12); } else if (FieldToUpdate == "3") { accountHolder.Dob = ValidatorHelper.DateValidator(40, 14); } else if (FieldToUpdate == "4") { accountHolder.Email = ValidatorHelper.EmailValidator(40, 16); } else if (FieldToUpdate == "5") { accountHolder.PanNumber = ValidatorHelper.PanValidator(40, 18); } else if (FieldToUpdate == "6") { accountHolder.ContactNumber = ValidatorHelper.PhoneValidator(40, 20); } else if (FieldToUpdate == "7") { accountHolder.address.addressLine1 = ValidatorHelper.StringValidator(40, 22); } else if (FieldToUpdate == "8") { accountHolder.address.addressLine2 = ValidatorHelper.StringValidator(40, 24); } else if (FieldToUpdate == "9") { accountHolder.address.city = ValidatorHelper.StringValidator(40, 26); } else if (FieldToUpdate == "10") { accountHolder.address.state = ValidatorHelper.StringValidator(40, 28); } else if (FieldToUpdate == "11") { accountHolder.address.pincode = ValidatorHelper.StringValidator(40, 30); } else if (FieldToUpdate == "12") { DisplayHelper.PrintTextAtXY(40, 42, "CANNOT CHANGE THIS FIELD"); } else if (FieldToUpdate == "13") { DisplayHelper.PrintTextAtXY(40, 42, "CANNOT CHANGE THIS FIELD"); } else if (FieldToUpdate == "Q") { break; } else { DisplayHelper.PrintTextAtXY(40, 42, "INVALID FIELD SELECTED"); } } while (FieldToUpdate != "Q"); } accountService.UpdateAccountHolder(accountHolder); } }
public void UpdateEmployeeDisplay() { Console.Clear(); ViewEmployee(); Console.WriteLine("\t\t\tEnter Id to update\n\t\t\tEnter B to go back"); string UpdateResponse = ValidatorHelper.StringValidator(120, 13); if (UpdateResponse != "B") { Console.Clear(); InputForm.AddEmployeeField(); BankStaff employee = employeeService.GetBankStaffById(UpdateResponse); if (employee != null) { DisplayHelper.PrintTextAtXY(40, 10, employee.FirstName); DisplayHelper.PrintTextAtXY(40, 12, employee.LastName); DisplayHelper.PrintTextAtXY(40, 14, employee.Dob.ToString()); DisplayHelper.PrintTextAtXY(40, 16, employee.Email); DisplayHelper.PrintTextAtXY(40, 18, employee.PanNumber); DisplayHelper.PrintTextAtXY(40, 20, employee.ContactNumber.ToString()); DisplayHelper.PrintTextAtXY(40, 22, employee.address.addressLine1); DisplayHelper.PrintTextAtXY(40, 24, employee.address.addressLine2); DisplayHelper.PrintTextAtXY(40, 26, employee.address.city); DisplayHelper.PrintTextAtXY(40, 28, employee.address.state); DisplayHelper.PrintTextAtXY(40, 30, employee.address.pincode); DisplayHelper.PrintTextAtXY(40, 32, employee.BankStaffRole); DisplayHelper.PrintTextAtXY(40, 34, employee.BankStaffId); DisplayHelper.PrintTextAtXY(40, 36, "**********"); string FieldToUpdate; do { DisplayHelper.PrintTextAtXY(40, 40, "Enter The Field No To Update or Q to go back"); FieldToUpdate = ValidatorHelper.StringValidator(40, 42); if (FieldToUpdate == "1") { employee.FirstName = ValidatorHelper.StringValidator(40, 10); } else if (FieldToUpdate == "2") { employee.LastName = ValidatorHelper.StringValidator(40, 12); } else if (FieldToUpdate == "3") { employee.Dob = ValidatorHelper.DateValidator(40, 14); } else if (FieldToUpdate == "4") { employee.Email = ValidatorHelper.EmailValidator(40, 16); } else if (FieldToUpdate == "5") { employee.PanNumber = ValidatorHelper.PanValidator(40, 18); } else if (FieldToUpdate == "6") { employee.ContactNumber = ValidatorHelper.PhoneValidator(40, 20); } else if (FieldToUpdate == "7") { employee.address.addressLine1 = ValidatorHelper.StringValidator(40, 22); } else if (FieldToUpdate == "8") { employee.address.addressLine2 = ValidatorHelper.StringValidator(40, 24); } else if (FieldToUpdate == "9") { employee.address.city = ValidatorHelper.StringValidator(40, 26); } else if (FieldToUpdate == "10") { employee.address.state = ValidatorHelper.StringValidator(40, 28); } else if (FieldToUpdate == "11") { employee.address.pincode = ValidatorHelper.StringValidator(40, 30); } else if (FieldToUpdate == "12") { employee.BankStaffRole = ValidatorHelper.StringValidator(40, 32); } else if (FieldToUpdate == "13") { DisplayHelper.PrintTextAtXY(40, 42, "CANNOT CHANGE THIS FIELD"); } else if (FieldToUpdate == "14") { DisplayHelper.PrintTextAtXY(40, 42, "CANNOT CHANGE THIS FIELD"); } else { DisplayHelper.PrintTextAtXY(40, 42, "INVALID FIELD SELECTED"); } } while (FieldToUpdate != "Q"); } employeeService.UpdateBankStaff(employee); } }