public JsonResult GetUserTypePermission(string id) { var cResult = "Error"; var cMessage = "something wrong!"; var lstPages = new List <Pages>(); if (!string.IsNullOrEmpty(id)) { int oUserTypeId = Convert.ToInt32(id); var oUserTypePages = new UserTypePages(); oUserTypePages.UserTypeId = oUserTypeId; var oPages = new Pages(); var oResult = DAL.Account.UserTypePages.GetUserTypePages(oUserTypePages, oPages); if (oResult.HasResult) { lstPages = oResult.Results; cResult = "OK"; cMessage = "Successfuly"; } } return(Json(new { cResult, cMessage, lstPages }, JsonRequestBehavior.AllowGet)); }
public ActionResult UserPermission() { var oModel = new Models.MainModels.UserPermissionModel(); var oUserType = new UserType(); oUserType.IsList = true; var isNotSuper = User.UserTypeId != 1; var oResult = DAL.Account.UserType.GetUserType(oUserType); if (oResult.HasResult) { oModel.LstUserTypes = oResult.Results; } var oUserTypePages = new UserTypePages(); oUserTypePages.UserTypeId = User.UserTypeId; //var oResulPages = DAL.Account.UserTypePages.IsValidAdminTypePage(oUserTypePages); var page = new Pages(); var oResulPages = DAL.Account.UserTypePages.GetUserTypePages(oUserTypePages, page); if (oResulPages.HasResult) { oModel.LstPages = oResulPages.Results; } return(View(oModel)); }