/// <summary> /// 左侧菜单点击事件 /// </summary> /// <param name="fun">功能记录</param> /// <param name="ucLeftMenu">左侧菜单对象</param> public void MainFormAddLabel(DataRow fun, UCLeftMenu ucLeftMenu) { if (panel_Content.Controls.Find(fun["fun_id"].ToString(), true).Length == 0) { UserControl uc = CommonCtrl.TraverseForm(fun["fun_uri"].ToString()); if (uc == null) { MessageBoxEx.Show(fun["fun_name"].ToString() + " 不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } uc.Name = fun["fun_id"].ToString(); uc.Dock = DockStyle.Fill; uc.Focus(); uc.Tag = fun["fun_id"].ToString() + "|" + ucLeftMenu.Name + "|" + fun["parent_id"].ToString();//三级 |一级| 二级 菜单的id panel_Content.Controls.Add(uc); uc.BringToFront(); Image myImage = null; if (fun["fun_img"] != DBNull.Value && fun["fun_img"].ToString() != "") { myImage = (Image)ServiceStationClient.Skin.Properties.Resources.ResourceManager.GetObject(fun["fun_img"].ToString()); } childmemu(myImage, fun["fun_name"].ToString(), fun["fun_id"].ToString(), fun["parent_id"].ToString(), ucLeftMenu.Name, ""); } else { panel_Content.Controls.Find(fun["fun_id"].ToString(), true)[0].BringToFront(); childMemuState(fun["fun_id"].ToString()); } SYSModel.clsSysConfig.STR_CURR_TWOMEMU = fun["parent_id"].ToString(); }
/// <summary> /// 添加左侧菜单 /// </summary> /// <param name="menuId">一级菜单的Tag 菜单id</param> /// <param name="munuName">菜单名</param> private void AddLeftMenu(string menuId, string munuName) { SYSModel.clsSysConfig.STR_CURR_MAINMEMU = menuId; if (panel_LeftMenu.Controls.Find(menuId, true).Length == 0) { UCMainLayOut.UCLeftMenu UCLeftMenu = new UCMainLayOut.UCLeftMenu(); //系统管理 UCLeftMenu.Name = menuId; //SYSModel.clsSysConfig.STR_CS_MEMU_FUNCTIONMANAGE; // UCLeftMenu.dtFunction = dt; UCLeftMenu.FunID = menuId; //UCLeftMenu.panel_MainHeight = pnlxLeftMenu.Height; UCLeftMenu.Dock = DockStyle.Fill; UCLeftMenu.Tag = munuName; UCLeftMenu.menuName = munuName; UCLeftMenu.FmMain = this; UCLeftMenu.Focus(); panel_LeftMenu.Controls.Add(UCLeftMenu); UCLeftMenu.BringToFront(); } else { UCMainLayOut.UCLeftMenu UCLeftMenu = panel_LeftMenu.Controls.Find(menuId, true)[0] as UCMainLayOut.UCLeftMenu; UCLeftMenu.LeftMenuState(SYSModel.clsSysConfig.STR_CURR_TWOMEMU, SYSModel.clsSysConfig.STR_CURR_MEMU, SYSModel.clsSysConfig.STR_CURR_MEMU); UCLeftMenu.BringToFront(); } }
/// <summary> 加载首页 /// </summary> private void loadHome() { splitContainerEx_Body.SplitterWidth = 6; SYSModel.clsSysConfig.STR_CURR_MAINMEMU = "S_SysMaintenance"; if (panel_LeftMenu.Controls.Find("S_SysMaintenance", true).Length == 0) { UCMainLayOut.UCLeftMenu UCLeftMenu = new UCMainLayOut.UCLeftMenu(); //系统管理 UCLeftMenu.Name = "S_SysMaintenance"; //EntityModel.clsSysConfig.STR_CS_MEMU_FUNCTIONMANAGE; // UCLeftMenu.dtFunction = dt; UCLeftMenu.FunID = "S_SysMaintenance"; //UCLeftMenu.panel_MainHeight = pnlxLeftMenu.Height; UCLeftMenu.Dock = DockStyle.Fill; UCLeftMenu.Tag = "系统管理"; UCLeftMenu.menuName = "系统管理"; UCLeftMenu.FmMain = this; UCLeftMenu.Focus(); panel_LeftMenu.Controls.Add(UCLeftMenu); UCLeftMenu.BringToFront(); SYSModel.clsSysConfig.STR_CURR_MAINMEMU = UCLeftMenu.FunID; ucMenu.MenuButtonStatus(); //三级菜单选中时 一级菜单的选中状态 UCForm.UUCHomePage ucHome = new UCForm.UUCHomePage(); //首页 // home.ID = "STR_" + STR_CS_MEMU_NAME; ucHome.ID = "STR_" + SYSModel.clsSysConfig.STR_CS_MEMU_HOMEMANAGE; ucHome.Name = SYSModel.clsSysConfig.STR_CS_MEMU_HOMEMANAGE; ucHome.Dock = DockStyle.Fill; ucHome.Focus(); panel_Content.Controls.Add(ucHome);// panel_Main.Controls.Add(ucHome); ucHome.BringToFront(); childmemu(null, "首页", SYSModel.clsSysConfig.STR_CS_MEMU_HOMEMANAGE, "", UCLeftMenu.Name, ""); } else { (panel_LeftMenu.Controls.Find("CL_SystemManagement", true)[0] as UCMainLayOut.UCLeftMenu).BringToFront(); } }
/// <summary> /// 添加左侧菜单 /// </summary> /// <param name="menuId">一级菜单的Tag 菜单id</param> /// <param name="munuName">菜单名</param> private void AddLeftMenu(string menuId, string munuName) { SYSModel.clsSysConfig.STR_CURR_MAINMEMU = menuId; if (panel_LeftMenu.Controls.Find(menuId, true).Length == 0) { UCMainLayOut.UCLeftMenu UCLeftMenu = new UCMainLayOut.UCLeftMenu(); //系统管理 UCLeftMenu.Name = menuId;//SYSModel.clsSysConfig.STR_CS_MEMU_FUNCTIONMANAGE; // UCLeftMenu.dtFunction = dt; UCLeftMenu.FunID = menuId; //UCLeftMenu.panel_MainHeight = pnlxLeftMenu.Height; UCLeftMenu.Dock = DockStyle.Fill; UCLeftMenu.Tag = munuName; UCLeftMenu.menuName = munuName; UCLeftMenu.FmMain = this; UCLeftMenu.Focus(); panel_LeftMenu.Controls.Add(UCLeftMenu); UCLeftMenu.BringToFront(); } else { UCMainLayOut.UCLeftMenu UCLeftMenu = panel_LeftMenu.Controls.Find(menuId, true)[0] as UCMainLayOut.UCLeftMenu; UCLeftMenu.LeftMenuState(SYSModel.clsSysConfig.STR_CURR_TWOMEMU, SYSModel.clsSysConfig.STR_CURR_MEMU, SYSModel.clsSysConfig.STR_CURR_MEMU); UCLeftMenu.BringToFront(); } }
/// <summary> 加载首页 /// </summary> private void loadHome() { splitContainerEx_Body.SplitterWidth = 6; SYSModel.clsSysConfig.STR_CURR_MAINMEMU = "S_SysMaintenance"; if (panel_LeftMenu.Controls.Find("S_SysMaintenance", true).Length == 0) { UCMainLayOut.UCLeftMenu UCLeftMenu = new UCMainLayOut.UCLeftMenu(); //系统管理 UCLeftMenu.Name = "S_SysMaintenance";//EntityModel.clsSysConfig.STR_CS_MEMU_FUNCTIONMANAGE; // UCLeftMenu.dtFunction = dt; UCLeftMenu.FunID = "S_SysMaintenance"; //UCLeftMenu.panel_MainHeight = pnlxLeftMenu.Height; UCLeftMenu.Dock = DockStyle.Fill; UCLeftMenu.Tag = "系统管理"; UCLeftMenu.menuName = "系统管理"; UCLeftMenu.FmMain = this; UCLeftMenu.Focus(); panel_LeftMenu.Controls.Add(UCLeftMenu); UCLeftMenu.BringToFront(); SYSModel.clsSysConfig.STR_CURR_MAINMEMU = UCLeftMenu.FunID; ucMenu.MenuButtonStatus();//三级菜单选中时 一级菜单的选中状态 UCForm.UUCHomePage ucHome = new UCForm.UUCHomePage(); //首页 // home.ID = "STR_" + STR_CS_MEMU_NAME; ucHome.ID = "STR_" + SYSModel.clsSysConfig.STR_CS_MEMU_HOMEMANAGE; ucHome.Name = SYSModel.clsSysConfig.STR_CS_MEMU_HOMEMANAGE; ucHome.Dock = DockStyle.Fill; ucHome.Focus(); panel_Content.Controls.Add(ucHome);// panel_Main.Controls.Add(ucHome); ucHome.BringToFront(); childmemu(null, "首页", SYSModel.clsSysConfig.STR_CS_MEMU_HOMEMANAGE, "", UCLeftMenu.Name, ""); } else { (panel_LeftMenu.Controls.Find("CL_SystemManagement", true)[0] as UCMainLayOut.UCLeftMenu).BringToFront(); } }
/// <summary> 左侧菜单点击事件 /// </summary> /// <param name="fun">功能记录</param> /// <param name="ucLeftMenu">左侧菜单对象</param> public void MainFormAddLabel(DataRow fun, UCLeftMenu ucLeftMenu) { try { if (panel_Content.Controls.Find(fun["fun_id"].ToString(), true).Length == 0) { if (this.menus.Count >= MaxPage) { MessageBoxEx.ShowWarning("页签打开数量已达最大上限,请先关闭页签!"); return; } UserControl uc = CommonCtrl.TraverseForm(fun["fun_uri"].ToString()); if (uc == null) { MessageBoxEx.Show(fun["fun_name"].ToString() + " 不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } uc.Name = fun["fun_id"].ToString(); uc.Dock = DockStyle.Fill; uc.Focus(); uc.Tag = fun["fun_id"].ToString() + "|" + ucLeftMenu.Name + "|" + fun["parent_id"].ToString();//三级 |一级| 二级 菜单的id panel_Content.Controls.Add(uc); uc.BringToFront(); Image myImage = null; if (fun["fun_id"] != DBNull.Value && fun["fun_id"].ToString() != "") { myImage = (Image)ServiceStationClient.Skin.Properties.Resources.ResourceManager.GetObject(fun["fun_id"].ToString()); } childmemu(myImage, fun["fun_name"].ToString(), fun["fun_id"].ToString(), fun["parent_id"].ToString(), ucLeftMenu.Name, ""); //添加菜单 menus.Add(fun["fun_id"].ToString(), uc.Tag.ToString()); this.currentMenu = fun["fun_id"].ToString(); } else { panel_Content.Controls.Find(fun["fun_id"].ToString(), true)[0].BringToFront(); childMemuState(fun["fun_id"].ToString()); this.currentMenu = fun["fun_id"].ToString(); } SYSModel.clsSysConfig.STR_CURR_TWOMEMU = fun["parent_id"].ToString(); } catch (Exception ex) { GlobalStaticObj_Server.GlobalLogService.WriteLog("MainForm", ex); MessageBoxEx.ShowWarning("程序异常"); } }