/// <summary>
        /// LLena la tabla del panel,
        /// </summary>
        private void LlenarTabla(Boolean ConSaldo)
        {
            ///Elimina todos los datos de la tabla
            GridDatos.Rows.Clear();
            GridDatos.Refresh();


            // _lstCuentas = ReporteadorCuenta.Ordernar(_lstCuentas);
            _lstCuentasFiltradas = new List <Cuenta>();
            _lstCuentas.ForEach((Cuenta => _lstCuentasFiltradas.Add(Cuenta.DeepCopy())));


            if (!checkCuentasConSaldo.Checked)
            {
                _lstCuentasFiltradas = new CuentaCL().QuitarCuentasSinSaldos(_lstCuentas);
            }
            CrearColumnasParaNombre();
            foreach (var c in _lstCuentasFiltradas)
            {
                DataGridViewRow row = new DataGridViewRow();
                row.CreateCells(GridDatos);

                var name = c.GetNombreParaExcel(_lstCuentas);

                row.Cells[name.Length - 1].Value = name.Last();


                if (ConSaldo)
                {
                    row.Cells[cont].Value     = c.SaldoAnteriorColones;
                    row.Cells[cont + 1].Value = c.DebitosColones;
                    row.Cells[cont + 2].Value = c.CreditosColones;
                    row.Cells[cont + 3].Value = c.SaldoActualColones;

                    GridDatos.Rows.Add(row);
                }
                else
                {
                    GridDatos.Rows.Add(row);
                    c.SaldoAnteriorColones = 0.00m;
                    c.DebitosColones       = 0.00m;
                    c.CreditosColones      = 0.00m;
                    c.DebitosDolares       = 0.00m;
                    c.CreditosDolares      = 0.00m;
                }
            }
        }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         OdbcConnection con = conectarBD();
         if (con != null)
         {
             try
             {
                 Response.Write(Session["cu"].ToString());
                 OdbcCommand    cmd = new OdbcCommand("select reta.idReta, deporte.nombre, hora, fecha, lugar, numParticipantes from reta,deporte,juega where deporte.idDeporte=reta.idDeporte and reta.idReta=juega.idReta and idUsuario= '" + Session["cu"].ToString() + "'  ", con);
                 OdbcDataReader rd  = cmd.ExecuteReader();
                 // rd.Read();
                 GridDatos.DataSource = rd;
                 GridDatos.DataBind();
                 rd.Close();
             }
             catch (Exception ex)
             {
                 lbCon.Text = "ocurrio un error" + ex;
             }
         }
     }
 }