Ejemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            bool successful = true;

            try
            {
                successful &= MainController.ChangeServer(txtmServerIP.Text, txtmServerPort.Text);
                if (gbxLokacija.Enabled)
                {
                    successful &= MainController.ChangeCurrentMensa((Mensa)cbxSettingsMenza.SelectedItem);
                }
            }
            catch (Exception ex)
            {
                MUtility.ShowException(ex);
                return;
            }
            if (!successful)
            {
                return;
            }

            this.DialogResult = DialogResult.OK;
            Close();
        }
Ejemplo n.º 2
0
 private void bgWorkerLoading_DoWorkLogOut()
 {
     Thread.Sleep(500);
     try
     {
         MainController.Shutdown();
     }
     catch (Exception ex)
     {
         MUtility.ShowException(ex);
         Environment.Exit(1);
     }
 }
Ejemplo n.º 3
0
 private void bgWorkerLoading_DoWork(object sender, DoWorkEventArgs e)
 {
     Thread.Sleep(500);
     try
     {
         MainController.PostLoginInit();
     }
     catch (Exception ex)
     {
         MUtility.ShowException(ex);
         MainController.LogoutUser();
         Environment.Exit(1);
     }
 }
Ejemplo n.º 4
0
 private void statbarUserSignOut_Click(object sender, EventArgs e)
 {
     try
     {
         bgWorkerLoading.DoWork += (sender2, args) => bgWorkerLoading_DoWorkLogOut();
         this.Hide();
         bgWorkerLoading.RunWorkerAsync();
         loadform.TextToDisplay = "Odjavljivanje";
         loadform.ShowDialog();
     }
     catch (Exception ex)
     {
         MUtility.ShowException(ex);
     }
 }