protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { dt = new DataTable(); dt.Columns.Add("Codigo"); dt.Columns.Add("Descripcion"); dt.Columns.Add("Precio"); dt.Columns.Add("Cantidad"); dt.Columns.Add("Total_Producto"); BL_Factura fact = new BL_Factura(); fact.Codigo = DropDownList2.SelectedValue; fact.ListaProductos = new List <BL_Producto>(); fact.selectAFactura(); if (DropDownList2.Text != "Seleccionar") { foreach (var prod in fact.ListaProductos) { DataRow row = dt.NewRow(); row["Codigo"] = prod.Codigo; row["Precio"] = prod.Precio; row["Cantidad"] = prod.Cantidad_En_Factura; row["Descripcion"] = prod.Descripcion; row["Total_Producto"] = (prod.Precio * prod.Cantidad_En_Factura); dt.Rows.Add(row); } ViewState["DataTable"] = dt; refreshGrid(); TextBox3.Text = calcularTotal().ToString(); } }
public PlantillaConfig() { InitializeComponent(); factLogica = new BL_Factura(); fillPlantilla(); rellenarTextos(); }
//private void mostrarClientes() { // BL_Cliente clientes = new BL_Cliente(); //List<DO_Cliente> listaClientes = clientes.obtenerListaClientes(); //listBClientes.DataSource = listaClientes; //listBClientes.DisplayMember = "nombre"; //listBClientes.ValueMember = "id"; // } private void btnPagar_Click(object sender, EventArgs e) { this.factura.clienteExterno = ""; this.factura.notas = this.txtNotas.Text; this.factura.estado = "PENDIENTE"; this.factura.tipoPago = "CREDITO"; BL_Factura blFactura = new BL_Factura(); blFactura.guardarFacturaCredito(factura, Convert.ToInt32(listBClientes.SelectedValue.ToString())); FacturaCredito factCred = new FacturaCredito( factura.usuario, factura.totalFactura.ToString(), lbCreditoDisp.Text, factura.listaProducto, txtNotas.Text, listBClientes.Text, lbCreditoAnterior.Text); parent.facturaCreditoTemp = factCred; parent.facturaContadoRealizada = false; parent.facturaCreditoRealizada = true; MessageBox.Show("Pago exitoso"); parent.cerrarTicket(); this.Dispose(); }
protected void btnAddFactura_Click(object sender, EventArgs e) { try { if (txtCodigo.Text.Trim() != "" && ddlClientes.SelectedValue.Trim() != "Seleccionar") { BL_Factura factura = new BL_Factura(); factura.Codigo = txtCodigo.Text; factura.Cedula_Cliente = ddlClientes.SelectedValue; factura.ListaProductos = new List <BL_Producto>(); foreach (DataRow dRow in dt.Rows) { BL_Producto blProd = new BL_Producto(); blProd.Codigo = (String)dRow["Codigo"]; blProd.Cantidad_En_Factura = Convert.ToInt16(dRow["Cantidad"]); factura.ListaProductos.Add(blProd); } factura.addFactura(); } } catch (Exception) { lblError.Text = "Ese codigo de factura ya existe"; } }
private void btnFiltrar_Click(object sender, EventArgs e) { DateTime fechaReporteDesde = new DateTime(calReporteDesde.SelectionStart.Year, calReporteDesde.SelectionStart.Month, calReporteDesde.SelectionStart.Day); DateTime fechaReporteHasta = new DateTime(calReporteHasta.SelectionStart.Year, calReporteHasta.SelectionStart.Month, calReporteHasta.SelectionStart.Day); this.lblTitulo.Text = "Reporte del " + fechaReporteDesde.Day + "/" + fechaReporteDesde.Month + "/" + fechaReporteDesde.Year + " Hasta el " + fechaReporteHasta.Day + "/" + fechaReporteHasta.Month + "/" + fechaReporteHasta.Year; this.lblCorte.Text = "Corte del " + fechaReporteDesde.Day + "/" + fechaReporteDesde.Month + "/" + fechaReporteDesde.Year; this.lblHasta.Text = "Hasta el " + fechaReporteHasta.Day + "/" + fechaReporteHasta.Month + "/" + fechaReporteHasta.Year; String inicio = "" + fechaReporteDesde.Year + "-" + fechaReporteDesde.Month + "-" + fechaReporteDesde.Day + " 0:00:00"; String final = "" + fechaReporteHasta.Year + "-" + fechaReporteHasta.Month + "-" + fechaReporteHasta.Day + " 23:59:59"; lbFechaReporte.Text = "" + fechaReporteDesde.Day + "/" + fechaReporteDesde.Month + "/" + fechaReporteDesde.Year; //La parte de Ventas BL_Factura blFactura = new BL_Factura(); BL_Pago blPago = new BL_Pago(); int totalVentasEfectivo = blFactura.obtenerTotalVentasEfectivoDiaEspecifico(inicio, final); lbEnEfectivoVentas.Text = "₡" + totalVentasEfectivo; int totalVentasCredito = blFactura.obtenerTotalVentasCreditoDiaEspecifico(inicio, final); lbACreditoVentas.Text = "₡" + totalVentasCredito; int totalVentas = totalVentasEfectivo + totalVentasCredito; lbTotalVentas.Text = "₡" + totalVentas; //La parte de Entradas lbEfectivoEntradas.Text = "₡" + blFactura.obtenerTotalVentasEfectivoDiaEspecifico(inicio, final); int totalAbonosCredito = blFactura.obtenerAbonosCredito(inicio, final); lbCreditoEntradas.Text = "₡" + totalAbonosCredito; //La parte de proveedores int totalPagoProve = blPago.obtenerPagoProvDiaEspecifico(inicio, final); lbTotalAgentes.Text = "₡" + totalPagoProve; //La parte de productos más vendidos BL_Producto blProductos = new BL_Producto(); List <DO_TopProductos> topVentas = blProductos.obtenerTopVentas(inicio, final); asignarLabelsTopVentas(topVentas.Count, topVentas); //Lo de Caja lbTotalCaja.Text = "₡ " + (totalVentasEfectivo + totalAbonosCredito - totalPagoProve); filtrado = true; }
private void inicializarStrings() { BL_Factura blFactura = new BL_Factura(); DO_PlantillaFactura plantilla = blFactura.obtenerPlantillaFactura(); nombreLocal = plantilla.nombreEmpresa; direccion = plantilla.direccion; ced = plantilla.cedula; telefono = plantilla.numeroTelefono; }
public void registrarFactura() { this.factura.clienteExterno = this.txtCliente.Text; this.factura.notas = this.txtNotas.Text; this.factura.estado = "PAGADA"; this.factura.tipoPago = "CONTADO"; BL_Factura blFactura = new BL_Factura(); blFactura.guardarFactura(factura); MessageBox.Show("Pago exitoso"); }
private void cambioValor() { BL_Factura blFactura = new BL_Factura(); double total = blFactura.CalcularVuelto(Convert.ToDouble(lblTotal.Text), Convert.ToDouble(nmPaga.Value)); if (total < 0) { lblVuelto.ForeColor = Color.Red; } else { lblVuelto.ForeColor = Color.White; } lblVuelto.Text = total.ToString(); }
private void btnPagar_Click(object sender, EventArgs e) { if (txtAbono.Text == "") { MessageBox.Show("No ha ingresado un monto para abonar"); } else { BL_Factura blFactura = new BL_Factura(); blFactura.abonarFactura(doFactura, Convert.ToDouble(txtAbono.Text)); estCuenta.refrescarCreditoCompleto(); estCuenta.llenarGrid(); MessageBox.Show("Abono exitoso"); this.Dispose(); } }