| | |
| | | using Gs.DevApp.DevFrm.User; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.UserControl; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | |
| | |
| | | FormClosing += FrmMain_FormClosing; |
| | | barEasy.ItemClick += BarEasy_ItemClick; |
| | | getTree(); |
| | | tab.MouseDown += Tab_MouseDown; |
| | | tabCloseCurrent.Click += (s, e) => |
| | | { |
| | | string name = tab.SelectedTabPage.Tooltip; |
| | | RemoveTabPage(tab, name); |
| | | }; |
| | | tabCloseAll.Click += (s, e) => |
| | | { |
| | | string _name = tab.SelectedTabPage.Tooltip; |
| | | int _tabCount = tab.TabPages.Count; |
| | | for (int i = _tabCount; i >= 0; i--) |
| | | { |
| | | try |
| | | { |
| | | string name = tab.TabPages[i].Tooltip; |
| | | if (name != _name) |
| | | { |
| | | RemoveTabPage(tab, name); |
| | | } |
| | | } |
| | | catch (Exception) |
| | | { |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | |
| | | private void Tab_MouseDown(object sender, MouseEventArgs e) |
| | | { |
| | | if (e.Button == MouseButtons.Right) |
| | | { |
| | | tab.ContextMenuStrip = null; |
| | | //TreeListHitInfo hInfo = treeList1.CalcHitInfo(new Point(e.X, e.Y)); |
| | | //TreeListNode node = hInfo.Node; |
| | | //treeList1.FocusedNode = node; |
| | | tab.ContextMenuStrip = cms1; |
| | | |
| | | } |
| | | } |
| | | |
| | | private void BarEasy_ItemClick(object sender, ItemClickEventArgs e) |
| | |
| | | /// <param name="e"></param> |
| | | private void TooLoading_Click(object sender, EventArgs e) |
| | | { |
| | | var i = 100; |
| | | var sdf = new ShowDialogForm("提示", "", "请耐心等候,正在操作中!"); |
| | | for (var j = 0; j < i; j++) |
| | | sdf.SetCaption("执行进度(" + j + "/" + i + ")"); |
| | | sdf.Close(); |
| | | getTree(); |
| | | } |
| | | |
| | | private void getTree() |
| | | private void getTree() |
| | | { |
| | | |
| | | toolTime.Text = "登录时间" + LoginInfoModel.CurrentUser.LoginTime; |
| | | var _obj = new |
| | | { |
| | |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | "User/GetUserLoginInfo", JsonConvert.SerializeObject(_obj)); |
| | | DevExpress.Utils.WaitDialogForm wdf = new DevExpress.Utils.WaitDialogForm("拼命加载中,请稍后......", "友情提示"); |
| | | var _job = JObject.Parse(strJson); |
| | | var rtnCode = _job["rtnCode"].ToString(); |
| | | if (int.Parse(rtnCode) > 0) |
| | |
| | | int gdx = 0, idx = 0; |
| | | foreach (var _dy in drGrp) |
| | | { |
| | | wdf.SetCaption("加载进度:" + _dy["name"].ToString()); |
| | | var _grp = acrd.AddGroup(); |
| | | _grp.ImageOptions.Image = |
| | | UtilityHelper.GetImgFromResource( |
| | |
| | | _itm.Name = _dy2["guid"].ToString(); |
| | | _itm.Style = ElementStyle.Item; |
| | | _itm.Text = _dy2["name"].ToString(); |
| | | wdf.SetCaption("加载进度:" + _dy2["name"].ToString()); |
| | | _itm.Appearance.Normal.Font = |
| | | new Font("Tahoma", 10F); |
| | | _itm.Tag = _dy2["formPath"].ToString(); //存路径,类名 |
| | |
| | | AddTabpage(tab, tabPageName, tabText, |
| | | newFormName, imgIcon); |
| | | } |
| | | |
| | | idx++; |
| | | } |
| | | |
| | | ; |
| | | gdx++; |
| | | } |
| | |
| | | { |
| | | MsgHelper.ShowError("提示:初始化失败,请联系管理员!"); |
| | | } |
| | | wdf.SetCaption("加载进度(90/100)"); |
| | | wdf.Close(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="e"></param> |
| | | private void Tab_CloseButtonClick(object sender, EventArgs e) |
| | | { |
| | | RemoveTabPage(tab, e); |
| | | var args = (ClosePageButtonEventArgs)e; |
| | | var name = args.Page.Tooltip; |
| | | RemoveTabPage(tab, name); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="tabControl"></param> |
| | | /// <param name="tabPageName"></param> |
| | | /// <param name="e"></param> |
| | | public void RemoveTabPage(XtraTabControl tabControl, EventArgs e) |
| | | public void RemoveTabPage(XtraTabControl tabControl, string name) |
| | | { |
| | | if (TabPageDic.Count <= 1) |
| | | { |
| | | MsgHelper.Warning("请至少保留一个功能!"); |
| | | return; |
| | | } |
| | | |
| | | var args = (ClosePageButtonEventArgs)e; |
| | | var name = args.Page.Tooltip; |
| | | foreach (XtraTabPage item in tabControl.TabPages) |
| | | if (item.Name == name) |
| | | { |