public static ArrayList ListaLicenciasWebex() { if (HttpContext.Current.Cache["cr2_Telerreuniones"] == null) { ArrayList aTablaLW = new ArrayList(); LicenciaWebex objLW = new LicenciaWebex(); SqlDataReader dr = objLW.ObtenerLicenciasWebex(true); LicenciaWebex objLWAux; while (dr.Read()) { objLWAux = new LicenciaWebex((int)dr["CODIGO"], dr["DESCRIPCION"].ToString()); aTablaLW.Add(objLWAux); } dr.Close(); dr.Dispose(); HttpContext.Current.Cache.Insert("cr2_Telerreuniones", aTablaLW, null, DateTime.Now.AddMinutes(10), TimeSpan.Zero); return(aTablaLW); } else { return((ArrayList)HttpContext.Current.Cache["cr2_Telerreuniones"]); } }
public static LicenciaWebex Obtener(SqlTransaction tr, int t148_idlicenciawebex) { LicenciaWebex o = new LicenciaWebex(); SqlDataReader dr; if (tr == null) { dr = SqlHelper.ExecuteSqlDataReader(Utilidades.CadenaConexion, "CR2_LICENCIAWEBEX_S", t148_idlicenciawebex); } else { dr = SqlHelper.ExecuteSqlDataReaderTransaccion(tr, "CR2_LICENCIAWEBEX_S", t148_idlicenciawebex); } if (dr.Read()) { if (dr["t148_idlicenciawebex"] != DBNull.Value) { o.t148_idlicenciawebex = int.Parse(dr["t148_idlicenciawebex"].ToString()); } if (dr["t148_denominacion"] != DBNull.Value) { o.t148_denominacion = (string)dr["t148_denominacion"]; } } else { throw (new NullReferenceException("No se ha obtenido ningun dato de LicenciaWebex")); } dr.Close(); dr.Dispose(); return(o); }