winform+dev的前后台分离标准项目
lg
2024-08-29 fe25786d74d5387d16b490c8c0ef7ad6da2c821c
DevApp/Gs.DevApp/DevFrm/FrmMain.cs
@@ -25,7 +25,7 @@
        private void getTree()
        {
            toolTime.Text = "登录时间"+ LoginInfoModel.CurrentUser.LoginTime;
            toolTime.Text = "登录时间" + LoginInfoModel.CurrentUser.LoginTime;
            var _obj = new
            {
                userGuid = LoginInfoModel.CurrentUser.LoginUserGuid,
@@ -34,7 +34,7 @@
            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();
@@ -51,7 +51,7 @@
                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();
@@ -61,7 +61,7 @@
                    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();
@@ -85,7 +85,7 @@
            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);
        }
@@ -96,7 +96,7 @@
        /// <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))
            {
@@ -105,9 +105,10 @@
            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);
@@ -125,10 +126,12 @@
        {
            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);
@@ -170,7 +173,6 @@
            }
            newForm.FormBorderStyle = FormBorderStyle.None;
            newForm.TopLevel = false;
            //newForm.Parent = ((XtraTabControl)sender).SelectedTabPage;
            newForm.ControlBox = false;
            newForm.Dock = DockStyle.Fill;
            newForm.Visible = true;