示例#1
0
 public ActionResult Create(ActionInfo model)
 {
     model.Url = "1";
     model.DelFlag = false;
     model.SubTime = DateTime.Now;
     model.ModifiedOnTime = DateTime.Now;
     actionInfoBLL.Create(model);
     return Content("ok");
 }
示例#2
0
 /// <summary>
 ///  将P_DepartmentInfo 对象转成treegrid节点
 /// </summary>
 /// <param name="item">部门实体对象</param>
 /// <param name="isChecked">该节点是否选中</param>
 /// <returns></returns>
 public EasyUITreeGrid_Action ToTreeGridNode(ActionInfo item,bool isChecked=false)
 {
     EasyUITreeGrid_Action node = new EasyUITreeGrid_Action()
     {
         Checked=isChecked,
         selected=isChecked,
          ID = item.ID,
           ActionName=item.ActionInfoName,
         Remark = item.Remark,
         children = new List<EasyUITreeGrid_Action>()
     };
     return node;
 }
示例#3
0
        public EasyUIComboTree_Action ToComboTreeNode(ActionInfo item, bool isChecked = false)
        {
            EasyUIComboTree_Action node;

                node = new EasyUIComboTree_Action()
                {
                    Checked = isChecked,
                    selected = isChecked,
                    id = item.ID,
                    text = item.ActionInfoName,
                    children = new List<EasyUIComboTree_Action>()
                };

            return node;
        }
示例#4
0
        public ActionResult DoAddActionInfo(ActionInfo model)
        {
            if (actionInfoBLL.AddValidation(model.ActionInfoName)) { return Content("validation fails"); }

                    //创建一个新的Action方法,需要对未提交的属性进行初始化赋值
                model.DelFlag = false;
                model.SubTime = DateTime.Now;
                model.ModifiedOnTime = DateTime.Now;
                model.GetUrl();//根据
                model.MenuIcon = "";
                model.IconWidth = 0;
                model.IconHeight = 0;
                try
                {
                    actionInfoBLL.Create(model);
                    return Content("ok");
                }
               catch
                {
                    return Content("error");
                }
        }
示例#5
0
 public ActionResult DoEditActionInfo(ActionInfo model)
 {
     if (actionInfoBLL.EditValidation(model.ID, model.ActionInfoName)) { return Content("validation fails"); }
     var a = actionInfoBLL.GetListBy(p => p.DelFlag == false && p.ID == model.ID).FirstOrDefault();
     model.ModifiedOnTime = DateTime.Now;
         //!!注意以下方法必须执行(根据权限名称、控制器、区域生成ActionInfo对象中的Url属性
         model.GetUrl();
         if (actionInfoBLL.Update(model))
         {
             return Content("ok");
         }
         else
         {
             return Content("error");
         }
 }