Beispiel #1
0
        public JsonResult InsertNode(string json)
        {
            string     strError = "";
            T_MenuInfo model    = JsonConvert.DeserializeObject <T_MenuInfo>(json);

            model = SetModelDefaultValue(model);
            bool isSuccess = funcmenu.SaveModelToDB(currentUser, ref model, ref strError);

            return(Json(new { state = isSuccess, obj = strError }, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public JsonResult GetModelByID(int ID)
        {
            string     strError = "";
            T_MenuInfo model    = new T_MenuInfo();

            model.ID = ID;
            bool isSuccess = funcmenu.GetModelByID(ref model, ref strError);

            return(Json(new { state = isSuccess, obj = model }, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        //点击组权限,初始化菜单
        public JsonResult InitMenu(int UserGroupID)
        {
            string            strError  = "";
            T_MenuInfo        model     = new T_MenuInfo();
            List <T_MenuInfo> modelList = new List <T_MenuInfo>();
            bool            isSuccess   = funcmenu.GetMenuListByUserGroupID(ref modelList, ref strError, UserGroupID);
            List <Allnodes> allnodes    = GetTree(modelList);

            return(Json(new { state = isSuccess, obj = allnodes }, JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
        //点击按钮 改变权限
        public JsonResult saveMenu(int UserGroupID, int MenuId, bool isTrue)
        {
            string     strError = "";
            T_MenuInfo model    = new T_MenuInfo();

            model.ID        = MenuId;
            model.IsChecked = isTrue;

            bool isSuccess = funcmenu.SaveUserGroupMenuToDB(currentUser, model, UserGroupID, ref strError);

            return(Json(new { state = isSuccess, obj = strError }, JsonRequestBehavior.AllowGet));
        }
Beispiel #5
0
        public T_MenuInfo SetModelDefaultValue(T_MenuInfo model)
        {
            model.MenuType   = 1;
            model.MenuStatus = 1;
            model.IsDel      = 1;
            model.SafeLevel  = 1;
            string     strError  = string.Empty;
            Tree_Model treeModel = model as Tree_Model;
            Tree_Func  treefunc  = new Tree_Func();

            if (treefunc.GetTreeNo(ref treeModel, ref strError))
            {
                treeModel.MenuNo = treeModel.TreeNo;
                model            = treeModel as T_MenuInfo;
            }
            return(model);
        }
Beispiel #6
0
        public JsonResult SaveNode(string json)
        {
            T_MenuInfo model    = JsonConvert.DeserializeObject <T_MenuInfo>(json);
            T_MenuInfo oldmodel = new T_MenuInfo();

            oldmodel.ID = model.ID;
            string strError = "";

            funcmenu.GetModelByID(ref oldmodel, ref strError);
            oldmodel.MenuNo      = model.MenuNo;
            oldmodel.MenuName    = model.MenuName;
            oldmodel.MemuAbbName = model.MemuAbbName;
            oldmodel.ProjectName = model.ProjectName;
            oldmodel.ParentName  = model.ParentName;
            oldmodel.Description = model.Description;
            oldmodel.MenuType    = model.MenuType;
            oldmodel.NodeUrl     = model.NodeUrl;
            oldmodel.MenuStatus  = model.MenuStatus;
            bool isSuccess = funcmenu.SaveModelToDB(currentUser, ref oldmodel, ref strError);

            return(Json(new { state = isSuccess, obj = strError }, JsonRequestBehavior.AllowGet));
        }
Beispiel #7
0
        public bool SaveT_UserGroupMenu(UserInfo user, T_MenuInfo t_Menu, int UserGroupID, ref string strError)
        {
            T_MENU_Func tfunc = new T_MENU_Func();

            return(tfunc.SaveUserGroupMenuToDB(user, t_Menu, UserGroupID, ref strError));
        }
Beispiel #8
0
        public bool UpdateT_MenuStatus(UserInfo user, ref T_MenuInfo t_menu, int NewStatus, ref string strError)
        {
            T_MENU_Func tfunc = new T_MENU_Func();

            return(tfunc.UpdateModelStatus(user, ref t_menu, NewStatus, ref strError));
        }
Beispiel #9
0
        public bool GetT_MenuListByPage(ref List <T_MenuInfo> modelList, UserInfo user, T_MenuInfo t_menu, ref DividPage page, ref string strError)
        {
            T_MENU_Func tfunc = new T_MENU_Func();

            return(tfunc.GetModelListByPage(ref modelList, user, t_menu, ref page, ref strError));
        }
Beispiel #10
0
        public bool GetT_MenuByID(ref T_MenuInfo model, ref string strError)
        {
            T_MENU_Func tfunc = new T_MENU_Func();

            return(tfunc.GetModelByID(ref model, ref strError));
        }
Beispiel #11
0
        public bool DeleteT_MenuByModel(UserInfo user, T_MenuInfo model, ref string strError)
        {
            T_MENU_Func tfunc = new T_MENU_Func();

            return(tfunc.DeleteModelByModel(user, model, ref strError));
        }
Beispiel #12
0
        public bool SaveT_Menu(UserInfo user, ref T_MenuInfo t_menu, ref string strError)
        {
            T_MENU_Func tfunc = new T_MENU_Func();

            return(tfunc.SaveModelToDB(user, ref t_menu, ref strError));
        }