Ejemplo n.º 1
0
        public List <DetalleReporteEstadoCuenta> consultaReporteEstadoCuenta(Conexion _conexion, DateTime FechaIni, DateTime FechaFin, string Banco, string CuentaBanco)
        {
            List <DetalleReporteEstadoCuenta> ListaResultado;
            DetalleReporteEstadoCuenta        objDatos = new DetalleReporteEstadoCuenta();

            ListaResultado = objDatos.consultaReporteEstadoCuenta(_conexion, FechaIni, FechaFin, Banco, CuentaBanco);
            return(ListaResultado);
        }
            public List <DetalleReporteEstadoCuenta> consultaReporteEstadoCuenta(Conexion _conexion, DateTime FechaIni, DateTime FechaFin, string Banco, string CuentaBanco)
            {
                List <DetalleReporteEstadoCuenta> ListaResultado = new List <DetalleReporteEstadoCuenta>();

                try
                {
                    _conexion.Comando.CommandType = CommandType.StoredProcedure;
                    _conexion.Comando.CommandText = "spCBReporteEstadoDeCuenta";
                    _conexion.Comando.Parameters.Clear();
                    _conexion.Comando.Parameters.Add(new SqlParameter("@FechaIni", System.Data.SqlDbType.DateTime)).Value = FechaIni;
                    _conexion.Comando.Parameters.Add(new SqlParameter("@FechaFin", System.Data.SqlDbType.DateTime)).Value = FechaFin;
                    _conexion.Comando.Parameters.Add(new SqlParameter("@Banco", System.Data.SqlDbType.VarChar)).Value     = Banco;
                    //_conexion.Comando.Parameters.Add(new SqlParameter("@CuentaBanco", System.Data.SqlDbType.VarChar)).Value = CuentaBanco;
                    SqlDataReader reader = _conexion.Comando.ExecuteReader();
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            DetalleReporteEstadoCuenta dato = new DetalleReporteEstadoCuenta();
                            //dato.Banco = (reader["banco"] == DBNull.Value ? "" : Convert.ToString(reader["banco"]));
                            dato.Corporativo           = Convert.ToString(reader["corporativo"]);
                            dato.Sucursal              = Convert.ToString(reader["sucursal"]);
                            dato.Año                   = Convert.ToInt16(reader["año"]);
                            dato.Mes                   = Convert.ToInt16(reader["mes"]);
                            dato.CuentaBancoFinanciero = Convert.ToString(reader["cuentabancofinanciero"]).Trim();
                            dato.ConsecutivoFlujo      = Convert.ToInt32(reader["consecutivoflujo"] == DBNull.Value?"0": reader["consecutivoflujo"]); // mcc 20180503
                            dato.FOperacion            = Convert.ToDateTime(reader["foperacion"]);
                            dato.Referencia            = Convert.ToString(reader["referencia"]);
                            dato.Concepto              = Convert.ToString(reader["concepto"]);
                            dato.Retiros               = Convert.ToDecimal(reader["retiros"]);
                            dato.Depositos             = Convert.ToDecimal(reader["depositos"]);
                            dato.SaldoFinal            = Convert.ToDecimal(reader["saldofinal"]);
                            ListaResultado.Add(dato);
                        }
                        reader.Close();
                    }
                    return(ListaResultado);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }