/// <summary> /// 主窗口的Navbar添加 /// </summary> /// <param name="MainCon"></param> public void MainModule(object MainCon) { NavBarControl MainControl = new NavBarControl(); if (MainControl.GetType() == MainCon.GetType()) { MainControl = (NavBarControl)MainCon; AddNavGroup(MainControl); } }
/// <summary> /// 初始化待办事项 /// </summary> /// <param name="obj"></param> public void InitNavbusiness(object obj) { NavBarControl BusinessCon = new NavBarControl(); if (BusinessCon.GetType() != ((NavBarControl)obj).GetType()) { return; } BusinessCon = (NavBarControl)obj; //以下填写待办事宜的查询添加 }
/// <summary> /// 初始化公告 /// </summary> /// <param name="obj"></param> public void InitNavMessage(object obj) { //判断控件类型 NavBarControl MsgNavControl = new NavBarControl(); if (MsgNavControl.GetType() != ((NavBarControl)obj).GetType()) { return; } MsgNavControl = (NavBarControl)obj; IGetChildMainDataTable MsgChild = new GetMSGDataTable(); //获取公告数据表 DataTable Msgdt = MsgChild.GetDataTable(); string sBarformat = " "; Msgdt.DefaultView.Sort = "MsgUp DESC , MSGSdate DESC "; //给Navbar添加公告数据 if (Msgdt.Rows.Count > 0) { NavBarGroup Navgp1 = new NavBarGroup(); Navgp1.Name = "NavGp1"; Navgp1.Caption = Globals.MsgType1; foreach (DataRowView ldr in Msgdt.DefaultView) { NavBarItem addItem = new NavBarItem(); if (ldr["MsgUp"].ToString() == "1") { sBarformat = " [ 置顶 ]"; addItem.SmallImage = Globals.LoadImage(Globals.MsgUpImg, 16); } else { sBarformat = " "; addItem.SmallImage = Globals.LoadImage(Globals.MsgImg, 16); } addItem.Caption = sBarformat + ldr["MsgTitle"].ToString() + " " + Convertto.ToDateString((DateTime)ldr["MsgRelease"], "yyyy-MM-dd") + " " + ldr["LoginName"].ToString() + " 发布"; addItem.Name = ldr["MsgID"].ToString(); addItem.LinkClicked += new NavBarLinkEventHandler(addItem_LinkClicked); Navgp1.ItemLinks.Add(addItem); } MsgNavControl.Groups.Add(Navgp1); Navgp1.Expanded = true; } }