コード例 #1
0
        public IActionResult SignUp(SignUpFirstPageViewModel model)
        {
            ControlsController controlsController = new ControlsController();

            this.ViewBag.AllMonths = controlsController.GetAllMonths();
            if (!this.ModelState.IsValid)
            {
                return(this.View());
            }

            if (signUpService.VerifyUser(model.FirstName, model.LastName, model.Day, model.Month, model.Year, model.Gender))
            {
                return(this.View("SignUpAlreadyExists", model));
            }
            else
            {
                return(this.View("SignUpCredentials", new SignUpSecondPageViewModel
                {
                    FirstName = model.FirstName,
                    LastName = model.LastName,
                    Month = model.Month,
                    Day = model.Day,
                    Year = model.Year,
                    Gender = model.Gender
                }));
            }
        }
コード例 #2
0
        public IActionResult SignUp()
        {
            ControlsController controlsController = new ControlsController();


            this.ViewBag.AllMonths = controlsController.GetAllMonths();

            SignUpFirstPageViewModel model = new SignUpFirstPageViewModel();

            return(View());
        }
コード例 #3
0
        public IActionResult SignUpCredentials(SignUpSecondPageViewModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(model));
            }
            ControlsController controlsController = new ControlsController();

            this.ViewBag.AllMonths = controlsController.GetAllMonths();
            signUpService.AddUser(model.FirstName, model.LastName, model.Day, model.Month, model.Year, model.Gender, model.Email, model.Password);

            return(this.View("SignUpResult", model));
        }
コード例 #4
0
        public IActionResult SignUpAlreadyExists(SignUpFirstPageViewModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View());
            }
            ControlsController controlsController = new ControlsController();

            this.ViewBag.AllMonths = controlsController.GetAllMonths();



            return(this.View("SignUpCredentials", new SignUpSecondPageViewModel
            {
                FirstName = model.FirstName,
                LastName = model.LastName,
                Day = model.Day,
                Month = model.Month,
                Year = model.Year,
                Gender = model.Gender,
                IsEverExisted = true
            }));
        }