| | |
| | | |
| | | private void getTree() |
| | | { |
| | | toolTime.Text = "登录时间"+ LoginInfoModel.CurrentUser.LoginTime; |
| | | toolTime.Text = "登录时间" + LoginInfoModel.CurrentUser.LoginTime; |
| | | var _obj = new |
| | | { |
| | | userGuid = LoginInfoModel.CurrentUser.LoginUserGuid, |
| | |
| | | string strJson = ""; |
| | | try |
| | | { |
| | | strJson = UtilityHelper.HttpPost("", "User/GetUserInfo", JsonConvert.SerializeObject(_obj)); |
| | | strJson = UtilityHelper.HttpPost("", "User/GetUserLoginInfo", JsonConvert.SerializeObject(_obj)); |
| | | JObject _job = JObject.Parse(strJson); |
| | | string rtnCode = _job["rtnCode"].ToString(); |
| | | string rtnMsg = _job["rtnMsg"].ToString(); |
| | |
| | | foreach (DataRow _dy in drGrp) |
| | | { |
| | | AccordionControlElement _grp = this.acrd.AddGroup(); |
| | | _grp.ImageOptions.Image = UtilityHelper.GetImgFromResource(_dy["icon"].ToString(),1); |
| | | _grp.ImageOptions.Image = UtilityHelper.GetImgFromResource(_dy["icon"].ToString(), 1); |
| | | _grp.Name = _dy["guid"].ToString(); |
| | | _grp.Style = DevExpress.XtraBars.Navigation.ElementStyle.Group; |
| | | _grp.Text = _dy["name"].ToString(); |
| | |
| | | foreach (DataRow _dy2 in drItem) |
| | | { |
| | | AccordionControlElement _itm = this.acrd.AddItem(); |
| | | _itm.ImageOptions.Image = UtilityHelper.GetImgFromResource(_dy2["icon"].ToString(),2); |
| | | _itm.ImageOptions.Image = UtilityHelper.GetImgFromResource(_dy2["icon"].ToString(), 2); |
| | | _itm.Name = _dy2["guid"].ToString(); |
| | | _itm.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; |
| | | _itm.Text = _dy2["name"].ToString(); |
| | |
| | | string tabPageName = _acd.Name + "_page"; |
| | | string tabText = _acd.Text; |
| | | string newFormName = _acd.Tag.ToString(); |
| | | Image imgIcon= _acd.Image; |
| | | Image imgIcon = _acd.Image; |
| | | AddTabpage(tab, tabPageName, tabText, newFormName, imgIcon); |
| | | } |
| | | |
| | |
| | | /// <param name="tabPageName">当期选项卡页name名称</param> |
| | | /// <param name="tabText">当前选项卡页Text标题</param> |
| | | /// <param name="newFormName">当前选项卡中的新窗体</param> |
| | | public void AddTabpage(XtraTabControl tabControl, string tabPageName, string tabText, string newFormName,Image imgIcon) |
| | | public void AddTabpage(XtraTabControl tabControl, string tabPageName, string tabText, string newFormName, Image imgIcon) |
| | | { |
| | | if (IsTabpageExsit(tabControl, tabPageName)) |
| | | { |
| | |
| | | XtraTabPage newPage = new XtraTabPage(); |
| | | newPage.Name = tabPageName; |
| | | newPage.Text = tabText; |
| | | newPage.Tooltip = (tabText + ":" + tabPageName); |
| | | newPage.Tooltip = (tabText); |
| | | newPage.ImageOptions.Image = imgIcon; |
| | | if (AddNewForm(newFormName) != null) { |
| | | if (AddNewForm(newFormName) != null) |
| | | { |
| | | newPage.Controls.Add(AddNewForm(newFormName)); |
| | | tabControl.TabPages.Add(newPage); |
| | | TabPageDic.Add(tabPageName, newPage); |
| | |
| | | { |
| | | DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs args = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; |
| | | string name = args.Page.Tooltip; |
| | | MessageBox.Show(name); |
| | | foreach (XtraTabPage item in tabControl.TabPages) |
| | | { |
| | | if (item.Name == name) |
| | | { |
| | | MessageBox.Show(item.Name); |
| | | tabControl.TabPages.Remove(item); |
| | | item.Dispose(); |
| | | TabPageDic.Remove(name); |
| | |
| | | } |
| | | newForm.FormBorderStyle = FormBorderStyle.None; |
| | | newForm.TopLevel = false; |
| | | //newForm.Parent = ((XtraTabControl)sender).SelectedTabPage; |
| | | newForm.ControlBox = false; |
| | | newForm.Dock = DockStyle.Fill; |
| | | newForm.Visible = true; |