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 FrmVenta_Load(object sender, EventArgs e) { // insert into cliente(apellido, nombre, clientenulo) //values('', '', 1) Principal.CodigoSenia = "1"; fun = new Clases.cFunciones(); Inicializar(); LlenarComboArticulo(); if (Principal.CodigoPrincipalAbm != null) { if (Principal.CodigoPrincipalAbm != "") { Int32 CodVenta = Convert.ToInt32(Principal.CodigoPrincipalAbm); BuscarVenta(CodVenta); } } if (Principal.CodigodePresupuesto != null) { Int32 CodPresupuesto = Convert.ToInt32(Principal.CodigodePresupuesto); BuscarPresupuesto(CodPresupuesto); } Cargando = false; txtNroDocumento.Focus(); }
private void btnEliminar_Click(object sender, EventArgs e) { string msj = "Confirma eliminar el artículo "; var result = MessageBox.Show(msj, "Información", MessageBoxButtons.YesNo, MessageBoxIcon.Question); // If the no button was pressed ... if (result == DialogResult.No) { return; } try { cFunciones fun = new cFunciones(); fun.EliminarGenerico("Articulo", "CodArticulo", txtCodigo.Text); fun.LimpiarGenerico(this); Botonera(1); MessageBox.Show("Datos borrados correctamente"); } catch (Exception) { MessageBox.Show("No se puede eliminar el producto, debe tener asociado ventas"); return; } }
private void CargarGrilla() { cFunciones fun = new cFunciones(); DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); Int32? CodTarjeta = null; if (cmbTarjeta.SelectedIndex > 0) { CodTarjeta = Convert.ToInt32(cmbTarjeta.SelectedValue); } string Patente = txtPatente.Text; cTarjeta tarj = new cTarjeta(); DataTable trdo = tarj.GetVentaxTarjeta(FechaDesde, FechaHasta, CodTarjeta, Patente); Double Total = fun.TotalizarColumna(trdo, "Importe"); trdo = fun.TablaaMiles(trdo, "Importe"); trdo = fun.TablaaMiles(trdo, "Saldo"); Grilla.DataSource = trdo; Grilla.Columns[0].Visible = false; Grilla.Columns[1].Visible = false; Grilla.Columns[3].Width = 250; Grilla.Columns[5].Width = 250; Grilla.Columns[4].Width = 130; Grilla.Columns[6].Width = 120; txtTotal.Text = Total.ToString(); txtTotal.Text = fun.SepararDecimales(txtTotal.Text); txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text); }
private void LlenarComboArticulo() { cFunciones fun = new cFunciones(); cArticulo art = new cArticulo(); // DataTable trdo = art.GetTodosArticulos(); DataTable trdo = art.GetTodosArticulosJuguetes(); txt_Nombre.DataSource = trdo; txt_Nombre.ValueMember = "CodArticulo"; txt_Nombre.DisplayMember = "Nombre"; AutoCompleteStringCollection coleccion = new AutoCompleteStringCollection(); foreach (DataRow r in trdo.Rows) { coleccion.Add(r["Nombre"].ToString()); } /* * cJuguete jug = new cJuguete(); * DataTable tbJuguete = jug.GetTodosJuguetes(); * foreach (DataRow r in tbJuguete.Rows) * { * coleccion.Add(r["Nombre"].ToString()); * } */ txt_Nombre.AutoCompleteCustomSource = coleccion; txt_Nombre.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txt_Nombre.AutoCompleteSource = AutoCompleteSource.CustomSource; txt_Nombre.SelectedIndex = -1; }
public FrmCobroDocumentos() { InitializeComponent(); fun = new cFunciones(); tabla = new cTabla(); txtFecha.Text = DateTime.Now.ToShortDateString(); }
public FrmAbmCiudad() { InitializeComponent(); cFunciones func = new cFunciones(); func.LlenarCombo(cmb_CodProvincia, "Provincia", "Nombre", "CodProvincia"); }
private void CargarCiudadxBarrio(Int32 CodBarrio) { if (CodBarrio > 0) { cBarrio barrio = new cBarrio(); DataTable tbBarrio = barrio.GetBarrioxId(CodBarrio); if (tbBarrio.Rows.Count > 0) { if (tbBarrio.Rows[0]["CodCiudad"].ToString() != "") { Int32 CodCiudad = Convert.ToInt32(tbBarrio.Rows[0]["CodCiudad"].ToString()); cCiudad objCiudad = new cCiudad(); DataTable tbCiudad = objCiudad.GetCiudadxId(CodCiudad); if (tbCiudad.Rows.Count > 0) { if (tbCiudad.Rows[0]["CodProvincia"].ToString() != "") { Int32 CodProvincia = Convert.ToInt32(tbCiudad.Rows[0]["CodProvincia"].ToString()); cmbProvincia2.SelectedValue = CodProvincia.ToString(); DataTable trCiudad = objCiudad.GetCiudadxCodProvincia(CodProvincia); cFunciones fun = new cFunciones(); fun.LlenarComboDatatable(cmbCiudad2, trCiudad, "Nombre", "CodCiudad"); cmbCiudad2.SelectedValue = CodCiudad.ToString(); cmb_CodBarrio.SelectedValue = CodBarrio.ToString(); } } } } } }
private void BuscarPapeles(Int32 CodCompra) { cPapeles papel = new Clases.cPapeles(); DataTable trdo = papel.GetPapelesxCodCompra(CodCompra); if (trdo.Rows.Count > 0) { string CodPapel = ""; string Nombre = ""; string Texto = ""; string Entrego = ""; string Fecha = ""; string FechaVencimiento = ""; string Val = ""; cFunciones fun = new cFunciones(); for (int i = 0; i < trdo.Rows.Count; i++) { CodPapel = trdo.Rows[i]["CodPapel"].ToString(); Nombre = trdo.Rows[i]["Nombre"].ToString(); Texto = trdo.Rows[i]["Texto"].ToString(); Entrego = trdo.Rows[i]["Entrego"].ToString(); Fecha = trdo.Rows[i]["Fecha"].ToString(); FechaVencimiento = trdo.Rows[i]["FechaVencimiento"].ToString(); Val = CodPapel + ";" + Nombre; Val = Val + ";" + Texto + ";" + Entrego; Val = Val + ";" + Fecha + ";" + FechaVencimiento; tbListaPapeles = fun.AgregarFilas(tbListaPapeles, Val); } GrillaPapeles.DataSource = tbListaPapeles; GrillaPapeles.Columns[0].Visible = false; } }
private void txt_Codigo_TextChanged(object sender, EventArgs e) { string Codigo = txt_Codigo.Text; cJoya joya = new cJoya(); if (Codigo.Length > 2) { DataTable trdo = joya.GetJoyaxCodigo(Codigo); if (trdo.Rows.Count > 0) { txt_Codigo.Text = trdo.Rows[0]["Codigo"].ToString(); txtCodigo.Text = trdo.Rows[0]["CodJoya"].ToString(); txt_Nombre.Text = trdo.Rows[0]["Nombre"].ToString(); txt_Stock.Text = trdo.Rows[0]["Stock"].ToString(); txt_PrecioVenta.Text = trdo.Rows[0]["PrecioVenta"].ToString(); if (trdo.Rows[0]["CodTipo"].ToString() != "") { { cmb_CodTipo.SelectedValue = trdo.Rows[0]["CodTipo"].ToString(); } if (txt_PrecioVenta.Text != "") { cFunciones fun = new cFunciones(); Double PrecioVenta = Convert.ToDouble(txt_PrecioVenta.Text.Replace(".", ",")); txt_PrecioVenta.Text = Math.Round(PrecioVenta, 0).ToString(); txt_PrecioVenta.Text = fun.SepararDecimales(txt_PrecioVenta.Text); txt_PrecioVenta.Text = fun.FormatoEnteroMiles(txt_PrecioVenta.Text); } } } } }
private void GrabarPapelesxStock(SqlConnection con, SqlTransaction Transaccion, Int32 CodCompra, Int32 CodStock) { int i = 0; Int32 CodPapel = 0; string Entrego = ""; string Texto = ""; DateTime? Fecha = null; DateTime? FechaVencimiento = null; cFunciones fun = new cFunciones(); cPapeles papel = new cPapeles(); for (i = 0; i < tbListaPapeles.Rows.Count; i++) { CodPapel = Convert.ToInt32(tbListaPapeles.Rows[i]["CodPapel"]); Entrego = tbListaPapeles.Rows[i]["Entrego"].ToString(); Texto = tbListaPapeles.Rows[i]["Texto"].ToString(); if (fun.ValidarFecha(tbListaPapeles.Rows[i]["Fecha"].ToString()) == true) { Fecha = Convert.ToDateTime(tbListaPapeles.Rows[i]["Fecha"].ToString()); } if (fun.ValidarFecha(tbListaPapeles.Rows[i]["FechaVencimiento"].ToString()) == true) { FechaVencimiento = Convert.ToDateTime(tbListaPapeles.Rows[i]["FechaVencimiento"].ToString()); } papel.InsertarPapeles(con, Transaccion, CodPapel, CodStock, Entrego, Texto, Fecha, FechaVencimiento, CodCompra); } }
private void FrmIngreso_Load(object sender, EventArgs e) { cFunciones fun = new cFunciones(); fun.LlenarCombo(CmbTipoPrenda, "TipoPrenda", "Nombre", "CodTipoPrenda"); fun.LlenarCombo(cmbColor, "Color", "Nombre", "CodColor"); fun.LlenarCombo(cmbOrigen, "Origen", "Nombre", "CodOrigen"); }
private void FrmActualizarLibreria_Load(object sender, EventArgs e) { fun = new cFunciones(); CargarPorcentajes(); string texto = "Aplicar a todos el " + txtPorEfe.Text; texto = texto + " y " + txtPorTar.Text; chkIncluyeTodos.Text = texto; }
private void FrmAbmArticulocs_Load(object sender, EventArgs e) { Botonera(1); Grupo.Enabled = false; cFunciones fun = new cFunciones(); CargarPorcentajes(); //txtM_Fecha.Text = DateTime.Now.ToShortDateString(); }
private void txt_CodigoBarra_TextChanged(object sender, EventArgs e) { cFunciones fun = new cFunciones(); if (txt_CodigoBarra.Text.Length > 5) { string CodigoBarra = txt_CodigoBarra.Text; cJuguete art = new Clases.cJuguete(); DataTable trdo = art.GetJuguetexCodBarra(CodigoBarra); if (trdo.Rows.Count > 0) { if (trdo.Rows[0]["CodArticulo"].ToString() != "") { txtCodigo.Text = trdo.Rows[0]["CodArticulo"].ToString(); txt_Nombre.Text = trdo.Rows[0]["Nombre"].ToString(); txt_CodigoBarra.Text = trdo.Rows[0]["CodigoBarra"].ToString(); txt_Codigo.Text = trdo.Rows[0]["Codigo"].ToString(); txt_Stock.Text = trdo.Rows[0]["Stock"].ToString(); txt_Costo.Text = trdo.Rows[0]["Costo"].ToString(); txt_PrecioEfectivo.Text = trdo.Rows[0]["PrecioEfectivo"].ToString(); txt_PrecioTarjeta.Text = trdo.Rows[0]["PrecioTarjeta"].ToString(); txt_PorEfe.Text = trdo.Rows[0]["PorEfe"].ToString(); txt_PorTar.Text = trdo.Rows[0]["PorTar"].ToString(); if (txt_PorEfe.Text != "") { txt_PorEfe.Text = fun.SepararDecimales(txt_PorEfe.Text); } if (txt_PorTar.Text != "") { txt_PorTar.Text = fun.SepararDecimales(txt_PorTar.Text); } } } else {/* * txtCodigo.Text = ""; * txt_Nombre.Text = ""; * txt_Stock.Text = ""; * txt_Costo.Text = ""; * txt_PrecioEfectivo.Text = ""; * txt_PrecioTarjeta.Text = ""; * txt_Codigo.Text = "";*/ } } if (txt_PrecioEfectivo.Text != "") { Double Efectivo = Convert.ToDouble(txt_PrecioEfectivo.Text.Replace(".", ",")); txt_PrecioEfectivo.Text = Math.Round(Efectivo, 0).ToString(); } if (txt_PrecioTarjeta.Text != "") { Double Efectivo = Convert.ToDouble(txt_PrecioTarjeta.Text.Replace(".", ",")); txt_PrecioTarjeta.Text = Math.Round(Efectivo, 0).ToString(); } }
private void FrmResumenVentas_Load(object sender, EventArgs e) { fun = new Clases.cFunciones(); DateTime Fecha = DateTime.Now; txtFechaHasta.Text = Fecha.ToShortDateString(); Fecha = Fecha.AddMonths(-1); txtFechaDesde.Text = Fecha.ToShortDateString(); }
private void FrmCompra_Load(object sender, EventArgs e) { fun = new Clases.cFunciones(); string Col = "CodArticulo;Nombre;Cantidad;Precio;Descuento;Subtotal"; tbCompra = fun.CrearTabla(Col); LlenarComboArticulo(); // (2x +4)/10 =4 }
private void FrmListadoCompras_Load(object sender, EventArgs e) { fun = new cFunciones(); DateTime fecha = DateTime.Now; txtFechaHasta.Text = fecha.ToShortDateString(); fecha = fecha.AddMonths(-1); txtFechaDesde.Text = fecha.ToShortDateString(); }
private void FrmCobroCheque_Load(object sender, EventArgs e) { fun = new cFunciones(); tabla = new cTabla(); if (frmPrincipal.CodigoPrincipal != null) { Buscar(Convert.ToInt32(frmPrincipal.CodigoPrincipal)); } }
private void CargarOpciones() { cFunciones fun = new cFunciones(); DataTable tb = fun.CrearTabla("CodOpcion;Opcion"); tb = fun.AgregarFilas(tb, "1;Comprador"); tb = fun.AgregarFilas(tb, "2;Vendedor"); fun.LlenarComboDatatable(cmbOpciones, tb, "Opcion", "CodOpcion"); }
private void FrmAbmArticulocs_Load(object sender, EventArgs e) { Botonera(1); Grupo.Enabled = false; cFunciones fun = new cFunciones(); fun.LlenarCombo(cmb_CodTipo, "Tipo", "Nombre", "CodTipo"); //txtM_Fecha.Text = DateTime.Now.ToShortDateString(); }
private void txtPrecioHasta_Leave(object sender, EventArgs e) { cFunciones fun = new cFunciones(); if (txtPrecioHasta.Text != "") { txtPrecioHasta.Text = fun.FormatoEnteroMiles(txtPrecioHasta.Text); } }
private void FrmPagoGarantia_Load(object sender, EventArgs e) { fun = new cFunciones(); txtCodGarantia.Text = frmPrincipal.CodigoPrincipal.ToString(); if (txtCodGarantia.Text != "") { Buscar(Convert.ToInt32(txtCodGarantia.Text)); } }
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 FrmCobroCheque2_Load(object sender, EventArgs e) { cFunciones fun = new cFunciones(); fun.LlenarCombo(cmbBanco, "Banco", "Nombre", "CodBanco"); if (Principal.CodigoPrincipalAbm != "") { GetCheque(Convert.ToInt32(Principal.CodigoPrincipalAbm)); } }
private void FrmListadoTransferencia_Load(object sender, EventArgs e) { fun = new Clases.cFunciones(); DateTime Fecha = DateTime.Now; txtFechaHasta.Text = Fecha.ToShortDateString(); txtFechaCobro.Text = Fecha.ToShortDateString(); Fecha = Fecha.AddMonths(-1); txtFechaDesde.Text = Fecha.ToShortDateString(); }
private void FrmRegistroCargo_Load(object sender, EventArgs e) { fun = new Clases.cFunciones(); CargarMateria(); DateTime Hoy = DateTime.Now; txtFechaDesde.Text = Hoy.ToShortDateString(); Hoy = Hoy.AddMonths(1); txtFechaHasta.Text = Hoy.ToShortDateString(); }
private void FrmListadoGastosGenerales_Load(object sender, EventArgs e) { fun = new cFunciones(); tabla = new cTabla(); DateTime fechahoy = DateTime.Now; txtFechaHasta.Text = fechahoy.ToShortDateString(); fechahoy = fechahoy.AddMonths(-1); txtFechaDesde.Text = fechahoy.ToShortDateString(); }