public void AutoUpdateOrder(int appID, int parentID) { SystemApplicationEntity applicationEntity = this.DataObjectsContainerIocID.SystemApplicationDataObjectInstance.Load(appID); List <SystemMenuEntity> menus; if (parentID == 0) { menus = this.SelfDataObj.GetMenuByParentIDAndApp(null, applicationEntity); } else { SystemMenuEntity topMenu = this.DataObjectsContainerIocID.SystemMenuDataObjectInstance.Load(parentID); menus = this.SelfDataObj.GetMenuByParentIDAndApp(topMenu, applicationEntity); } int i = 1; foreach (SystemMenuEntity menu in menus) { menu.MenuOrder = i; this.SelfDataObj.Update(menu); i++; } }
public SystemMenuEntity GetNewMaxMenuByParentMenuAndApplication(SystemMenuEntity menuWrapper, SystemApplicationEntity applicationWrapper) { if (menuWrapper == null) { return(this.SelfDataObj.GetNewMaxMenuByParentMenuAndApplication(null, applicationWrapper)); } return(this.SelfDataObj.GetNewMaxMenuByParentMenuAndApplication(menuWrapper, applicationWrapper)); }
public SystemRoleMenuRelationEntity GetRelationByUserAndMenu(SystemRoleEntity roleEntity, SystemMenuEntity menuEntity) { NHibernateDynamicQueryGenerator<SystemRoleMenuRelationEntity> queryGenerator = this.GetNewQueryBuilder(); queryGenerator.AddWhereClause(PROPERTY_ROLEID.Eq(roleEntity)); queryGenerator.AddWhereClause(PROPERTY_MENUID.Eq(menuEntity)); return this.FindSingleEntityByQueryBuilder(queryGenerator); }
public void InstallSystem(SortedList <string, string> installParams) { SystemSettingEntity systemSetting = GetCurrentSystemSetting(); systemSetting.SystemName = installParams["sysName"].ToString(); systemSetting.SystemDescription = installParams["sysDescription"].ToString(); systemSetting.SystemVersion = installParams["sysVersion"].ToString(); systemSetting.SystemLisence = installParams["sysCopyRight"].ToString(); this.DataObjectsContainerIocID.SystemSettingDataObjectInstance.Update(systemSetting); List <SystemApplicationEntity> applicationEntitys = this.DataObjectsContainerIocID.SystemApplicationDataObjectInstance.FindedApplicationsByName( "Base System Module"); SystemApplicationEntity app = null; if (applicationEntitys != null && applicationEntitys.Count > 0) { app = applicationEntitys[0]; } else { app = new SystemApplicationEntity(); app.SystemApplicationName = "Base System Module"; app.SystemApplicationIsSystemApplication = true; app.SystemApplicationDescription = "Base System Module"; app.SystemApplicationUrl = "#"; this.DataObjectsContainerIocID.SystemApplicationDataObjectInstance.Save(app); } //Delete all system menu SystemMenuEntity mainMenu = AddSystemMainMenu(app, "系统高级设置", 1); AddSubMenu(app, "系统菜单管理", "~/Moudles/SystemManage/MenuManage/SystemMenuListPage.aspx", "", mainMenu, 1); AddSubMenu(app, "系统应用管理", "~/Moudles/SystemManage/ApplicationManage/SystemApplicationListPage.aspx", "", mainMenu, 2); AddSubMenu(app, "系统角色管理", "~/Moudles/SystemManage/RoleManage/SystemRoleListPage.aspx", "", mainMenu, 3); AddSubMenu(app, "系统用户管理", "~/Moudles/SystemManage/UserManage/SystemUserListPage.aspx", "", mainMenu, 4); AddSubMenu(app, "系统用户组管理", "~/Moudles/SystemManage/UserGroupManage/SystemUserGroupListPage.aspx", "", mainMenu, 5); AddSubMenu(app, "系统配置管理", "~/Moudles/SystemManage/ConfigManage/SystemConfigListPage.aspx", "", mainMenu, 6); AddSubMenu(app, "系统字典管理", "~/Moudles/SystemManage/DictionaryManage/SystemDictionaryListPage.aspx", "", mainMenu, 7); AddSubMenu(app, "系统部门管理", "~/Moudles/SystemManage/DepartmentManage/SystemDepartmentListPage.aspx", "", mainMenu, 8); AddSubMenu(app, "系统日志管理", "~/Moudles/SystemManage/LogManage/SystemLogListPage.aspx", "", mainMenu, 9); AddSubMenu(app, "系统模块管理", "~/Moudles/SystemManage/MoudleManage/SystemMoudleListPage.aspx", "", mainMenu, 10); AddSubMenu(app, "系统权限管理", "~/Moudles/SystemManage/PermissionManage/SystemPrivilegeListPage.aspx", "", mainMenu, 11); AddSubMenu(app, "系统名称设置", "~/Moudles/SystemManage/SettingManage/SystemSettingEditor.aspx", "", mainMenu, 12); AddSubMenu(app, "邮件服务器设置", "~/Moudles/SystemManage/EmailSettingManage/SystemEmailSettingsListPage.aspx", "", mainMenu, 13); }
public void UpdateOrder(List <int> ids) { int i = 1; foreach (int id in ids) { SystemMenuEntity systemMenuEntity = this.SelfDataObj.Load(id); systemMenuEntity.MenuOrder = i; this.SelfDataObj.Update(systemMenuEntity); i++; } }
internal static SystemMenuWrapper ConvertEntityToWrapper(SystemMenuEntity entity) { if (entity == null) { return(null); } if (entity.MenuID == 0) { return(null); } return(new SystemMenuWrapper(entity)); }
public List <SystemMenuEntity> GetMenuByParentID(SystemMenuEntity menuEntity) { NHibernateDynamicQueryGenerator <SystemMenuEntity> dynamicQueryGenerator = this.GetNewQueryBuilder(); //指定查询条件 if (menuEntity != null) { dynamicQueryGenerator.AddWhereClause(SystemMenuDataObject.PROPERTY_PARENTMENUID.Eq(menuEntity)); } else { dynamicQueryGenerator.AddWhereClause(SystemMenuDataObject.PROPERTY_PARENTMENUID.IsNull()); } //指定排序规则 dynamicQueryGenerator.AddOrderBy(SystemMenuDataObject.PROPERTY_MENUORDER.Asc()); return(this.FindListByQueryBuilder(dynamicQueryGenerator)); }
private void AddSubMenu(SystemApplicationEntity app, string menuName, string menuurl, string iconurl, SystemMenuEntity mainMenu, int menuorder) { SystemMenuEntity subMenu = new SystemMenuEntity(); subMenu.ApplicationID = app; subMenu.MenuName = menuName; subMenu.MenuDescription = menuName; subMenu.MenuUrl = menuurl; subMenu.MenuUrlTarget = "1"; subMenu.MenuIconUrl = iconurl; subMenu.MenuType = "1"; subMenu.MenuIsSystemMenu = true; subMenu.MenuIsEnable = true; subMenu.ParentMenuID = mainMenu; subMenu.MenuOrder = menuorder; mainMenu.MenuIsCategory = false; this.DataObjectsContainerIocID.SystemMenuDataObjectInstance.Save(subMenu); }
public SystemMenuEntity GetNewMaxMenuByParentMenuAndApplication(SystemMenuEntity entity, SystemApplicationEntity applicationEntity) { NHibernateDynamicQueryGenerator <SystemMenuEntity> dynamicQueryGenerator = this.GetNewQueryBuilder(); //指定查询条件 dynamicQueryGenerator.AddWhereClause(SystemMenuDataObject.PROPERTY_APPLICATIONID.Eq(applicationEntity)); if (entity != null) { dynamicQueryGenerator.AddWhereClause(SystemMenuDataObject.PROPERTY_PARENTMENUID.Eq(entity)); } else { dynamicQueryGenerator.AddWhereClause(SystemMenuDataObject.PROPERTY_PARENTMENUID.IsNull()); } //指定排序规则 dynamicQueryGenerator.AddOrderBy(SystemMenuDataObject.PROPERTY_MENUORDER.Desc()); return(this.FindSingleEntityByQueryBuilder(dynamicQueryGenerator)); }
public List <SystemMenuEntity> GetMenuByParentIDAndApp(SystemMenuEntity pMenu, SystemApplicationEntity applicationEntity) { NHibernateDynamicQueryGenerator <SystemMenuEntity> dynamicQueryGenerator = this.GetNewQueryBuilder(); //指定查询条件 dynamicQueryGenerator.AddWhereClause(SystemMenuDataObject.PROPERTY_APPLICATIONID.Eq(applicationEntity)); if (pMenu == null) { dynamicQueryGenerator.AddWhereClause(SystemMenuDataObject.PROPERTY_PARENTMENUID.IsNull()); } else { dynamicQueryGenerator.AddWhereClause(SystemMenuDataObject.PROPERTY_PARENTMENUID.Eq(pMenu)); } //指定排序规则 dynamicQueryGenerator.AddOrderBy(SystemMenuDataObject.PROPERTY_MENUORDER.Asc()); dynamicQueryGenerator.AddOrderBy(SystemMenuDataObject.PROPERTY_MENUID.Desc()); return(this.FindListByQueryBuilder(dynamicQueryGenerator)); }
private SystemMenuEntity AddSystemMainMenu(SystemApplicationEntity app, string menuName, int menuorder) { SystemMenuEntity mainMenu = new SystemMenuEntity(); mainMenu.ApplicationID = app; mainMenu.MenuName = menuName; mainMenu.MenuDescription = menuName; mainMenu.MenuUrl = ""; mainMenu.MenuUrlTarget = ""; mainMenu.MenuIconUrl = ""; mainMenu.MenuType = "1"; mainMenu.MenuIsSystemMenu = true; mainMenu.MenuIsEnable = true; mainMenu.ParentMenuID = null; mainMenu.MenuOrder = menuorder; mainMenu.MenuIsCategory = true; this.DataObjectsContainerIocID.SystemMenuDataObjectInstance.Save(mainMenu); return(mainMenu); }
public List <SystemRoleMenuRelationEntity> FindAllByMenuID(SystemMenuEntity _menuID) { return(this.SelfDataObj.GetList_By_MenuID_SystemMenuEntity(_menuID)); }
public List <SystemRoleMenuRelationEntity> FindAllByOrderByAndFilterAndMenuID(string orderByColumnName, bool isDesc, SystemMenuEntity _menuID, PageQueryParams pageQueryParams) { return(this.SelfDataObj.GetPageList_By_MenuID_SystemMenuEntity(orderByColumnName, isDesc, _menuID, pageQueryParams)); }
public SystemRoleMenuRelationEntity GetRelationByUserAndMenu(SystemRoleEntity roleEntity, SystemMenuEntity menuEntity) { NHibernateDynamicQueryGenerator <SystemRoleMenuRelationEntity> queryGenerator = this.GetNewQueryBuilder(); queryGenerator.AddWhereClause(PROPERTY_ROLEID.Eq(roleEntity)); queryGenerator.AddWhereClause(PROPERTY_MENUID.Eq(menuEntity)); return(this.FindSingleEntityByQueryBuilder(queryGenerator)); }
public List <SystemRoleMenuRelationEntity> GetPageList_By_MenuID_SystemMenuEntity(string orderByColumnName, bool isDesc, SystemMenuEntity fkentity, PageQueryParams pageQueryParams) { NHibernateDynamicQueryGenerator <SystemRoleMenuRelationEntity> dynamicQueryGenerator = this.GetNewQueryBuilder(); dynamicQueryGenerator.AddWhereClause(PROPERTY_MENUID.Eq(fkentity)); AddDefaultOrderByToQueryGenerator(orderByColumnName, isDesc, dynamicQueryGenerator); return(FindListByPageByQueryBuilder(dynamicQueryGenerator, pageQueryParams)); }
public List <SystemRoleMenuRelationEntity> GetList_By_MenuID_SystemMenuEntity(SystemMenuEntity fkentity) { NHibernateDynamicQueryGenerator <SystemRoleMenuRelationEntity> dynamicQueryGenerator = this.GetNewQueryBuilder(); dynamicQueryGenerator.AddWhereClause(PROPERTY_MENUID.Eq(fkentity)); return(this.FindListByQueryBuilder(dynamicQueryGenerator)); }
internal SystemMenuWrapper(SystemMenuEntity entityObj) { entity = entityObj; }
internal SystemMenuWrapper(SystemMenuEntity entityObj) : base(entityObj) { }