private void tvUser_function_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { DataRow dr = e.Node.Tag as DataRow; HXCPcClient.UCMainLayOut.UCLeftMenu UCLeftMenu; SYSModel.clsSysConfig.STR_CURR_MAINMEMU = dr["firstid"].ToString(); //一级菜单id SYSModel.clsSysConfig.STR_CURR_TWOMEMU = dr["parent_id"].ToString(); //二级菜单id string threeMenu = e.Node.Name; //三级菜单 Control[] ctls = this.panel_LeftMenu.Controls.Find(SYSModel.clsSysConfig.STR_CURR_MAINMEMU, false); if (ctls.Length == 0) { UCLeftMenu = new HXCPcClient.UCMainLayOut.UCLeftMenu(); UCLeftMenu.Name = SYSModel.clsSysConfig.STR_CURR_MAINMEMU; UCLeftMenu.FunID = SYSModel.clsSysConfig.STR_CURR_MAINMEMU; UCLeftMenu.Dock = DockStyle.Fill; UCLeftMenu.Tag = ""; UCLeftMenu.menuName = ""; UCLeftMenu.FmMain = this; UCLeftMenu.Focus(); panel_LeftMenu.Controls.Add(UCLeftMenu); } else { UCLeftMenu = ctls[0] as HXCPcClient.UCMainLayOut.UCLeftMenu; } UCLeftMenu.LeftMenuState(SYSModel.clsSysConfig.STR_CURR_TWOMEMU, e.Node.Name); UCLeftMenu.BringToFront(); this.MenuAdd(dr); ucMenuBar1.MenuButtonStatus(); }
/// <summary> /// 加载首页 /// </summary> private void loadHome() { splitContainerEx_Body.SplitterWidth = 6; UUCHomeManage ucHome = new UUCHomeManage(); //首页 ucHome.ID = "STR_" + SYSModel.clsSysConfig.STR_CS_MEMU_HOMEMANAGE; ucHome.Name = SYSModel.clsSysConfig.STR_CS_MEMU_HOMEMANAGE; ucHome.Dock = DockStyle.Fill; panel_Content.Controls.Add(ucHome);// panel_Main.Controls.Add(ucHome); ucHome.BringToFront(); SYSModel.clsSysConfig.STR_CURR_MAINMEMU = "CL_RepairBusiness"; childmemu(null, "首页", SYSModel.clsSysConfig.STR_CS_MEMU_HOMEMANAGE, "", SYSModel.clsSysConfig.STR_CURR_MAINMEMU, ""); if (!this.panel_LeftMenu.Controls.ContainsKey(SYSModel.clsSysConfig.STR_CURR_MAINMEMU)) { HXCPcClient.UCMainLayOut.UCLeftMenu UCLeftMenu = new HXCPcClient.UCMainLayOut.UCLeftMenu(); //系统管理 UCLeftMenu.Name = SYSModel.clsSysConfig.STR_CURR_MAINMEMU; UCLeftMenu.FunID = SYSModel.clsSysConfig.STR_CURR_MAINMEMU; UCLeftMenu.Dock = DockStyle.Fill; UCLeftMenu.menuName = "维修业务"; UCLeftMenu.Tag = UCLeftMenu.menuName; UCLeftMenu.FmMain = this; UCLeftMenu.Focus(); panel_LeftMenu.Controls.Add(UCLeftMenu); UCLeftMenu.BringToFront(); SYSModel.clsSysConfig.STR_CURR_MAINMEMU = UCLeftMenu.FunID; ucMenuBar1.MenuButtonStatus();//三级菜单选中时 一级菜单的选中状态 } else { (panel_LeftMenu.Controls.Find("CL_RepairBusiness", false)[0] as HXCPcClient.UCMainLayOut.UCLeftMenu).BringToFront(); } }
private void tvUser_function_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { DataRow dr = e.Node.Tag as DataRow; HXCPcClient.UCMainLayOut.UCLeftMenu UCLeftMenu; SYSModel.clsSysConfig.STR_CURR_MAINMEMU = dr["firstid"].ToString();//一级菜单id SYSModel.clsSysConfig.STR_CURR_TWOMEMU = dr["parent_id"].ToString();//二级菜单id string threeMenu = e.Node.Name;//三级菜单 Control[] ctls = this.panel_LeftMenu.Controls.Find(SYSModel.clsSysConfig.STR_CURR_MAINMEMU, false); if (ctls.Length == 0) { UCLeftMenu = new HXCPcClient.UCMainLayOut.UCLeftMenu(); UCLeftMenu.Name = SYSModel.clsSysConfig.STR_CURR_MAINMEMU; UCLeftMenu.FunID = SYSModel.clsSysConfig.STR_CURR_MAINMEMU; UCLeftMenu.Dock = DockStyle.Fill; UCLeftMenu.Tag = ""; UCLeftMenu.menuName = ""; UCLeftMenu.FmMain = this; UCLeftMenu.Focus(); panel_LeftMenu.Controls.Add(UCLeftMenu); } else { UCLeftMenu = ctls[0] as HXCPcClient.UCMainLayOut.UCLeftMenu; } UCLeftMenu.LeftMenuState(SYSModel.clsSysConfig.STR_CURR_TWOMEMU, e.Node.Name); UCLeftMenu.BringToFront(); this.MenuAdd(dr); ucMenuBar1.MenuButtonStatus(); }
/// <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 (!this.panel_LeftMenu.Controls.ContainsKey(menuId)) { UCLeftMenu UCLeftMenu = new 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 { UCLeftMenu UCLeftMenu = panel_LeftMenu.Controls.Find(menuId, false)[0] as UCLeftMenu; UCLeftMenu.LeftMenuState(SYSModel.clsSysConfig.STR_CURR_TWOMEMU, SYSModel.clsSysConfig.STR_CURR_MEMU, SYSModel.clsSysConfig.STR_CURR_MEMU); UCLeftMenu.BringToFront(); } }
/// <summary> /// 左侧菜单点击事件 /// </summary> /// <param name="fun">功能记录</param> /// <param name="ucLeftMenu">左侧菜单对象</param> public void MainFormAddLabel(DataRow fun, UCLeftMenu ucLeftMenu) { if (!this.panel_Content.Controls.ContainsKey(fun["fun_id"].ToString())) { //添加窗体 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().Length > 0) { myImage = ServiceStationClient.Skin.SkinAssistant.GetResourcesImage(fun["fun_img"]); } childmemu(myImage, fun["fun_name"].ToString(), fun["fun_id"].ToString(), fun["parent_id"].ToString(), ucLeftMenu.Name, ""); } else { panel_Content.Controls[fun["fun_id"].ToString()].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; this.ucHome.LoadMap(SYSModel.clsSysConfig.STR_CURR_MAINMEMU); if (!this.panel_LeftMenu.Controls.ContainsKey(menuId)) { UCLeftMenu UCLeftMenu = new UCLeftMenu(); //系统管理 UCLeftMenu.Name = menuId;//SYSModel.clsSysConfig.STR_CS_MEMU_FUNCTIONMANAGE; UCLeftMenu.FunID = menuId; UCLeftMenu.Dock = DockStyle.Fill; UCLeftMenu.Tag = munuName; UCLeftMenu.menuName = munuName; UCLeftMenu.FmMain = this; UCLeftMenu.Focus(); panel_LeftMenu.Controls.Add(UCLeftMenu); UCLeftMenu.BringToFront(); foreach (Control ctl in this.panel_LeftMenu.Controls) { if (ctl is UCLeftMenu && ctl.Name != menuId) { ctl.Dispose(); } } } else { Control ctl = panel_LeftMenu.Controls.Find(menuId, false)[0]; ctl.BringToFront(); ctl.Visible = true; } }