public void SubmitForm(FrameModuleButtonModel moduleButtonEntity, string keyValue, string userId) { if (!string.IsNullOrEmpty(keyValue)) { FrameModuleButtonModel frameModuleButtonModel = frameModuleButtonDAO.GetById(keyValue); frameModuleButtonModel.F_ModuleId = moduleButtonEntity.F_ModuleId; frameModuleButtonModel.F_ParentId = moduleButtonEntity.F_ParentId; frameModuleButtonModel.F_Layers = moduleButtonEntity.F_Layers; frameModuleButtonModel.F_EnCode = moduleButtonEntity.F_EnCode; frameModuleButtonModel.F_FullName = moduleButtonEntity.F_FullName; frameModuleButtonModel.F_Icon = moduleButtonEntity.F_Icon; frameModuleButtonModel.F_Location = moduleButtonEntity.F_Location; frameModuleButtonModel.F_JsEvent = moduleButtonEntity.F_JsEvent; frameModuleButtonModel.F_UrlAddress = moduleButtonEntity.F_UrlAddress; frameModuleButtonModel.F_Split = moduleButtonEntity.F_Split; frameModuleButtonModel.F_IsPublic = moduleButtonEntity.F_IsPublic; frameModuleButtonModel.F_AllowEdit = moduleButtonEntity.F_AllowEdit; frameModuleButtonModel.F_AllowDelete = moduleButtonEntity.F_AllowDelete; frameModuleButtonModel.F_SortCode = moduleButtonEntity.F_SortCode; frameModuleButtonDAO.Update(frameModuleButtonModel, userId); } else { frameModuleButtonDAO.Create(moduleButtonEntity, userId); } }
public void SubmitCloneButton(string moduleId, string Ids, string userId) { string[] ArrayId = Ids.Split(','); var data = this.GetList(); List <FrameModuleButtonModel> entitys = new List <FrameModuleButtonModel>(); foreach (string item in ArrayId) { FrameModuleButtonModel moduleButtonEntity = data.Find(t => t.F_Id == item); moduleButtonEntity.F_Id = Guid.NewGuid().ToString(); moduleButtonEntity.F_ModuleId = moduleId; entitys.Add(moduleButtonEntity); } frameModuleButtonDAO.Create(entitys, userId); }
public List <FrameModuleButtonModel> GetButtonList(string roleId, bool isSystem) { var data = new List <FrameModuleButtonModel>(); if (isSystem) { data = frameModuleButtonDAO.QueryAll(); } else { var buttondata = frameModuleButtonDAO.QueryAll(); var authorizedata = frameRoleAuthorizeDAO.Query(t => t.F_ObjectId == roleId && t.F_ItemType == 2).ToList(); foreach (var item in authorizedata) { FrameModuleButtonModel moduleButtonEntity = buttondata.Find(t => t.F_Id == item.F_ItemId); if (moduleButtonEntity != null) { data.Add(moduleButtonEntity); } } } return(data.OrderBy(t => t.F_SortCode).ToList()); }