public ActionResult SubmitForm(Sys_ModuleButtonModel moduleButtonEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { moduleButtonEntity.F_Id = keyValue; var LoginInfo = OperatorProvider.Provider.GetCurrent(); if (LoginInfo != null) { moduleButtonEntity.F_LastModifyUserId = LoginInfo.UserId; } moduleButtonEntity.F_LastModifyTime = DateTime.Now; mbbll.Update(moduleButtonEntity); } else { moduleButtonEntity.F_Id = Common.GuId(); var LoginInfo = OperatorProvider.Provider.GetCurrent(); if (LoginInfo != null) { moduleButtonEntity.F_CreatorUserId = LoginInfo.UserId; } moduleButtonEntity.F_CreatorTime = DateTime.Now; mbbll.Add(moduleButtonEntity); } return(Success("操作成功。")); }
public List <Sys_ModuleButtonModel> GetButtonList1(string roleId) { Sys_ModuleButtonBLL mbbll = new Sys_ModuleButtonBLL(); var data = new List <Sys_ModuleButtonModel>(); Sys_RoleAuthorizeBLL rhbll = new Sys_RoleAuthorizeBLL(); if (OperatorProvider.Provider.GetCurrent().IsSystem) { data = mbbll.GetModelList(""); } else { var buttondata = mbbll.GetModelList(""); var authorizedata = rhbll.GetModelList("F_ObjectId = '" + roleId + "' and F_ItemType = 2"); foreach (var item in authorizedata) { Sys_ModuleButtonModel moduleButtonEntity = mbbll.GetModel(item.F_ItemId); if (moduleButtonEntity != null) { data.Add(moduleButtonEntity); } } } return(data.OrderBy(t => t.F_SortCode).ToList()); }