public virtual ActionResult Submit(StyleLiteCountingViewModel model) { LogI("Submit, model=" + model); //Save if (ModelState.IsValid) { model.UpdateStyleItems(Db, Time.GetAppNowTime(), AccessManager.UserName); var result = StyleLiteCountingViewModel.GetAll(Db, new StyleSearchFilterViewModel() { StyleId = model.Id }).FirstOrDefault(); return(Json(new UpdateRowViewModel(result, "Styles", new[] { "StyleItems", }, false))); } ViewBag.IsAdd = false; return(PartialView(PopupContentView, model)); }
public virtual ActionResult GetAll(GridRequest request) { LogI("GetAll"); var searchFilter = new StyleSearchFilterViewModel(); var items = StyleLiteCountingViewModel.GetAll(Db, searchFilter).ToList(); var data = new GridResponse <StyleLiteCountingViewModel>(items, items.Count, Time.GetAppNowTime()); return(Json(data, JsonRequestBehavior.AllowGet)); }
public virtual ActionResult DeleteBox(int id) { LogI("DeleteBox, id=" + id); var record = Db.OpenBoxCountings.Get(id); Db.OpenBoxCountings.Remove(record); Db.Commit(); var result = StyleLiteCountingViewModel.GetAll(Db, new StyleSearchFilterViewModel() { StyleId = record.StyleId }).FirstOrDefault(); return(Json(new UpdateRowViewModel(result, "Styles", new[] { "StyleItems" }, false))); }
public virtual ActionResult SetApproveStatus(long styleId, long styleItemId) { LogI("SetApproveStatus, styleItemId=" + styleItemId); StyleLiteCountingViewModel.SetApproveStatus(Db, styleItemId, (int)ApproveStatuses.Approved, Time.GetAppNowTime(), AccessManager.UserId); var result = StyleLiteCountingViewModel.GetAll(Db, new StyleSearchFilterViewModel() { StyleId = styleId }).FirstOrDefault(); return(Json(new UpdateRowViewModel(result, "Styles", new[] { "StyleItems" }, false))); }