Пример #1
0
 static void Main()
 {
     if (DatabaseUtils.DatabaseUtilsConnect())
     {
         Application.EnableVisualStyles();
         //Application.SetCompatibleTextRenderingDefault(false);
         Application.Run(new frmMain());
     }
 }
Пример #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            // Application.SetCompatibleTextRenderingDefault(false);

            /* Database Initialization */
            int config = DatabaseConfig.GetLocalStorageConfig();

            if (config == 1)
            {
                if (DatabaseUtils.DatabaseUtilsConnect())
                {
                    if (UserBUS.HandleCheckLoginLocalStorage())
                    {
                        if (Control.userLogin.IdUser.Substring(0, 2) == Config.typeAdmin)
                        {
                            Application.Run(new frmMain());
                        }
                        else if (Control.userLogin.IdUser.Substring(0, 2) == Config.typeStudent)
                        {
                            Application.Run(new frmMainStudent());
                        }
                    }
                    else
                    {
                        Application.Run(new frmLogin());
                    }
                }
            }
            else if (config == 0)
            {
                Application.Run(new frmConfigDatabase());
            }
            else if (config == -1)
            {
                Application.Exit();
            }
        }