private void btnIngresar_Click(object sender, EventArgs e) { LoginController loginController = null; string usuario = null; string contrasena = null; loginController = new LoginController(); usuario = txbUsuarioByLogin.Text; contrasena = txbContrasenaByLogin.Text; bool consultaExitosa = loginController.GetLogin(usuario, contrasena); if (consultaExitosa) { this.Hide(); HomeView homeView = new HomeView(this); homeView.UserName = loginController.Nombre; homeView.Show(); } else { MessageView messageView = new MessageView(loginController.Error); messageView.Show(); txbUsuarioByLogin.Text = ""; txbContrasenaByLogin.Text = ""; } }
public VehicleView(HomeView HomeView, string userName) { InitializeComponent(); VehicleController vehicleController = new VehicleController(); this.HomeView = HomeView; this.UserName = userName; this.txtVendedor.Text = this.UserName; }