예제 #1
0
        public ActionResult ShowDateBirth(User_DateOfBirthModel model)
        {
            try
            {
                var func = new FunctionsController();
                func.StringToDateTimeDDmmYYYY(model.Day, model.Month, model.Year);

                //check dateOfBirth as the password
                if (_userService.CheckUserDateOfBirth(_userService.GetFirstTimeUserId(), model))
                {
                    return(Redirect(Url.ProcessNextStep()));
                }
                ModelState.AddModelError("Day", "Please contact your manager! The date entered does not match the date on the record!");
                ModelState.AddModelError("Month", " ");
                ModelState.AddModelError("Year", " ");
            }
            catch (Exception e)
            {
                ModelState.AddModelError("Day", "Wrong date");
                ModelState.AddModelError("Month", " ");
                ModelState.AddModelError("Year", " ");
            }
            return(View(model));
        }