Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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);
            }
        }