Example #1
0
        public static string GenerarNroVenta()
        {
            string resultado = "";

            resultado = VentaLN.GetInstance().GenerarNroVenta();

            return(resultado);
        }
Example #2
0
        public static string RegistrarVenta(string _Codventa, string _FecVenta, decimal _Igv, decimal _Total)
        {
            string usuario   = HttpContext.Current.Session["usuario"].ToString();
            bool   resultado = false;

            Venta venta = new Venta()
            {
                CodVenta = _Codventa,
                FecVenta = _FecVenta,
                Igv      = _Igv,
                Total    = _Total,
                Usuario  = new Usuario()
                {
                    Username = usuario
                }
            };

            resultado = VentaLN.GetInstance().RegistrarVenta(venta);

            return(resultado == true ? "Correcto" : "Incorrecto");
        }
Example #3
0
        public static string RegistrarDetalleVenta(decimal _precio, int _cantidad, decimal _subtotal, string _codmedicamento, string _codventa)
        {
            bool         resultado = false;
            DetalleVenta detalle   = new DetalleVenta()
            {
                Precio      = _precio,
                Cantidad    = _cantidad,
                Subtotal    = _subtotal,
                Medicamento = new Medicamento()
                {
                    CodMedicamento = _codmedicamento
                },
                Venta = new Venta()
                {
                    CodVenta = _codventa
                }
            };

            resultado = VentaLN.GetInstance().RegistrarDetalleVenta(detalle);

            return(resultado == true ? "Correcto" : "Incorrecto");
        }