예제 #1
0
파일: FormLogin.cs 프로젝트: JevsZ/AppStore
 private void button1_Click(object sender, EventArgs e)
 {
     ConnClass oConexion = new ConnClass();
     string usuario = this.txtUsername.Text.Trim();
     string contra = this.txtPassword.Text.Trim();
     string comando = "SELECT Count(*) FROM usuarios where UsuarioName = '" + usuario + "' and Password = '******'";
     if (oConexion.Count(comando) == 1)
     {
         FormPrincipal principal = new FormPrincipal();
         principal.Show();
         //se le otorga como propietario del formulario a Login
         this.Owner = principal;
         this.Hide();
     }
     else
     {
         MessageBox.Show("Usuario o Password no coinciden");
     }
 }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ConnClass oConexion = new ConnClass();
            string    usuario   = this.txtUsername.Text.Trim();
            string    contra    = this.txtPassword.Text.Trim();
            string    comando   = "SELECT Count(*) FROM usuarios where UsuarioName = '" + usuario + "' and Password = '******'";

            if (oConexion.Count(comando) == 1)
            {
                FormPrincipal principal = new FormPrincipal();
                principal.Show();
                //se le otorga como propietario del formulario a Login
                this.Owner = principal;
                this.Hide();
            }
            else
            {
                MessageBox.Show("Usuario o Password no coinciden");
            }
        }