private void dgtipoGasto_DoubleClick(object sender, EventArgs e) { ETipGasto tg = new ETipGasto(); tg.Id_tipogsto = dgtipoGasto.CurrentRow.Cells["Codigo"].Value.ToString(); tg.Ds_tipogsto = dgtipoGasto.CurrentRow.Cells["Descripcion"].Value.ToString(); pasard(tg); this.Dispose(); }
private void BusquedaTGasto() { ETipGasto tg = new ETipGasto(); tg.Id_tipogsto = txtCodigo.Text; tg.Ds_tipogsto = txtdes.Text; DataSet ds = BTipGasto.TipoGasto_qry01(tg); dgtipogasto.DataSource = ds.Tables[0]; lblRow_total.Text = Convert.ToInt16(dgtipogasto.RowCount).ToString(); //-1 }
public static List<Dato> ObtenerDatoTg(string commandtext, string par1, string par2, ETipGasto tg) { List<Dato> _lista = new List<Dato>(); DBAccess db = new DBAccess(); db.AddParameter("@idEmpresa", tg.Id_empresa); db.AddParameter("@idunegocio", tg.Id_unegocio); db.AddParameter("@idCCosto", tg.Id_ccosto); IDataReader reader = db.ExecuteReader(commandtext); while (reader.Read()) { Dato _dato = new Dato(); _dato.id = reader[par1].ToString(); _dato.desc = reader[par2].ToString(); _lista.Add(_dato); } return _lista; }
public static ETipGasto mListarTipoGasto(ETipGasto etg) { DBAccess db = new DBAccess(); db.AddParameter("@codigo", etg.Id_tipogsto); db.AddParameter("@Descrip", etg.Ds_tipogsto); List<ETerceros> result = new List<ETerceros>(); using (IDataReader rd = db.ExecuteReader("MG_TipoGasto_Qry01")) { while (rd.Read()) { return mCargarTipoGasto(rd); } } return etg; }
private void dgtipogasto_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (lblRow_total.Text == "0") { MessageBox.Show("No hay registros", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); txtdes.Focus(); } else { ETipGasto tg = new ETipGasto(); tg.Id_tipogsto = dgtipogasto.CurrentRow.Cells["Codigo"].Value.ToString(); tg.Ds_tipogsto = dgtipogasto.CurrentRow.Cells["Descripcion"].Value.ToString(); pasard(tg); this.Dispose(); e.SuppressKeyPress = true; } } }
public void ejecutarTGasto(ETipGasto tg) { txtidtg_pop.Text = tg.Id_tipogsto; txtdstg_pop.Text = tg.Ds_tipogsto; }
private void ListarTipoGasto() { try { ETipGasto tg = new ETipGasto(); tg.Id_tipogsto = txtCodigo.Text; tg.Ds_tipogsto = txtTg.Text; DataSet ds = BTipGasto.TipoGasto_qry01(tg); dgtipoGasto.DataSource = ds.Tables[0]; lblRow_total.Text = dgtipoGasto.RowCount.ToString(); } catch (Exception ex) { //Response.Write(ex.ToString()); } }
public void ejecutarTGasto(ETipGasto tg) { txtTgasto.Text = tg.Id_tipogsto; txtdsGasto.Text = tg.Ds_tipogsto; }
public static ETipGasto TipoGasto_qry02(ETipGasto etg) { return DTipGasto.mListarTipoGasto(etg); }
public static DataSet TipoGasto_qry01(ETipGasto etg) { return DTipGasto.TipoGasto_Qry1(etg); }
public static List<Dato> ObtenerDatotg(ETipGasto idtabla) { return DTipGasto.ObtenerDatoTg("MG_CLASE_Qry01_prueba", "idtipGasto", "dsDescrip", idtabla); }
public static DataSet TipoGasto_Qry1(ETipGasto etg) { DBAccess db = new DBAccess(); db.AddParameter("@codigo", etg.Id_tipogsto); db.AddParameter("@Descrip", etg.Ds_tipogsto); return db.ExecuteDataSet("MG_TipoGasto_Qry01"); }
private static ETipGasto mCargarTipoGasto(IDataReader rdr) { ETipGasto etg = new ETipGasto(); etg.Id_tipogsto = rdr.IsDBNull(rdr.GetOrdinal("Codigo")) ? String.Empty : rdr.GetString(rdr.GetOrdinal("Codigo")); etg.Ds_tipogsto = rdr.IsDBNull(rdr.GetOrdinal("Descripcion")) ? String.Empty : rdr.GetString(rdr.GetOrdinal("Descripcion")); return etg; }
private void txtidtg_pop_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == Convert.ToChar(Keys.Enter)) { ETipGasto etg = new ETipGasto(); etg.Id_tipogsto = txtidtg_pop.Text; etg.Ds_tipogsto = ""; ETipGasto TipGastoGen = new ETipGasto(); TipGastoGen = BTipGasto.TipoGasto_qry02(etg); txtdstg_pop.Text = TipGastoGen.Ds_tipogsto.ToString(); if (TipGastoGen.Ds_tipogsto.ToString() != "") { txtcant_pop.Focus(); } else { MessageBox.Show("Producto no existe", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void cbccosto_pop_SelectionChangeCommitted(object sender, EventArgs e) { ETipGasto tg = new ETipGasto(); tg.Id_empresa = wfChgEmpPer.datos.idEmpresa; tg.Id_unegocio = cbunidnego_pop.SelectedValue.ToString(); tg.Id_ccosto = cbccosto_pop.SelectedValue.ToString(); WebHelper.LoadListControl3(cbclase_pop, BTipGasto.ObtenerDatotg(tg)); cbclase_pop.Focus(); }
private void cbccosto_pop_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == Convert.ToChar(Keys.Enter)) { ETipGasto tg = new ETipGasto(); tg.Id_empresa = wfChgEmpPer.datos.idEmpresa; tg.Id_unegocio = cbunidnego_pop.SelectedValue.ToString(); tg.Id_ccosto = cbccosto_pop.SelectedValue.ToString(); WebHelper.LoadListControl3(cbclase_pop, BTipGasto.ObtenerDatotg(tg)); cbclase_pop.Focus(); } }
public void LLenarCampos(EDetProducto objProd) { txtidProducto_pop.Text = objProd._Codigo; txtdsProducto_pop.Text = objProd._Producto; txtpresentacion.Text = objProd._Presenta; txtunid_pop.Text = objProd._UM; cbop_pop.SelectedValue = objProd._OP.ToString(); txtcant_pop.Text = objProd._Cant.ToString(); txtpu_pop.Text = objProd._PreUnit.ToString(); txtpordes_pop.Text = objProd._nu_pordscto.ToString(); _descto = objProd._Dscto.ToString(); _igv = objProd._Igv.ToString(); _subtotal = objProd._subTotal.ToString(); EUnidadNegocio eu = new EUnidadNegocio(); eu.IdEmpresa = wfChgEmpPer.datos.idEmpresa; eu.IdUNegocio = objProd._id_Gasto.ToString(); List<EUnidadNegocio> oListDato = BUndNegocio.MG_Unegocio_qry06(eu); if (oListDato.Count > 0) { string val = oListDato[0].Existe; if (val == "1") { cbunidnego_pop.SelectedValue = objProd._id_Gasto.ToString(); WebHelper.LoadListControl3(cbccosto_pop, BUndNegocio.ObtenerDatoCC(eu)); cbccosto_pop.SelectedValue = objProd._idCosto; cbccosto_pop.Text = objProd._C_Costos; ETipGasto tg = new ETipGasto(); tg.Id_empresa = wfChgEmpPer.datos.idEmpresa; tg.Id_unegocio = cbunidnego_pop.SelectedValue.ToString(); tg.Id_ccosto = cbccosto_pop.SelectedValue.ToString(); WebHelper.LoadListControl3(cbclase_pop, BTipGasto.ObtenerDatotg(tg)); cbclase_pop.SelectedValue = objProd._idclase; } else { } } txtidtg_pop.Text = objProd._Tipgasto; txtdstg_pop.Text = objProd._dstg; chkigv_pop.Checked = objProd._igvActivo; txtidPrese_pop.Text = objProd._Pres; txtdetalle_pop.Text = objProd._detalle; //descripcion en la grilla oculta _preneto = objProd._PreNeto; txtpesobruto_pop.Text = objProd._Peso_Bruto.ToString(); }