Exemplo n.º 1
0
        /// <summary>
        /// 保存权限
        /// </summary>
        /// <param name="actionItem"></param>
        /// <returns></returns>
        public JsonResult SaveAction(SYS_Action actionItem)
        {
            if (actionItem == null)
            {
                return(Json(new { result = "error", mesage = "角色数据为空" }));
            }
            string errMsg = "";

            if (actionItem.ID == 0)
            {
                actionItem.CREATETIME = DateTime.Now;
                //add
                actionBLL.AddAction(actionItem, ref errMsg);
            }
            else
            {
                //edit
                actionBLL.EditAction(actionItem, ref errMsg);
            }

            var result = new { result = "ok", message = "操作成功" };

            if (!string.IsNullOrEmpty(errMsg))
            {
                result = new { result = "error", message = errMsg };
            }
            //Common.LogHelper.InsertLog(String.Format("修改权限,ID-{0}", actionItem.ID.ToString()), 51, "权限列表");
            //兼容ie
            return(Json(result, "text/html", JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
 public ActionResult AddActionInfo(ActionAddModel model)
 {
     if (ModelState.IsValid)
     {
         var result = ActionBLL.AddAction(model, base.UserIDForLog);
         base.DoLog(Model.OperationTypeEnum.Add, result, "ActionName:" + model.ActionName);
         return(Json(result));
     }
     else
     {
         int areaID = model.AreaID;
         var aList  = AreaBLL.GetAreas();
         model.AreasSelectList = new SelectList(aList, "ID", "AreaName", areaID);
         var cList = ControllerBLL.GetControllersByAreaID(areaID);
         model.ControllersSelectList = new SelectList(cList, "ID", "ControllerName", model.ControllerID);
         return(PartialView("_AddActionInfo", model));
     }
 }