/// <summary> /// - First step - New User first entering. /// </summary> /// <param name="evaluation">Flag for evaluation if user get wrong DateOfBirth</param> /// <returns>Show DateBirth form</returns> public ActionResult ShowDateBirth() { var model = new User_DateOfBirthModel(); model.Day = 1; model.Month = 1; model.Year = 2000; return(View(model)); }
/// <summary> /// Chaeck date of birth /// </summary> /// <param name="firstTimeUserId">user id for first time sign in</param> /// <param name="model">Info model</param> /// <returns></returns> public bool CheckUserDateOfBirth(string firstTimeUserId, User_DateOfBirthModel model) { DateTime userBirthDateFormated = new DateTime(model.Year, model.Month, model.Day); bool result = _dataContext.Connection.Query <bool>("CheckDateOfBirthByID", new { userId = firstTimeUserId, dateOfBirth = userBirthDateFormated }, commandType: CommandType.StoredProcedure).FirstOrDefault(); return(result); }
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)); }
/// <summary> /// Check user date of birth /// </summary> /// <param name="userId"></param> /// <param name="model"></param> /// <returns></returns> public bool CheckUserDateOfBirth(string userId, User_DateOfBirthModel model) { return(_reporsitory.CheckUserDateOfBirth(userId, model)); }