Exemple #1
0
        private void CancelarPedido_Click(object sender, EventArgs e)
        {
            int resul = (int)MessageBox.Show(this, "Está seguro que desea cancelar la orden?", "Advertencia", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (resul == 6)
            {
                _Factura = null;
                Close();
            }
        }
Exemple #2
0
        private void btnSiguienteTab2_Click(object sender, EventArgs e)
        {
            // Obtener lista de pedido
            lista = new List <Producto>();
            var items = listaPedido.Items;

            foreach (var prod in items)
            {
                if (lista.Contains((Producto)prod))
                {
                    int i = lista.IndexOf((Producto)prod);
                    lista[i].Cantidad += 1;
                }
                else
                {
                    lista.Add((Producto)prod);
                    int i = lista.IndexOf((Producto)prod);
                    lista[i].Cantidad = 1;
                }
            }

            if (lista.Count > 0)
            {
                tabControl1.SelectedIndex = 2;

                // Crear Factura con Gestor
                _Factura = new GestorFactura();
                _Factura.AsignarNegocio(_Negocio);
                _Factura.AsignarCliente(MenuCliente._Cliente);
                _Factura.AsignarFecha(DateTime.Now);
                _Factura.AsignarEstadoFactura("Pendiente");
                _Factura.AsignarEstadoPedido("En espera");

                // Crear Pedido
                fPedido = new FacadePedido()
                {
                    ListaProductos = lista
                };

                // Asignar el pedido a la factura
                _Factura.AsignarPedido(fPedido);

                // Asignar valores a los textos de el panel con la iformacion del pedido
                txtCostoNormal.Text       = "¢" + fPedido.CostoSinCupones();
                txtImpuesto.Text          = "¢" + fPedido.ImpuestoVentas();
                txtCostoTotal.Text        = "¢" + _Factura.CostoTotal();
                txtCostoExpress.Text      = "¢" + _Factura.CostoExpress();
                txtCostoTotalDolares.Text = "$" + _Factura.CostoTotalDolares();
            }
            else
            {
                MessageBox.Show(this, "Debe agregar productos a la lista", "Agregue productos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
        protected void btnGenerarRemito_Click(object sender, EventArgs e)
        {
            //Generar remito (crear registro en tabla Remito)
            GridViewRow row       = (sender as Button).NamingContainer as GridViewRow;
            int         NroPedido = int.Parse(row.Cells[0].Text.Trim().ToString());

            var nroFactura = GestorFactura.ObtenerFactura(NroPedido);

            bool Generado = GestorRemito.Agregar(NroPedido, nroFactura, "Pendiente");

            if (Generado)
            {
                CargarDatos();
                Response.Write("<script>alert('El remito se ha generado correctamente')</script>");
            }
        }
        protected void confirmar_Click(object sender, EventArgs e)
        {
            string DetalleFC  = detalle.Text.Trim();
            string DetalleNC  = detalleNC.Text.Trim();
            var    NumFactura = Session["NroFactura"].ToString();
            var    importe    = Session["PrecioTotal"].ToString();

            GestorFactura.ModificarFactura(int.Parse(NumFactura), "Anulado", DetalleFC);

            bool Generado = GestorNC.AgregarNC(int.Parse(NumFactura), DetalleNC, importe, "");

            if (Generado)
            {
                Response.Write("<script>alert('Los cambios se guardaron correctamente')</script>");
            }
        }
        protected void btnFacturar_Click(object sender, EventArgs e)
        {
            //Generar factura (crear registro en tabla Factura)
            GridViewRow row         = (sender as Button).NamingContainer as GridViewRow;
            int         NroPedido   = int.Parse(row.Cells[0].Text.Trim().ToString());
            int         CodCliente  = int.Parse(row.Cells[2].Text.Trim().ToString());
            string      Descripcion = row.Cells[3].Text.Trim();
            string      PrecioTotal = row.Cells[4].Text.Trim();
            //int Cantidad = int.Parse(row.Cells[8].Text.Trim().ToString());



            bool Facturado = GestorFactura.Agregar(Descripcion, 1, PrecioTotal,
                                                   CodCliente, NroPedido);

            if (Facturado)
            {
                GestorNP.ModificarEstado(NroPedido, "Facturado");
                Response.Write("<script>alert('La factura se ha generado correctamente')</script>");
            }
            CargarDatos();
        }
Exemple #6
0
 public DataSet CargarDatos()
 {
     return(GestorFactura.ListarFacturasEmitidas());
 }