コード例 #1
0
        public static void RegisterAccountHolder()
        {
            Console.Clear();
            Console.WriteLine("     ACCOUNT HOLDER REGISTRATION");

            Console.Write("Enter your First Name: ");
            string firstName = Console.ReadLine();

            Console.Write("Enter your Last Name: ");
            string lastName = Console.ReadLine();

            Console.Write("Enter your Middle Name: ");
            string middleName = Console.ReadLine();

            Console.Write("Enter your Date Of Birth (yyyy/mm/dd): ");
            DateTime dateOfBirth = Convert.ToDateTime(Console.ReadLine());

            Console.Write("Enter your Email Address: ");
            string email = Console.ReadLine();

            Console.Write("Enter your Phone Number: ");
            string phoneNumber = Console.ReadLine();

            Console.Write("Enter your Address: ");
            string address = Console.ReadLine();

            Console.Write("Enter your Password: "******"Confirm your Password:  ");
            string confirmPassword = Console.ReadLine();


            AccountHolderService.CreateAccountHolder(firstName, lastName, middleName, dateOfBirth, email, phoneNumber, address, password, confirmPassword);
        }
コード例 #2
0
        public async Task <JsonResult> SignUpAccountHolder(SignUpAccountHolderViewModel model)
        {
            var verificationCode = await _verificationCodeService.GetVerificationCode(int.Parse(model.VerificationCode), model.PhoneNumber);

            if (verificationCode == null)
            {
                throw new UserFriendlyException("Invalid verification code");
            }

            //Delete verificationCode.
            _verificationCodeService.ClearVerificationCode(verificationCode);

            var user = await _userSignUpManager.SignUpAsync(
                model.FirstName,
                model.LastName,
                model.Email,
                model.PhoneNumber,
                model.UserName,
                model.Password,
                true);

            var accountHolder = _accountHolderService.CreateAccountHolder(user.Id);

            //Check if InterestStatus is running and bootstrap Interest for accountholder.
            var interestStatus = await SettingManager.GetSettingValueAsync(AppSettingNames.InterestStatus);

            if (SavingsInterest.StatusTypes.Running.Equals(interestStatus))
            {
                await _savingsInterestManager.BootstrapNewSavingsInterestForAccountHolder(accountHolder.Id);
            }

            //Send a welcome text and email, with AccountHolder Identity.
            _notificationScheduler.ScheduleWelcomeMessage(user.PhoneNumber, user.EmailAddress, accountHolder.AccountIdentity);

            return(Json(new AjaxResponse {
                TargetUrl = "/SignUp/SuccessfulSignUp"
            }));
        }
        public static void HandleAccountHolderMenu(string subOption)
        {
            if (subOption.Equals("0"))
            {
                return;
            }
            else if (subOption.Equals("1"))
            {
                Console.Clear();
                Console.WriteLine("     ACCOUNT HOLDER REGISTRATION");

                Console.Write("Enter your First Name: ");
                string firstName = Console.ReadLine();

                Console.Write("Enter your Last Name: ");
                string lastName = Console.ReadLine();

                Console.Write("Enter your Middle Name: ");
                string middleName = Console.ReadLine();

                Console.Write("Enter your Date Of Birth (yyyy/mm/dd): ");
                DateTime dateOfBirth = Convert.ToDateTime(Console.ReadLine());

                Console.Write("Enter your Email Address: ");
                string email = Console.ReadLine();

                Console.Write("Enter your Phone Number: ");
                string phoneNumber = Console.ReadLine();

                Console.Write("Enter your Address: ");
                string address = Console.ReadLine();

                Console.Write("Enter your Password: "******"Confirm your Password:  "******"1");
            }
            else if (subOption.Equals("2"))
            {
                if (AccountHolderService.isAcountHolderLoggedIn)
                {
                    ShowLoggedInAccountHolderMenu();
                    string miniOption = Console.ReadLine();

                    if (miniOption.Equals("0"))
                    {
                        accountHolderService.Logoutaccountholder();
                        HandleSubMenu("1");
                    }
                    else
                    {
                        HandleLoggedInAccountHolderMenu(miniOption);
                    }
                }
                else
                {
                    Console.Clear();
                    Console.WriteLine("    Account Holder Login");
                    Console.Write("enter your email: ");
                    string email = Console.ReadLine();
                    Console.Write("enter your password: "******"2");
                    }
                }
            }
            else
            {
                HandleSubMenu("1");
            }
        }