using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using MySql.Data.MySqlClient; using System.Diagnostics; using System.Windows.Forms.VisualStyles; namespace IntelliDispatch { static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.VisualStyleState = VisualStyleState.NonClientAreaEnabled; //Application.VisualStyleState = VisualStyleState.ClientAndNonClientAreasEnabled; string MyConString = IntelliDispatch.Global.MyConString; MySqlConnection connection = new MySqlConnection(MyConString); MySqlCommand command = connection.CreateCommand(); connection.Open(); MySqlDataReader Reader; command.CommandText = "SELECT * FROM appinfo"; Reader = command.ExecuteReader(); bool current = true; while (Reader.Read()) { if ((string)Reader["appversion"] == "1.0c") { current = true; } else { current = false; } } if (current == false) { DialogResult dialogResult = MessageBox.Show("IntelliDispatch is outdated. Would you like to update?", "Update Available!", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { Process.Start("http://www.intellidispatch.com/download"); } else if (dialogResult == DialogResult.No) { } } connection.Close(); Login objLogin = new Login(); if (objLogin.ShowDialog() == DialogResult.OK) { Application.Run(new frmMain()); } else { } } } }