Beispiel #1
0
        //button to access
        private async void bAcceder_Click(object sender, EventArgs e)
        {
            String correo   = txtCorreo.Text;
            String password = txtPassword.Text;

            if (correo != null && password != null)
            {
                Boolean connected = cs.getConnection();

                if (connected != false)
                {
                    Token tk = await cl.login(correo, password);

                    if (tk != null)
                    {
                        String token = tk.getToken();
                        writeTokenInFile(token);
                        saberRolUsuario(tk.getUsuario());
                    }
                    else
                    {
                        MessageBox.Show("Usuario o contraseña incorrectos.", "Error al iniciar sesion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    ErrorServicio es = new ErrorServicio();
                    es.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Inserte un usuario y una contraseña", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #2
0
        public PanelAdmin()
        {
            cs = new ControladorServicio();
            InitializeComponent();

            if (cs.getConnection() != false)
            {
                welcome();
            }
            else
            {
                ErrorServicio es = new ErrorServicio();
                es.ShowDialog();
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public AdminIngrediente()
        {
            cp = new ControladorProductos();
            cs = new ControladorServicio();

            InitializeComponent();

            service = cs.getConnection();

            if (service != false)
            {
                loadIngredientes();
            }
            else
            {
                ErrorServicio es = new ErrorServicio();
                es.ShowDialog();
            }
        }
Beispiel #4
0
        public AdminPizza()
        {
            cp = new ControladorProductos();
            cs = new ControladorServicio();

            listCheckbox = new List <CheckBox>();
            InitializeComponent();

            connection = cs.getConnection();

            if (connection != false)
            {
                cargarListViewPizzas();
                cargarCheckBoxesIngredientes();
            }
            else
            {
                ErrorServicio es = new ErrorServicio();
                es.ShowDialog();
            }
        }
        public SelectorPizzas()
        {
            cs   = new ControladorServicio();
            cp   = new ControladorProductos();
            cPed = new ControladorPedidos();
            InitializeComponent();

            Boolean connected = cs.getConnection();

            if (connected != false)
            {
                loadPizzas();
                loadIngredientes();
                loadBebidas();
            }
            else
            {
                ErrorServicio es = new ErrorServicio();
                es.ShowDialog();
            }
        }