public void CreateGrid() { int nCliCod = 0; clsOperaciones colOperaciones = new clsOperaciones(); if (cboxCliente.SelectedIndex != -1) nCliCod = int.Parse(cboxCliente.SelectedValue); DataTable dtResultado = colOperaciones.RepVentasXComprar(nCliCod); gridVentasxCobrar.DataSource = dtResultado; gridVentasxCobrar.DataBind(); }
protected void btnProcesar_Click(object sender, EventArgs e) { string cMensaje = ""; DataTable dtResultado = null; clsOperaciones lstOperaciones = new clsOperaciones(); DateTime dFecIni = DateTime.Today; DateTime dFecFin = DateTime.Today; int prvCod = 0; try { if (ValidarDatos(ref cMensaje)) { if (txtCliente.Text != "") prvCod = int.Parse(ddlClientes.SelectedValue); else prvCod = 9999; if (chkPorFecha.Checked) { dFecIni = DateTime.Parse(txtFecIni.Text); dFecFin = DateTime.Parse(txtFecFin.Text); } dtResultado = lstOperaciones.RepVentasXComprar(prvCod, chkPorFecha.Checked, dFecIni, dFecFin); if (dtResultado.Rows.Count > 0) { SetEstado("PRO"); gridVentasxCobrar.DataSource = dtResultado; gridVentasxCobrar.DataBind(); AgregarVariableSession("dtRepClientes", dtResultado); AgregarVariableSession("nTipCam", txtTipCam.Text); } else SetEstado("ERR"); } else { MessageBox(cMensaje); } } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } }