/// <summary> /// 根据 DllPath, MenuId 返回控件 /// </summary> /// <param name="dllRelativePath"></param> /// <param name="entryFunction"></param> /// <param name="menuId">唯一标识</param> /// <returns></returns> private Control GetControl(string dllRelativePath, string entryFunction, string menuId) { var dllPath = $"{Config.DevPlatformPath}{dllRelativePath}"; if (System.IO.File.Exists(dllPath)) { var ass = Assembly.LoadFile(dllPath); var instance = ass.CreateInstance(entryFunction); var loginModel = new ClsLoginModel { UserId = ClsLoginModel.UserId, LoginName = ClsLoginModel.LoginName, LoginTime = ClsLoginModel.LoginTime, RoleId = ClsLoginModel.RoleId, ConnectionString = ClsLoginModel.ConnectionString, DataSource = ClsLoginModel.DataSource, Database = ClsLoginModel.Database, PermissionsFunc = ClsLoginModel.PermissionsFunc }; var control = ((INetUserControl)instance)?.CreateControl(this, loginModel, menuId); if (control != null) { return(control); } } else { this.ShowMessageAsync($"文件路径“{dllPath}”不存在,打开窗口失败!", ""); } return(null); }
public DeptManager(MetroWindow metroWindow, ClsLoginModel clsLoginModel, string menuId) { InitializeComponent(); _metroWindow = metroWindow; _clsLoginModel = clsLoginModel; _menuId = menuId; InitTvDept(); }
public CompanyEdit(ClsLoginModel loginModel, string menuId) { InitializeComponent(); _clsLoginModel = loginModel; _menuId = menuId; DataContext = this; InitCompanyInfo(); }
public OperatorManager(MetroWindow metroWindow, ClsLoginModel clsLogin, string menuId) { InitializeComponent(); _metroWindow = metroWindow; _clsLoginModel = clsLogin; _menuId = menuId; DataContext = this; Init(); }
public LoginLogManager(MetroWindow metroWindow, ClsLoginModel clsLoginModel, string menuId) { InitializeComponent(); _metroWindow = metroWindow; _clsLoginModel = clsLoginModel; _menuId = menuId; DataContext = this; InitLog(); }
public UserManager(MetroWindow metroWindow, ClsLoginModel clsLoginModel, string menuId) { InitializeComponent(); _metroWindow = metroWindow; _clsLoginModel = clsLoginModel; _menuId = menuId; DataContext = this; StaffAll = _staffManage.All(); }
public BannerManager(MetroWindow metroWindow, ClsLoginModel clsLoginModel, string menuId) { InitializeComponent(); _metroWindow = metroWindow; _clsLoginModel = clsLoginModel; _menuId = menuId; DataContext = _bannerManagerViewModel; InitData(); }
public LeftMenuManager(MetroWindow metroWindow, ClsLoginModel clsLoginModel, string menuId) { InitializeComponent(); _metroWindow = metroWindow; _clsLoginModel = clsLoginModel; _currentMenuId = menuId; DataContext = this; InitLeftMenu(); InitViewModel(); }
public NavBarGroupManager(MetroWindow metroWindow, ClsLoginModel clsLoginModel, string menuId) { InitializeComponent(); _metroWindow = metroWindow; _clsLoginModel = clsLoginModel; _menuId = menuId; DataContext = this; InitLeftMenu(); ShowDockPanelNew(); }
public RolesManager(MetroWindow metroWindow, ClsLoginModel clsLogin, string menuId) { InitializeComponent(); _metroWindow = metroWindow; _clsLoginModel = clsLogin; _menuId = menuId; DataContext = _rolesManagerViewModel; InitDgLeftMenuPermissionsColumns(); InitDgRoles(); InitDgPermissions(); }
public Control CreateControl(MetroWindow metroWindow, ClsLoginModel clsLogin, string menuId) { switch (menuId) { case "退出": metroWindow.Close(); return(null); case "Bug 反馈": Process.Start("http://www.devapplication.com"); return(null); case "关于我们": return(new About { Owner = metroWindow }); default: return(null); } }
public ModifyPassword(ClsLoginModel loginModel) { InitializeComponent(); DataContext = this; _loginModel = loginModel; }
public Control CreateControl(MetroWindow metroWindow, ClsLoginModel clsLogin, string menuId) { var control = new Control(); switch (menuId) { case "顶部菜单管理": control = new TopMenuManager(metroWindow, clsLogin, menuId); break; case "左侧菜单管理": control = new LeftMenuManager(metroWindow, clsLogin, menuId); break; case "功能组管理": control = new NavBarGroupManager(metroWindow, clsLogin, menuId); break; case "登陆主题设置": control = new LoginThemeManager(); break; case "权限管理": control = new RolesManager(metroWindow, clsLogin, menuId); break; case "用户管理": control = new UserManager(metroWindow, clsLogin, menuId); break; case "部门管理": control = new DeptManager(metroWindow, clsLogin, menuId); break; case "登陆日志管理": control = new LoginLogManager(metroWindow, clsLogin, menuId); break; case "操作员管理": control = new OperatorManager(metroWindow, clsLogin, menuId); break; case "公司信息设置": control = new CompanyEdit(clsLogin, menuId) { Owner = metroWindow }; break; case "修改密码": control = new ModifyPassword(clsLogin) { Owner = metroWindow }; break; case "系统初始化": control = new SystemInit(clsLogin) { Owner = metroWindow }; break; case "Banner 设置": control = new BannerManager(metroWindow, clsLogin, menuId); break; case "Banner 默认": control = new BannerDefault(metroWindow); break; } return(control); }
public SystemInit(ClsLoginModel clsLogin) { InitializeComponent(); _clsLogin = clsLogin; }