Esempio n. 1
0
        public void iniciar()
        {
            MesaBusiness    mesaBusiness      = new MesaBusiness();
            MozoBusiness    mozoxmesaBusiness = new MozoBusiness();
            UsuarioBusiness usuarioBusiness   = new UsuarioBusiness();
            ReservaBusiness reservaBusiness   = new ReservaBusiness();
            Form            cargar            = new Bienvenida();

            reservaBusiness.verificarReservasHorarios();
            cargar.ShowDialog();
            btnCerrarSesion.Enabled = false;
            btnFacturacion.Enabled  = false;
            btnInsumos.Enabled      = false;
            btnUsuarios.Enabled     = false;
            btnMesas.Enabled        = false;
            btnReserva.Enabled      = false;
            timer1.Start();
            cmbUsuario.DisplayMember = "usuario";
            cmbUsuario.DataSource    = usuarioBusiness.leerUsuarios();
        }
Esempio n. 2
0
 //VALIDACION DE ACCESSO
 private void BtnLogin_Click(object sender, EventArgs e)
 {
     if (TxtUser.Text != "Username")
     {
         if (TxtUser.Text != "Username" && TxtUser.TextLength > 2)
         {
             if (TxtPass.Text != "Password")
             {
                 var valirpass = TxtPass.Text;
                 var valiruser = TxtUser.Text;
                 if (valirpass == "admin" && valiruser == "lobo")
                 {
                     this.Hide();
                     Bienvenida welcome = new Bienvenida();
                     welcome.ShowDialog();
                     Menu abrir = new Menu();
                     abrir.Show();
                     abrir.FormClosed += Logout;
                 }
                 else
                 {
                     msgError("Incorrect username or password entered. \n   Please try again.");
                     TxtPass.Text = "Password";
                     TxtPass.UseSystemPasswordChar = false;
                     TxtUser.Focus();
                 }
             }
             else
             {
                 msgError("Please enter password.");
             }
         }
         else
         {
             msgError("Please enter username.");
         }
     }
 }