public ActionResult SaveUser(RegistrationAndLogin registrationAndLogin, string day, string month, string year) { var dateOfBirth = new DateTime(Convert.ToInt32(year), Convert.ToInt32(month), Convert.ToInt32(day)); registrationAndLogin.Registration.DateOfBirth = dateOfBirth; int rowsAffected = 0; try { rowsAffected = _registrationManager.SaveUser(registrationAndLogin.Registration); if (rowsAffected > 0) { ViewBag.Message = "Saved successfully"; } else { ViewBag.Message = "Save failed"; } } catch (Exception exception) { ViewBag.Message = exception.Message; } ViewBag.Days = DaysDropDown(); ViewBag.Months = MonthDropDown(); ViewBag.Years = YearList(); return(View()); }