コード例 #1
0
 public void MdiShow2(BaseForm frm)
 {
     try
     {
         System.Windows.Forms.Form[] mdiChildren = base.MdiChildren;
         for (int i = 0; i < mdiChildren.Length; i++)
         {
             System.Windows.Forms.Form form = mdiChildren[i];
             if (form.GetType().Equals(frm.GetType()))
             {
                 form.Activate();
                 form.Show();
                 frm.Dispose();
                 return;
             }
         }
         frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
         frm.MdiParent     = this;
         frm.KeyPreview    = true;
         frm.Mainform      = this;
         frm.InitFeatureButton();
         frm.Show();
     }
     catch (System.Exception ex)
     {
         DxPublic.ShowException(ex, this.Text);
     }
 }
コード例 #2
0
 private void InitialUserSkin()
 {
     try
     {
         SkinHelper.InitSkinGallery(skinRibbon);
         var SkinName = AppSetingHelper.GetDefaultTheme();
         DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(SkinName);//skinName为皮肤名
         skinRibbon.Caption = "主题:" + SkinName;
     }
     catch (Exception ex) {
         DxPublic.ShowException(ex);
         throw ex;
     }
 }
コード例 #3
0
 //数据库初始化
 public void Inital()
 {
     try {
         string Sqlconn = AppSetingHelper.GetConnectionString("SqlConnStringMain");
         SQLSetting = new DbSettingInfo(Sqlconn);
         SQLSetting.DBconnStrType = ConnStrType.SQL;
         this.txtSQLServer.Text   = SQLSetting.DBServer;
         this.txtSQLDbName.Text   = SQLSetting.DBName;
         this.txtSQLUser.Text     = SQLSetting.DBUser;
         this.txtSQLPwd.Text      = SQLSetting.DBUserPwd;
         // this.txtSQLPort.Text   = SQLSetting.DBPort;
     }
     catch (Exception ex)
     {
         DxPublic.ShowException(ex, Text);
     }
 }
コード例 #4
0
 public void MdiShow(BaseForm frm, object FuncId, bool ReStart = false)
 {
     try
     {
         System.Windows.Forms.Form[] mdiChildren = base.MdiChildren;
         for (int i = 0; i < mdiChildren.Length; i++)
         {
             System.Windows.Forms.Form form = mdiChildren[i];
             if (!ReStart)
             {
                 if (form.GetType().Equals(frm.GetType()))
                 {
                     form.Activate();
                     form.Show();
                     frm.Dispose();
                     return;
                 }
             }
             else if (form.GetType().Equals(frm.GetType()))
             {
                 form.Close();
                 form.Dispose();
             }
         }
         string objectString = DxPublic.GetObjString(FuncId);
         if (!string.IsNullOrEmpty(objectString))
         {
             frm.FuncId = Guid.Parse(objectString);
         }
         frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
         frm.MdiParent     = this;
         frm.KeyPreview    = true;
         frm.Mainform      = this;
         frm.InitFeatureButton();
         frm.Show();
     }
     catch (System.Exception ex)
     {
         DxPublic.ShowException(ex, this.Text);
     }
 }
コード例 #5
0
        /// <summary>
        /// 主窗体加载事件
        /// </summary>
        private void MainForm_Load(object sender, EventArgs e)
        {
            InitialUserSkin(); //初始化主题

            CloseAllWin();     //关闭所有子窗体

            Menu_Null();       //初始化受权

            if (!Global._SqlDb.IsConnectionTest())
            {
                DxPublic.ShowMessage("数据库连接失败,请重新配置", Text);
                this.btnDBConnSetup_ItemClick(null, null);
            }
            else
            {
                if (this.LoginForm != null)
                {
                    this.LoginForm = null;
                }
                try
                {
                    Thread ThLogin = new Thread(doLogin);
                    ThLogin.Start();
                }
                catch (System.Exception ex)
                {
                    DxPublic.ShowException(ex, this.Text);
                }
                finally
                {
                    if (this.LoginForm != null)
                    {
                        this.LoginForm.Dispose();
                        this.LoginForm = null;
                    }
                }
            }
        }
コード例 #6
0
 /// <summary>
 /// 菜单的初始化
 /// </summary>
 private void Menu_Init()
 {
     base.Invoke(new EventHandler(delegate
     {
         if (Global._Session._UserId != null && Global._Session._UserId != Guid.Empty)
         {
             this.StatusLoginName.Caption = "用户:" + Global._Session._LoginName;
             this.statusLogintime.Caption = DateTime.Now.ToString("yyyy年MM月dd HH:mm:ss dddd");
             this.statusIP.Caption        = "  登录IP:" + Global._Session._IPAddress;
             this.statusMac.Caption       = "  登录MAC:" + Global._Session._MACAddress;
             this.statusFullName.Caption  = "  真实姓名:" + Global._Session._FullName;
             try
             {
                 this.Menu_Visible();
                 this.MenuInited = true;
             }
             catch (System.Exception ex)
             {
                 DxPublic.ShowException(ex, this.Text);
             }
         }
     }));
 }