public ActionResult Edit(CustomerLevelModel model, bool continueEditing) { if (ModelState.IsValid) { var entity = _levelService.GetCustomerLevelById(model.Id); entity = model.MapTo <CustomerLevelModel, CustomerLevel>(entity); _levelService.UpdateLevel(entity); if (continueEditing) { return(RedirectToAction("Edit", new { id = model.Id })); } return(RedirectToAction("Index")); } return(View(model)); }
public ActionResult Create(CustomerLevelModel model, bool continueEditing) { if (ModelState.IsValid) { var entity = model.MapTo <CustomerLevel>(); var levelId = _levelService.InsertLevel(entity); if (continueEditing) { return(RedirectToAction("Edit", new { id = levelId })); } return(RedirectToAction("Index")); } return(View(model)); }