Example #1
0
        static void Main(string[] args)
        {
            LoginForm loginForm = new LoginForm();
            DialogResult dialogResult = loginForm.ShowDialog();
            while (dialogResult == DialogResult.Retry)
            {
                dialogResult = loginForm.ShowDialog();
            }

            if (dialogResult == DialogResult.OK)
            {
                try
                {
                    Application.Run(new TimeTrackerForm());
                }
                catch (Exception)
                {
                    MessageBox.Show("Some odd error has occured. Program don't know how to deal with it, so I will quit. If you see this message more than is healty, you can send me an email. Have a nice day :-)");
                }
            }
            else
            {
                Application.Exit();
            }
        }
Example #2
0
 private void Unauthorized()
 {
     LoginForm loginForm = new LoginForm("Unathorized access. Did you change credentials on server?");
     DialogResult dialogResult = loginForm.ShowDialog();
     while (dialogResult == DialogResult.Retry) {
         dialogResult = loginForm.ShowDialog();
     }
 }