Ejemplo n.º 1
0
        private void BtnActualizarLista_Click(object sender, RoutedEventArgs e)
        {
            BoletaBLL bolBLL  = new BoletaBLL();
            DataTable Boletas = bolBLL.GetBoletasPorPagar();

            dtgBoletas.ItemsSource = Boletas.DefaultView;
        }
Ejemplo n.º 2
0
        private void GetTotal(int numeroBoleta)
        {
            BoletaBLL bolBLL = new BoletaBLL();
            int       total  = bolBLL.GetTotalBoleta(numeroBoleta);

            if (total != 0 && total != -1)
            {
                lblTotal.Text   = "Total: $" + total;
                lblDetalle.Text = "Detalle Pedidos";
            }
        }
        private void Btn_ingresar_Click(object sender, RoutedEventArgs e)
        {
            if (rbClienteNuevo.IsChecked == true)
            {
                if (MessageBox.Show("Ingresar Cliente " + txt_nombre.Text + " " + "a mesa " + cbox_cantidad.SelectedValue + "?", "Seguro?", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
                {
                    usuarioBLL usrBLL   = new usuarioBLL();
                    int        rut      = int.Parse(txt_rut.Text);
                    string     nombre   = txt_nombre.Text;
                    string     apellido = txt_apellido.Text;
                    string     email    = txt_email.Text;
                    bool       status   = usrBLL.CreateCliente(rut, nombre, apellido, email);
                    if (status)
                    {
                        BoletaBLL bolBLL = new BoletaBLL();

                        int id_mesa   = int.Parse(cbox_cantidad.SelectedValue.ToString());
                        int id_garzon = int.Parse(cbGarzon.SelectedValue.ToString());
                        if (bolBLL.insertBoleta(id_mesa, id_garzon, rut))
                        {
                            MessageBox.Show("Asignacion Ingresada Correctamente");
                        }
                        else
                        {
                            MessageBox.Show("El Cliente Fue ingresado, Pero ocurrio un error al ingresar la asignacion de mesa");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Ocurrio un error al ingresar el cliente");
                    }
                }
                loadGarzones();
            }
            else if (rbClienteRegistrado.IsChecked == true)
            {
                BoletaBLL bolBLL    = new BoletaBLL();
                int       id_mesa   = int.Parse(cbox_cantidad.SelectedValue.ToString());
                int       id_garzon = int.Parse(cbGarzon.SelectedValue.ToString());
                int       rut       = int.Parse(txt_rut.Text);
                if (bolBLL.insertBoleta(id_mesa, id_garzon, rut))
                {
                    MessageBox.Show("Asignacion Ingresada Correctamente");
                }
                else
                {
                    MessageBox.Show("Ocurrio un error al ingresar la asignacion de mesa");
                }
            }
        }
Ejemplo n.º 4
0
        private void BtnPagar_Click(object sender, RoutedEventArgs e)
        {
            var item = dtgBoletas.SelectedItem as DataRowView;

            if (null != item)
            {
                int       id     = Int32.Parse(item.Row[0].ToString());
                BoletaBLL bolBLL = new BoletaBLL();

                if (bolBLL.SetPagado(id, "pagado"))
                {
                    MessageBox.Show("Boleta Pagada Correctamente");
                }
                else
                {
                    MessageBox.Show("Ocurrio un error al Cambiar el estado de la boleta seleccionada");
                }
            }
            else
            {
                MessageBox.Show("Debe Seleccionar una boleta para utilizar esta funcion");
            }
        }
Ejemplo n.º 5
0
        public int get_numbol(int numero_mesa)
        {
            BoletaBLL bolBLL = new BoletaBLL();

            return(bolBLL.get_num_boleta(numero_mesa));
        }
Ejemplo n.º 6
0
        public bool verificaAsignacion(int numero_mesa)
        {
            BoletaBLL bolBLL = new BoletaBLL();

            return(bolBLL.verf_asignacion(numero_mesa));
        }
Ejemplo n.º 7
0
        protected void Button5_Click(object sender, EventArgs e)
        {
            if (RadioButton2.Checked == true)
            {
                try
                {
                    if (Session["numero_boleta"] != null)
                    {
                        int numboleta = Int32.Parse(Session["numero_boleta"].ToString());

                        BoletaBLL bolBLL = new BoletaBLL();

                        int total = bolBLL.GetTotalBoleta(numboleta);
                        var monto = total;

                        bolBLL.actualizarBoleta(numboleta, total, total, "Transbank", "pagando");

                        var transaction = new Webpay(Configuration.ForTestingWebpayPlusNormal()).NormalTransaction;

                        var ordenid   = "" + numboleta;
                        var sessionid = "" + numboleta;

                        string returnurl = "http://*****:*****@"<body onload='document.forms[""form""].submit()'>");
                        sb.AppendFormat("<form name='form' action='{0}' method='post'>", formaction);
                        sb.AppendFormat("<input type='hidden' name='token_ws' value='{0}'>", tokenWs);
                        // Other params go here
                        sb.Append("</form>");
                        sb.Append("</body>");
                        sb.Append("</html>");

                        Response.Write(sb.ToString());

                        Response.End();
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }
            else if (RadioButton1.Checked == true)
            {
                if (Session["numero_boleta"] != null)
                {
                    int numboleta = Int32.Parse(Session["numero_boleta"].ToString());

                    BoletaBLL bolBLL = new BoletaBLL();

                    int total = bolBLL.GetTotalBoleta(numboleta);
                    var monto = total;

                    bolBLL.actualizarBoleta(numboleta, total, total, "Efectivo", "pagando");
                    Response.Redirect("/CarroCompras.aspx");
                }
            }
            else
            {
                string script = "alert('Porfavor Seleccione un Metodo de Pago');";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script, true);
            }
        }