//// <summary> ///// Obtiene todos los FestivosCals ///// </summary> internal List <Models.FestivosCals> CatalogoRango(int nIdCal, DateTime fechaIni, DateTime fechaFin) { Models.FestivosCals oFestivosCals = null; List <Models.FestivosCals> lst = new List <Models.FestivosCals>(); IDataReader dr = null; try { SqlParameter[] dbparams = new SqlParameter[3] { Param(enumDBFields.t066_idcal, nIdCal), Param(enumDBFields.diaDesde, fechaIni), Param(enumDBFields.diaHasta, fechaFin) }; dr = cDblib.DataReader("[SUP_FESTIVOSCALENDARIOENTREFECHAS_IAP30]", dbparams); while (dr.Read()) { oFestivosCals = new Models.FestivosCals(); oFestivosCals.t067_dia = Convert.ToDateTime(dr["t067_dia"]); lst.Add(oFestivosCals); } return(lst); } catch (Exception ex) { throw ex; } finally { if (dr != null) { if (!dr.IsClosed) { dr.Close(); } dr.Dispose(); } } }
///// <summary> ///// Inserta un FestivosCals ///// </summary> //internal int Insert(Models.FestivosCals oFestivosCals) //{ // try // { // SqlParameter[] dbparams = new SqlParameter[1] { // Param(enumDBFields.t067_dia, oFestivosCals.t067_dia) // }; // return (int)cDblib.Execute("SUPER.IAP30_FestivosCals_INS", dbparams); // } // catch (Exception ex) // { // throw ex; // } //} ///// <summary> ///// Obtiene un FestivosCals a partir del id ///// </summary> //internal Models.FestivosCals Select() //{ // Models.FestivosCals oFestivosCals = null; // IDataReader dr = null; // try // { // dr = cDblib.DataReader("SUPER.IAP30_FestivosCals_SEL", dbparams); // if (dr.Read()) // { // oFestivosCals = new Models.FestivosCals(); // oFestivosCals.t067_dia=Convert.ToDateTime(dr["t067_dia"]); // } // return oFestivosCals; // } // catch (Exception ex) // { // throw ex; // } // finally // { // if (dr != null) // { // if (!dr.IsClosed) dr.Close(); // dr.Dispose(); // } // } //} ///// <summary> ///// Actualiza un FestivosCals a partir del id ///// </summary> //internal int Update(Models.FestivosCals oFestivosCals) //{ // try // { // SqlParameter[] dbparams = new SqlParameter[1] { // Param(enumDBFields.t067_dia, oFestivosCals.t067_dia) // }; // return (int)cDblib.Execute("SUPER.IAP30_FestivosCals_UPD", dbparams); // } // catch (Exception ex) // { // throw ex; // } //} ///// <summary> ///// Elimina un FestivosCals a partir del id ///// </summary> //internal int Delete() //{ // try // { // return (int)cDblib.Execute("SUPER.IAP30_FestivosCals_DEL", dbparams); // } // catch (Exception ex) // { // throw ex; // } //} ///// <summary> ///// Obtiene todos los FestivosCals ///// </summary> internal List <Models.FestivosCals> Catalogo(int nIdCal, DateTime dUMC) { Models.FestivosCals oFestivosCals = null; List <Models.FestivosCals> lst = new List <Models.FestivosCals>(); IDataReader dr = null; try { SqlParameter[] dbparams = new SqlParameter[2] { Param(enumDBFields.nIdCal, nIdCal), Param(enumDBFields.dUMC, dUMC) }; dr = cDblib.DataReader("SUP_FESTIVOSCALS", dbparams); while (dr.Read()) { oFestivosCals = new Models.FestivosCals(); oFestivosCals.t067_dia = Convert.ToDateTime(dr["t067_dia"]); lst.Add(oFestivosCals); } return(lst); } catch (Exception ex) { throw ex; } finally { if (dr != null) { if (!dr.IsClosed) { dr.Close(); } dr.Dispose(); } } }