Ejemplo n.º 1
0
 static void Main()
 {
     try
     {
         Environment.CurrentDirectory = Application.StartupPath;
         Thread.CurrentThread.Name    = System.Reflection.Assembly.GetEntryAssembly().GetName().Name;
         Log.Info("原油管理模块启动.");
         AppDomain.CurrentDomain.UnhandledException += new System.UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
         Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         bool     BZH      = false;
         FrmLogin frmLogin = new FrmLogin(BZH);
         //if (System.ComponentModel.LicenseManager.Validate(typeof(FrmLogin), frmLogin).LicenseKey != null)//注册表检查
         //{
         if (frmLogin.ShowDialog() == DialogResult.OK)
         {
             FrmMain frmMain = new FrmMain(frmLogin.role);
             frmMain.initMenu(BZH);
             Application.Run(frmMain);
             frmLogin.Close();
         }
         //}
     }
     catch (System.ComponentModel.LicenseException ex)
     {
         if (new Forms.LicenseManager().ShowDialog() == DialogResult.OK)
         {
             Application.Exit();
         }
     }
 }
Ejemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //XbUser user = new XbUser();
            //user.ID = 1;
            //user.Name = "admin";
            //user.IsAdmin = true;
            //user.Password = "******";
            //Application.Run(new FrmBeatifulChart2());

            //Application.Run(new FrmInterface4192(user, new List<int>() {15,166,32},
            //    new DateTime(1989, 1, 1),
            //    new DateTime(2004, 2, 29)));

            FrmLogin frmLogin = new FrmLogin();

            frmLogin.ShowDialog();
            if (frmLogin.DialogResult == DialogResult.OK)
            {
                frmLogin.Close();
                var frmFirst = new FrmFirst(frmLogin.User);
                Application.Run(frmFirst);
            }
        }
Ejemplo n.º 3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppDomain.CurrentDomain.UnhandledException   += CurrentDomain_UnhandledException;
            AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
            try
            {
                _splashScreen               = new SplashScreen();
                _splashScreen.WindowState   = FormWindowState.Normal;
                _splashScreen.StartPosition = FormStartPosition.CenterScreen;

                if (_splashScreen.ShowDialog() == DialogResult.OK)
                {
                    if (!_splashScreen.DatabaseExists)
                    {
                        FormsOpened <FrmDataBaseConfig> .OpenForm(frmDataBaseConfig);
                    }

                    var container = BuildContainer();

                    var frm = new FrmLogin(container);

                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        frm.Close();
                        _frmMain = new FrmMain(container);

                        using (var scope = container.BeginLifetimeScope())
                            Application.Run(_frmMain);
                    }
                    else
                    {
                        Application.Exit();
                    }
                }
            }
            catch (Exception ex)
            {
                _splashScreen.Close();
                KryptonMessageBox.Show("Wystąpił błąd, treść : " + ex.Message, "Uwaga!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                Application.Exit();
            }
        }
Ejemplo n.º 4
0
 private void iExit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     frmLogin.Close();
 }