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(int id) { var result = RiderRepo.GetByID(id); return(View(result.Data ?? new Riders() { Users = new Users(), DOB = DateTime.Now })); }
public ActionResult Delete(int id) { var result = RiderRepo.Delete(id); if (result.HasError) { TempData["Error"] = result.Message; } return(RedirectToAction("List")); }
public ActionResult List(string key = "") { var result = RiderRepo.GetAll(key); if (TempData["Error"] != null) { ViewBag.Error = TempData["Error"]; } return(View(result)); }
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")); }