private void GetPresupuesto(Int32 CodPresupuesto) { cDetallePresupuesto det = new Clases.cDetallePresupuesto(); DataTable trdo = det.getJoyasxPresupuestoxVenta(CodPresupuesto); trdo = fun.TablaaMiles(trdo, "Precio"); trdo = fun.TablaaMiles(trdo, "SubTotal"); GrillaPresupuesto.DataSource = trdo; string Col = "0;0;15;40;15;15;15"; fun.AnchoColumnas(GrillaPresupuesto, Col); GetVendedor(CodPresupuesto); txtCodPresupuesto.Text = CodPresupuesto.ToString(); }
private void Agregar() { if (txtCodJoya.Text == "") { Mensaje("Debe ingresar una joya para continuar"); return; } if (txtPrecio.Text == "") { Mensaje("Debe ingresar un precio para continuar"); return; } // string Col = "CodPresupuesto;CodJoya;Nombre;Tipo;Cantidad;Precio"; string CodPresupuesto = "0"; Int32 CodJoya = Convert.ToInt32(txtCodJoya.Text); string Nombre = txtNombreJoya.Text; string Precio = "0"; string Tipo = cmbTipo.Text; string Cantidad = "1"; Double SubTotal = 0; if (txtCantidad.Text != "") { Cantidad = txtCantidad.Text; } if (txtPrecio.Text != "") { Precio = txtPrecio.Text; } SubTotal = Convert.ToDouble(Cantidad) * Convert.ToDouble(Precio); string val = CodPresupuesto + ";" + CodJoya + ";" + Nombre + ";" + Tipo; val = val + ";" + Cantidad + ";" + Precio; val = val + ";" + SubTotal.ToString(); tbDetalle = fun.AgregarFilas(tbDetalle, val); Grilla.DataSource = tbDetalle; fun.AnchoColumnas(Grilla, "0;0;30;25;15;15;15"); Double Total = fun.TotalizarColumna(tbDetalle, "SubTotal"); txtTotal.Text = Total.ToString(); txtCodigo.Text = ""; txtCodJoya.Text = ""; txtPrecio.Text = ""; txtCantidad.Text = ""; txtCodigoBarra.Text = ""; AgregaCodigoBarra = false; AgregaCodigoBarra2 = false; }
private void BuscarDocumentos(Int32 CodGrupo) { // cCuotasAnteriores cuota = new Clases.cCuotasAnteriores(); DataTable trdo = cuota.GetDocumentosAnterioresxCodigo(CodGrupo); if (trdo.Rows.Count > 0) { txtApellido.Text = trdo.Rows[0]["Apellido"].ToString(); txtNombre.Text = trdo.Rows[0]["Nombre"].ToString(); txtPatente.Text = trdo.Rows[0]["Patente"].ToString(); txtDescripcion.Text = trdo.Rows[0]["Descripcion"].ToString(); if (trdo.Rows[0]["CodMarca"].ToString() != "") { cmb_CodMarca.SelectedValue = trdo.Rows[0]["CodMarca"].ToString(); } txtTelefono.Text = trdo.Rows[0]["Telefono"].ToString(); txtDireccion.Text = trdo.Rows[0]["Direccion"].ToString(); } cFunciones fun = new cFunciones(); DataTable tplan = cuota.GetPlan(CodGrupo); tplan = fun.TablaaMiles(tplan, "Importe"); tplan = fun.TablaaMiles(tplan, "Saldo"); GrillaCuotas.DataSource = tplan; fun.AnchoColumnas(GrillaCuotas, "20;20;20;20;20"); btnGrabar.Visible = false; }
private void Buscar(DateTime FechaDesde, DateTime FechaHasta) { cCompra compra = new Clases.cCompra(); DataTable trdo = compra.GetComprasxFecha(FechaDesde, FechaHasta); Grilla.DataSource = trdo; fun.AnchoColumnas(Grilla, "0;50;50"); }
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() { cFunciones fun = new cFunciones(); DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); cPresupuesto pre = new Clases.cPresupuesto(); DataTable trdo = pre.GetPresupuestoxFecha(FechaDesde, FechaHasta); Grilla.DataSource = trdo; fun.AnchoColumnas(Grilla, "0;10;25;25;30;10"); }
private void Buscar() { cPresupuesto prep = new cPresupuesto(); DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); DataTable trdo = prep.GetPresupuesto(FechaDesde, FechaHasta); trdo = fun.TablaaMiles(trdo, "Total"); Grilla.DataSource = trdo; fun.AnchoColumnas(Grilla, "0;15;35;35;15"); }
private void Cargar(DateTime FechaDesde, DateTime FechaHasta, string Apellido) { cPresupuesto prep = new Clases.cPresupuesto(); DataTable trdo = prep.GetPresupuestoxFecha(FechaDesde, FechaHasta, Apellido); trdo = fun.TablaaMiles(trdo, "Total"); Grilla.DataSource = trdo; string Col = "0;15;35;35;15"; fun.AnchoColumnas(Grilla, Col); }
private void Buscar() { DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); cTransferencia tra = new cTransferencia(); DataTable trdo = tra.GetTransferencia(FechaDesde, FechaHasta); trdo = fun.TablaaMiles(trdo, "Importe"); trdo = fun.TablaaFechas(trdo, "FechaCobro"); Grilla.DataSource = trdo; fun.AnchoColumnas(Grilla, "0;30;30;20;20;0"); Grilla.Columns[3].HeaderText = "Fecha Cobro"; }
private void Agregar() { if (txtCodigo.Text == "") { Mensaje("Debe ingresar un articulo"); return; } if (txtCantidad.Text == "") { Mensaje("Debe ingresar una cantidad"); return; } if (txtPrecio.Text == "") { Mensaje("Debe ingresar un precio"); return; } string Codigo = txtCodigo.Text; if (fun.Buscar(tbCompra, "CodArticulo", Codigo) == true) { Mensaje("Ya se ha ingresado el articulo"); return; } string Nombre = txt_Nombre.Text; Int32 Cantidad = Convert.ToInt32(txtCantidad.Text); Double Precio = fun.ToDouble(txtPrecio.Text); Double Descuento = 0; if (txtDescuento.Text != "") { Descuento = fun.ToDouble(txtDescuento.Text); } Double SubTotal = Cantidad * Precio - Descuento; string Val = Codigo + ";" + Nombre; Val = Val + ";" + Cantidad.ToString(); Val = Val + ";" + Precio.ToString(); Val = Val + ";" + Descuento.ToString(); Val = Val + ";" + SubTotal; tbCompra = fun.AgregarFilas(tbCompra, Val); Grilla.DataSource = tbCompra; CalcularTotal(); LimpiarArticulo(); fun.AnchoColumnas(Grilla, "0;40;15;15;15;15"); }
private void Buscar() { DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); cCuentaCorriente cuenta = new cCuentaCorriente(); DataTable trdo = cuenta.GetCuentasxFecha(FechaDesde, FechaHasta); trdo = fun.TablaaMiles(trdo, "Importe"); Grilla.DataSource = trdo; string Col = "0;25;25;10;10;15;15"; fun.AnchoColumnas(Grilla, Col); Double Total = fun.TotalizarColumna(trdo, "Importe"); txtTotal.Text = Total.ToString(); }
private void CargarGrilla(string Nombre, string Codigo) { cFunciones fun = new cFunciones(); cJoya joya = new cJoya(); DataTable trdo = joya.GetJoyas(); // trdo = fun.TablaaMiles(trdo, "PrecioEfectivo"); Grilla.DataSource = trdo; //Grilla.Columns[0].Visible = false; fun.AnchoColumnas(Grilla, "0;10;35;35;10;10"); DataGridViewCellStyle style = new DataGridViewCellStyle(); style.Font = new Font(Grilla.Font, FontStyle.Bold); // Grilla.Columns[8].DefaultCellStyle = style; //Grilla.Rows[8].DefaultCellStyle = style; }
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 Buscar() { if (txtArticulo.Text == "") { Mensaje("Debe ingresar un art{iculo"); return; } string Nombre = txtArticulo.Text; cArticulo art = new Clases.cArticulo(); DataTable trdo = art.GetArticuloxNombre(Nombre); trdo = fun.TablaaMiles(trdo, "PorEfe"); trdo = fun.TablaaMiles(trdo, "PorTar"); trdo = fun.TablaaMiles(trdo, "Costo"); trdo = fun.TablaaMiles(trdo, "PrecioEfectivo"); trdo = fun.TablaaMiles(trdo, "PrecioTarjeta"); Grilla.DataSource = trdo; string Ancho = "0;0;0;40;10;10;10;10;10;10"; fun.AnchoColumnas(Grilla, Ancho); }
private void btnBuscar_Click(object sender, EventArgs e) { cFunciones fun = new cFunciones(); if (fun.ValidarFecha(txtFechaDesde.Text) == false) { Mensaje("La fecha desde es incorrecta"); return; } if (fun.ValidarFecha(txtFechaHasta.Text) == false) { Mensaje("La fecha Hasta es incorrecta"); return; } DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); CargarGrilla(FechaDesde, FechaHasta); string Col = "0;0;15;10;15;10;10;10;15;15"; fun.AnchoColumnas(Grilla, Col); }
public void Buscar(DateTime FechaDesde, DateTime FechaHasta) { string Mes = ""; string Anio = ""; int NumeroMes = 0; string Total = ""; string TotalComision = ""; string TotalRendido = ""; string Val = ""; string Col = "Mes;Anio;Total;TotalComision;TotalRendido"; DataTable tbResumen = fun.CrearTabla(Col); cVenta venta = new Clases.cVenta(); DataTable trdo = venta.GetResumenVentas(FechaDesde, FechaHasta); if (trdo.Rows.Count > 0) { for (int i = 0; i < trdo.Rows.Count; i++) { Val = ""; NumeroMes = Convert.ToInt32(trdo.Rows[i]["Mes"].ToString()); Mes = Getmes(NumeroMes); Anio = trdo.Rows[i]["Anio"].ToString(); Total = trdo.Rows[i]["Total"].ToString(); TotalComision = trdo.Rows[i]["TotalComision"].ToString(); TotalRendido = trdo.Rows[i]["TotalRendido"].ToString(); Val = Mes + ";" + Anio; Val = Val + ";" + Total + ";" + TotalComision + ";" + TotalRendido; tbResumen = fun.AgregarFilas(tbResumen, Val); } } if (tbResumen.Rows.Count > 0) { tbResumen = fun.TablaaMiles(tbResumen, "Total"); tbResumen = fun.TablaaMiles(tbResumen, "TotalComision"); tbResumen = fun.TablaaMiles(tbResumen, "TotalRendido"); } Double dTotal = fun.TotalizarColumna(tbResumen, "Total"); Double dTotalComision = fun.TotalizarColumna(tbResumen, "TotalComision"); Double dTotalRendido = fun.TotalizarColumna(tbResumen, "TotalRendido"); txtTotal.Text = dTotal.ToString(); txtTotalRendido.Text = dTotalRendido.ToString(); txtTotalComision.Text = dTotalComision.ToString(); Grilla.DataSource = tbResumen; if (txtTotal.Text != "") { txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text); } if (txtTotalComision.Text != "") { txtTotalComision.Text = fun.FormatoEnteroMiles(txtTotalComision.Text); } if (txtTotalRendido.Text != "") { txtTotalRendido.Text = fun.FormatoEnteroMiles(txtTotalRendido.Text); } string ancho = "30;10;20;20;20"; fun.AnchoColumnas(Grilla, ancho); Grilla.Columns[3].HeaderText = "Total Comisión"; Grilla.Columns[4].HeaderText = "Total Rendido"; }
private void Agregar() { if (txtCodigo.Text == "") { Mensaje("Debe ingresar un articulo"); return; } if (txtCantidad.Text == "") { Mensaje("Debe ingresar una cantidad"); return; } if (txtPrecio.Text == "") { Mensaje("Debe ingresar un precio"); return; } string Codigo = txtCodigo.Text; if (fun.Buscar(tbCompra, "CodArticulo", Codigo) == true) { Mensaje("Ya se ha ingresado el articulo"); return; } int Libreria = 0; string Nombre = ""; if (chkLibreria.Checked == true) { Nombre = txt_Nombre.Text; Libreria = 1; } else { Nombre = txtNombreJuguete.Text; Libreria = 0; } Int32 Cantidad = Convert.ToInt32(txtCantidad.Text); Double Precio = fun.ToDouble(txtPrecio.Text); Double Descuento = 0; Double Efectivo = 0; Double Tarjeta = 0; if (txtEfectivo.Text != "") { Efectivo = Convert.ToDouble(txtEfectivo.Text); } if (txtTarjeta.Text != "") { Tarjeta = Convert.ToDouble(txtTarjeta.Text); } Double PorEfe = 0; Double PorTar = 0; if (txtPorEfe.Text != "") { PorEfe = Convert.ToDouble(txtPorEfe.Text); } if (txtPorTar.Text != "") { PorTar = Convert.ToDouble(txtPorTar.Text); } Indice = Indice + 1; Double SubTotal = Cantidad * Precio; string Val = Codigo + ";" + Nombre; Val = Val + ";" + Cantidad.ToString(); Val = Val + ";" + Precio.ToString(); Val = Val + ";" + Descuento.ToString(); Val = Val + ";" + Efectivo.ToString().Replace(",", "."); Val = Val + ";" + Tarjeta.ToString().Replace(",", "."); Val = Val + ";" + SubTotal; Val = Val + ";" + Libreria; Val = Val + ";" + PorEfe; Val = Val + ";" + PorTar; Val = Val + ";" + Indice.ToString(); tbCompra = fun.AgregarFilas(tbCompra, Val); Grilla.DataSource = tbCompra; CalcularTotal(); LimpiarArticulo(); fun.AnchoColumnas(Grilla, "0;40;10;10;0;10;10;10;0;5;5;0"); txt_Codigo.Focus(); if (tbCompra.Rows.Count > 1) { Grilla.Sort(Grilla.Columns[11], ListSortDirection.Descending); } }