private void BuscarVenta(DateTime FechaDesde, DateTime FechaHasta) { cFunciones fun = new cFunciones(); cVentaJoya venta = new Clases.cVentaJoya(); DataTable trdo = venta.GetVentasxFecha(FechaDesde, FechaHasta); Grilla.DataSource = trdo; fun.AnchoColumnas(Grilla, "0;10;45;45"); }
private void Buscar(DateTime FechaDesde, DateTime FechaHasta, Int32?CodTipo) { cVentaJoya venta = new Clases.cVentaJoya(); DataTable trdo = venta.GetResumenVentasxFecha(FechaDesde, FechaHasta, CodTipo); trdo = fun.TablaaMiles(trdo, "Total"); Double Total = fun.TotalizarColumna(trdo, "Total"); Grilla.DataSource = trdo; fun.AnchoColumnas(Grilla, "60;20;20"); txtTotal.Text = Total.ToString(); if (txtTotal.Text != "") { txtTotal.Text = fun.SepararDecimales(txtTotal.Text); txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text); } }
private void BuscarVenta(Int32 CodVenta) { //GetPresupuesto cVentaJoya Venta = new Clases.cVentaJoya(); DataTable trdo = Venta.GetVentaxCodVenta(CodVenta); if (trdo.Rows.Count > 0) { Int32 CodPresupuesto = Convert.ToInt32(trdo.Rows[0]["CodPresupuesto"].ToString()); GetPresupuesto(CodPresupuesto); txtCodVendedor.Text = trdo.Rows[0]["CodVendedor"].ToString(); txtNombre.Text = trdo.Rows[0]["Nombre"].ToString(); string Val = ""; txtApellido.Text = trdo.Rows[0]["Apellido"].ToString(); for (int i = 0; i < trdo.Rows.Count; i++) { string CodRegistro = trdo.Rows[i]["CodRegistro"].ToString(); string CodJoya = trdo.Rows[i]["CodJoya"].ToString(); string Codigo = trdo.Rows[i]["Codigo"].ToString(); string Nombre = trdo.Rows[i]["Nombre1"].ToString(); string Precio = trdo.Rows[i]["Precio"].ToString(); string Cantidad = trdo.Rows[i]["Cantidad"].ToString(); string Comision = trdo.Rows[i]["Comision"].ToString(); string SubTotal = trdo.Rows[i]["SubTotal"].ToString(); Val = CodRegistro + ";" + CodJoya + ";" + Codigo; Val = Val + ";" + Nombre + ";" + Cantidad + ";" + Precio + ";" + Comision + ";" + SubTotal; tbVenta = fun.AgregarFilas(tbVenta, Val); } tbVenta = fun.TablaaMiles(tbVenta, "SubTotal"); tbVenta = fun.TablaaMiles(tbVenta, "Precio"); tbVenta = fun.TablaaMiles(tbVenta, "Comision"); GrillaVentas.DataSource = tbVenta; string Col = "0;0;15;25;15;15;15;15"; fun.AnchoColumnas(GrillaVentas, Col); btnGrabar.Enabled = false; btnCancelar.Enabled = false; CalcularTotal(); } }