Exemplo n.º 1
0
        public ActionResult SubmitMenuListForm(string jsonData)
        {
            var userId        = OperatorProvider.Provider.GetCurrent().UserId;
            var arrayJsonData = NFine.Code.Json.ToObject <List <SysModuleToUserEntity> >(jsonData);
            SysModuleToUserApp sysModuleToUserApp = new SysModuleToUserApp();
            var data = sysModuleToUserApp.GetList(userId);

            foreach (SysModuleToUserEntity item in data)
            {
                sysModuleToUserApp.SubmitForm(item);
            }
            if (arrayJsonData.Count > 0)
            {
                for (int i = 0; i < arrayJsonData.Count; i++)
                {
                    SysModuleToUserEntity sysModuleToUserEntity = new SysModuleToUserEntity();
                    sysModuleToUserEntity.F_FullName   = arrayJsonData[i].F_FullName;
                    sysModuleToUserEntity.F_ModuleId   = arrayJsonData[i].F_ModuleId;
                    sysModuleToUserEntity.F_ModuleType = arrayJsonData[i].F_ModuleType;
                    sysModuleToUserEntity.F_UserId     = userId;
                    sysModuleToUserApp.SubmitForm(sysModuleToUserEntity);
                }
                base.OperateLog("添加快捷操作:用户ID:" + userId, "/Home/SubmitMenuListForm", "主页", Application.DbLogType.Create);
            }
            return(Success("操作成功。"));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取快捷操作
        /// </summary>
        /// <returns></returns>
        public ActionResult GetQuickActionsJson()
        {
            var userId = OperatorProvider.Provider.GetCurrent().UserId;
            SysModuleToUserApp sysModuleToUserApp = new SysModuleToUserApp();
            var    data     = sysModuleToUserApp.GetList(userId);
            string jsonData = data.ToJson();

            return(Content(jsonData));
        }