private void btnOK_Click(object sender, EventArgs e) { MainWindow menu = new MainWindow(); if (filledValues()) { //user u = new user(serviceDA.validateUser()); Cursor.Current = Cursors.WaitCursor; serviceDA = new DBControllerWSClient();//Error 00:14 user u = serviceDA.validateUser(txtUsername.Text, txtPassword.Text); Cursor.Current = Cursors.Arrow; if (u.password != null) { if (txtUsername.Text == u.user1) { if (u.userType == 1) { menu.darPermiso(MainWindow.Permiso.Gerente); } else if (u.userType == 2) { menu.darPermiso(MainWindow.Permiso.Supervisor); } else if (u.userType == 3) { menu.darPermiso(MainWindow.Permiso.Vendedor); } menu.currentUser = u; menu.Show(); this.Hide(); } else { MessageBox.Show("Usuario o contraseña incorrectos"); } } else { writePassword.Visible = true; writeUser.Visible = true; MessageBox.Show("Usuario o contraseña incorrectos"); return; } } }