示例#1
0
 private void SENHAtextBox_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyValue == 13)
     {
         if (LOGINtextBox.Text == "")
         {
             MessageBox.Show("Usuário em branco!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             SENHAtextBox.Text = "";
             LOGINtextBox.Text = "";
             LOGINtextBox.Focus();
         }
         else
         {
             if (SENHAtextBox.Text == "")
             {
                 MessageBox.Show("Senha em branco!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 SENHAtextBox.Text = "";
                 LOGINtextBox.Text = "";
                 LOGINtextBox.Focus();
             }
             else
             {
                 if (CONFIRMAtextBox.Visible)
                 {
                     CONFIRMAtextBox.Focus();
                 }
                 else
                 {
                     user = app.oneLogin(LOGINtextBox.Text);
                     if (user.Senha == SENHAtextBox.Text)
                     {
                         entrar();
                     }
                     else
                     {
                         MessageBox.Show("Login ou senha não cadastrados.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                         SENHAtextBox.Text = "";
                         LOGINtextBox.Text = "";
                         LOGINtextBox.Focus();
                     }
                 }
             }
         }
     }
 }
示例#2
0
 private void ENTRARbutton_Click(object sender, EventArgs e)
 {
     if (LOGINtextBox.Text != "" & SENHAtextBox.Text != "")
     {
         if (CONFIRMAtextBox.Visible)
         {
             if (CONFIRMAtextBox.Text != "")
             {
                 if (SENHAtextBox.Text == CONFIRMAtextBox.Text)
                 {
                     user.Senha = SENHAtextBox.Text;
                     app.save(user);
                     entrar();
                 }
                 else
                 {
                     MessageBox.Show("Confirmação da senha diferente.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     CONFIRMAtextBox.Focus();
                 }
             }
         }
         else
         {
             if (user.Senha == SENHAtextBox.Text)
             {
                 entrar();
             }
             else
             {
                 MessageBox.Show("Login ou senha não cadastrados.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 SENHAtextBox.Text = "";
                 LOGINtextBox.Text = "";
                 LOGINtextBox.Focus();
             }
         }
     }
 }