public void GuardarTest()
        {
            Factura.AgregarDetalle(4, 0, 0, 200m, 2, "Tennis", 0.18m);


            Assert.IsTrue(BLL.FacturaDetallesBLL.Guardar(Factura));
        }
Пример #2
0
        public void LlenarDatos(Entidades.FacturaDetalles detalle)
        {
            int id        = 0;
            int idCliente = 0;
            int cantidad  = 0;

            idCliente = Utilidades.TOINT(DropDownCliente.Text);
            var clientec = BLL.ClientesBLL.Buscar(p => p.ClienteId == idCliente);

            if (facturaG != null)
            {
                id = facturaG.IdFactura;
            }

            foreach (GridViewRow dr in FacturaGrid.Rows)
            {
                detalle.AgregarDetalle(Convert.ToInt32(dr.Cells[0].Text), 0, 0,
                                       Convert.ToDecimal(dr.Cells[1].Text), Convert.ToInt32(dr.Cells[2].Text), Convert.ToString(dr.Cells[3].Text), Convert.ToDecimal(dr.Cells[4].Text)
                                       );
                cantidad++;
                BotonCalcularDevuelta.Focus();
                CalcularMonto();
            }

            if (TextBoxTotal.Text == "" && TextBoxSubTotal.Text == "")
            {
                CalcularMonto();
            }
            else
            {
                if (clientec != null)
                {
                    facturaG = new Entidades.Facturas(0, Base.Usuario, DateTime.Now, clientec.Nombres, DropDownTipoVenta.Text, cantidad, Convert.ToDecimal(TextBoxTotal.Text));
                }
                else
                {
                    Utilidades.ShowToastr(this, "Error cliente vacio", "error");
                }
            }
        }