Esempio n. 1
0
        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 = "";
            }
        }
Esempio n. 2
0
        public VehicleView(HomeView HomeView, string userName)
        {
            InitializeComponent();
            VehicleController vehicleController = new VehicleController();

            this.HomeView         = HomeView;
            this.UserName         = userName;
            this.txtVendedor.Text = this.UserName;
        }