public ActionResult Registration(RegistrationModel model) { if (!ModelState.IsValid) { return(View(model)); } var riders = new Riders() { DOB = model.DOB, Users = new Users() { Name = model.Name, Email = model.Email, Password = model.Password, Mobile = model.Mobile, User_TypeID = (int)EnumCollection.UserTypeEnum.Rider, } }; var result = RiderRepo.Save(riders); if (result.HasError) { ViewBag.Error = result.Message; return(View(model)); } else { return(RedirectToAction("Login", "Account")); } }
public ActionResult Profile(Riders riders) { if (!ModelState.IsValid) { return(View(riders)); } var result = RiderRepo.Save(riders); if (result.HasError) { ViewBag.Error = result.Message; return(View(riders)); } return(RedirectToAction("Index")); }