Exemplo n.º 1
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     if(this.IsValid())
     {
         if(DBConnector.FindLogin(tbLogin.Text))
         {
             MessageBox.Show("This login is occupied!");
         }
         else
         {
             if (DBConnector.AddUser(tbLogin.Text, tbPas.Text, tbEmail.Text, tbName.Text, tbSurName.Text))
             {
                 MessageBox.Show("New user created!");
                 MainForm mf = new MainForm(this);
                 mf.Show();
                 this.Hide();
             }
             else
             {
                 MessageBox.Show("New user is not created! Try again!");
             }
         }
     }
     else
     {
         MessageBox.Show("Check your data!");
     }
 }
Exemplo n.º 2
0
 private void btnIn_Click(object sender, EventArgs e)
 {
     if (DBConnector.FindLogin(tbName.Text) == false)
     {
         MessageBox.Show("User not find!");
     }
     else 
     {
         if(DBConnector.CheckUser(tbName.Text, tbPassword.Text))
         {
             this.Hide();
             MainForm mainForm = new MainForm(this);
             mainForm.Show();
         }
         else
         {
             MessageBox.Show("You enter invaled password!");
         }
     }
 }