/*
  * TODO:
  * Verify wich kind o user it is
  */
 private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         Classes.Usuario user = new Classes.Usuario(0, textBoxUser.Text, textBoxPassword.Text, 0);
         if (user.Autenticate())
         {
             Forms.FormMain nextScreen = new Forms.FormMain(user.AcessLevel);
             this.Visible = false;
             nextScreen.ShowDialog();
             this.Close();
         }
         else
         {
             //Usuario não foi atenticado
             throw new InvalidLoginException("invalid combination of user and password");
         }
     }
     catch (MySqlException ex)
     {
         //Tratamento de Exeções do MySQL
         MessageBox.Show("Ocorreu um erro", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Console.WriteLine(ex);
     }
     catch (InvalidLoginException) {
         //Callback caso usuario não tenha sido atenticado
         MessageBox.Show("Usuário ou Senha invalidos\n Tente Novamente", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
    public FormSplash(Forms.FormMain theMainForm)
        : this()
    {
        _theMainForm = theMainForm;

        Application.Idle += new EventHandler(Application_Idle);
    }
Esempio n. 3
0
        private void buttonEditWhole_Click(object sender, EventArgs e)
        {
            Database db   = context.context.DatabaseSet.Find(selectedTable);
            Form     form = new Forms.FormMain(db);

            form.ShowDialog();
        }
    static void Main()
    {
        var formMain = new Forms.FormMain();
        var splash   = new Forms.FormSplash(formMain);

        splash.Show();
        Application.DoEvents();
        Application.Run(formMain);
    }
    void theTimer_Tick(object sender, EventArgs e)
    {
        this.theTimer.Stop();
        this.Close();

        Application.DoEvents();

        _theMainForm.Opacity = 100;
        _theMainForm.Refresh();
        _theMainForm = null;
    }
Esempio n. 6
0
        public void Start(Forms.FormMain formMain, SettingParams settingParams)
        {
            //State:
            _Threads         = null;
            _ActiveThreads   = 0;
            _Permutations    = 0;
            _CompletedChunks = 0;
            _ConsumedWords   = 0;
            _StopRunning     = false;
            _IsRunning       = false;

            //Settings:
            _SettingParams = settingParams;
            _FormMain      = formMain;
            _StopRunning   = false;
            _IsRunning     = true;

            _FormMain.Invoke(_FormMain.deStateChanged, true);

            ThreadPool.QueueUserWorkItem(StartAsync);
        }