public JsonResult Delete(OrderModel model) { if (ModelState.IsValid) return Json(_service.Delete(model)); return Json(null); }
public ActionResult Edit(OrderModel model) { if (model.Id == 0) ModelState.Remove("Id"); if (ModelState.IsValid) return Json(model.Id == default(int) ? _service.Add(model) : _service.Edit(model)); return PartialView("EditorTemplates/_Edit", model); }