Beispiel #1
0
 public ActionResult SubmitForm(Sys_ModuleModel moduleEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         moduleEntity.F_Id = keyValue;
         var LoginInfo = OperatorProvider.Provider.GetCurrent();
         if (LoginInfo != null)
         {
             moduleEntity.F_LastModifyUserId = LoginInfo.UserId;
         }
         moduleEntity.F_LastModifyTime = DateTime.Now;
         mbll.Update(moduleEntity);
     }
     else
     {
         moduleEntity.F_Id = Common.GuId();
         var LoginInfo = OperatorProvider.Provider.GetCurrent();
         if (LoginInfo != null)
         {
             moduleEntity.F_CreatorUserId = LoginInfo.UserId;
         }
         moduleEntity.F_CreatorTime = DateTime.Now;
         mbll.Add(moduleEntity);
     }
     return(Success("操作成功。"));
 }
        public List <Sys_ModuleModel> GetMenuList(string roleId)
        {
            Sys_ModuleBLL        mbll  = new Sys_ModuleBLL();
            Sys_RoleAuthorizeBLL rhbll = new Sys_RoleAuthorizeBLL();
            var data = new List <Sys_ModuleModel>();

            if (OperatorProvider.Provider.GetCurrent().IsSystem)
            {
                data = mbll.GetModelList("");
            }
            else
            {
                var moduledata    = mbll.GetModelList("");
                var authorizedata = rhbll.GetModelList("F_ObjectId = '" + roleId + "'  and F_ItemType = 1");

                foreach (var item in authorizedata)
                {
                    Sys_ModuleModel moduleEntity = mbll.GetModel(item.F_ItemId);
                    if (moduleEntity != null)
                    {
                        data.Add(moduleEntity);
                    }
                }
            }
            return(data.OrderBy(t => t.F_SortCode).ToList());
        }