public ActionResult Add(SPVFakturisViewModel model) { AlertMessage alert = new AlertMessage(); SPVFakturisBusiness business = new SPVFakturisBusiness(); if (!ModelState.IsValid) { alert.Text = string.Join(System.Environment.NewLine, ModelState.Values .SelectMany(v => v.Errors) .Select(e => e.ErrorMessage)); } else { business.SetUserAuth(ViewBag.UserAuth); alert = business.Add(model); } TempData["AlertMessage"] = alert; if (alert.Status == 1) { return(RedirectToAction("Index")); } return(View("Edit", model)); }
public ActionResult Index() { SPVFakturisBusiness business = new SPVFakturisBusiness(); business.SetUserAuth(ViewBag.UserAuth); ViewBag.IsEditable = business.IsEditable(); return(View()); }
public ActionResult Datatable(JDatatableViewModel model) { if (!Request.IsAjaxRequest()) { return(RedirectToAction("Index")); } JDatatableResponse resp = new JDatatableResponse(); SPVFakturisBusiness business = new SPVFakturisBusiness(); business.SetUserAuth(ViewBag.UserAuth); resp = business.GetDatatableByQuery(model); return(new MyJsonResult(resp, JsonRequestBehavior.AllowGet)); }