Example #1
0
        /*para buscar el id de la factura*/

        public int idfac()
        {
            controlador.CrudFactura fac = new controlador.CrudFactura();
            fac.idFactura(this.numeroFact);

            return(fac.Idfac);
        }
Example #2
0
        /*para aser la devolucion total de la factura*/
        public void devolucionTotal()
        {
            controlador.CrudFactura fact = new controlador.CrudFactura();

            if (fact.devolucionTotal(this.idUser).Equals(true))
            {
                this.mensaje = "Devolucion correcta";
            }
            else
            {
                this.mensaje = "No se  iso la Devolucion";
            }
        }
Example #3
0
        /*para crear el detalle de la factura*/

        public Boolean inserDetalle(int id)
        {
            Boolean a = false;


            controlador.CrudFactura fac = new controlador.CrudFactura();
            fac.Idfac = id;
            for (int i = 0; i < idproducto.Count; i++)
            {
                a = fac.inserDetalle(precioVenta[i], cantidad[i], descuento[i], totalproducto[i], idproducto[i]);
            }
            return(a);
        }
Example #4
0
        /*para insertar el encabezado de la factura*/
        public void insertEncabezado()
        {
            controlador.CrudFactura fac = new controlador.CrudFactura();

            if (fac.inserEncabezado(this.idCliente, this.numeroFact, this.idUser, this.tipo, this.subTotal, this.Iva, this.Total).Equals(true))
            {
                int id = idfac();
                if (inserDetalle(id).Equals(true))
                {
                    this.mensaje = "Factura Guardada";
                }
                else
                {
                    this.mensaje = "Detalle de la Factura No se pudo Guardar";
                }
            }
            else
            {
                this.mensaje = "No se  insertar la Factura";
            }
        }
Example #5
0
 public void cambioTotal()
 {
     controlador.FacClienselect f = new controlador.FacClienselect();
     if (f.cambioTotalFact(this.Sub, this.iva, this.total, this.idfactura).Equals(true))
     {
         controlador.CrudFactura f2 = new controlador.CrudFactura();
         f2.Idfac = this.idfactura;
         if (f2.inserDetalle(this.precioVenta, this.cantidad, this.descuento, this.totalproducto, this.idproducto).Equals(true))
         {
             this.msg = "Producto agregado";
         }
         else
         {
             this.msg = "No se Agrego detalle";
         }
     }
     else
     {
         this.msg = "No se Agrego";
     }
 }