Ejemplo n.º 1
0
        // GET: SystemMaint/Role/Details/5
        public ActionResult GetDetail(int id)
        {
            BL.RoleInfo empBL = new BL.RoleInfo();
            if (empBL.GetItemByIdForDelete(id) != null)
            {
                return(Redirect(Url.Action("HttpError", "Error", new { area = "" })));
            }
            var model = empBL.GetItemById(id);

            return(PartialView("_Detail", model));
        }
Ejemplo n.º 2
0
        public ActionResult Delete(int id)
        {
            // TODO: Add delete logic here

            BL.RoleInfo empBL = new BL.RoleInfo();
            if (empBL.GetItemByIdForDelete(id) != null)
            {
                return(Redirect(Url.Action("HttpError", "Error", new { area = "" })));
            }
            if (empBL.ValidateDelete(id))
            {
                //return Content("失败");
                return(Json("exist", JsonRequestBehavior.AllowGet));
            }
            else
            {
                var model = empBL.Delete(id, UserHelper.GetCurrentUser().LogonName);
                //CacheDependencyHelper.Change(new string[] { BasicParam.RolePermissionCacheKey });
                //return Content("success");
                return(Json(model, JsonRequestBehavior.AllowGet));
            }
        }