public ActionResult savePageCategory(string CategoryID, string listdata) { if (!asset.Create) { return(Json(new { success = false, message = "Bạn không có quyền tạo" })); } CRM_Page.SaveMapping(CategoryID, listdata); return(Json(new { success = true })); }
// =============================================================================================== public ActionResult ReadPage(string CategoryID) { if (!User.Identity.IsAuthenticated) { return(Json(new { success = false, message = "Bạn chưa đăng nhập" })); } var data = CRM_Page.ReadPageOfCategory(CategoryID); return(Json(new { success = true, data = data })); }
public ActionResult Read([DataSourceRequest] DataSourceRequest request) { if (asset.View) { using (IDbConnection dbConn = OrmliteConnection.openConn()) { var data = CRM_Page.ReadAll(); return(Json(data.ToDataSourceResult(request))); } } else { return(RedirectToAction("NoAccessRights", "Error")); } }
public ActionResult DeletePage(string data) { if (asset.Delete) { using (var dbConn = Helpers.OrmliteConnection.openConn()) { string[] separators = { "@@" }; var ids = data.Split(separators, StringSplitOptions.RemoveEmptyEntries); //var ids = listid.Split(','); foreach (var id in ids) { CRM_Page.Delete(id); } return(Json(new { success = true, message = "Thành công" })); } } return(Json(new { success = false, message = "Bạn " })); }