public Usuario Detalles(int Id_User) { Usuario user = null; try { string nombreCache = string.Format("user{0}", Id_User); if (!CacheData.Exist(nombreCache)) { UsuarioDAL model = new UsuarioDAL(_connectionString); var userDAL = model.Detalles(Id_User); user = Converter.ConvertToBL(userDAL); CacheData.Add(nombreCache, user); } else { user = (Usuario)CacheData.Get(nombreCache); } } catch (Exception ex) { log.Error("Detalles()", ex); } return(user); }
public Usuario GetUserByIdentityCode(string identityCode) { Usuario user = null; try { string nombreCache = string.Format("user_identitycode{0}", identityCode); if (!CacheData.Exist(nombreCache)) { UsuarioDAL model = new UsuarioDAL(_connectionString); var userDAL = model.GetUserByIdentityCode(identityCode); user = Converter.ConvertToBL(userDAL); CacheData.Add(nombreCache, user); } else { user = (Usuario)CacheData.Get(nombreCache); } } catch (Exception ex) { log.Error("GetUserByIdentityCode()", ex); } return(user); }
public Solicitud Detalles(int id) { Solicitud result = null; try { string nombreCache = string.Format("solicitud{0}", id); if (!CacheData.Exist(nombreCache)) { SolicitudDAL model = new SolicitudDAL(_connectionString); var solicitud = model.Detalles(id); result = Converter.ConvertToBL(solicitud); CacheData.Add(nombreCache, result); } else { result = (Solicitud)CacheData.Get(nombreCache); } } catch (Exception ex) { log.Error("Detalles()", ex); } return(result); }
public Permiso Detalles(int id) { Permiso result = null; try { string nombreCache = string.Format("Permiso{0}", id); if (!CacheData.Exist(nombreCache)) { PermisoDAL model = new PermisoDAL(_connectionString); var permiso = model.Detalles(id); result = Converter.ConvertToBL(permiso); CacheData.Add(nombreCache, result); } else { result = (Permiso)CacheData.Get(nombreCache); } } catch (Exception ex) { log.Error("Detalles()", ex); } return(result); }
public Dispositivo Detalles(int id) { Dispositivo result = null; try { string nombreCache = string.Format("device{0}", id); if (!CacheData.Exist(nombreCache)) { DispositivoDAL model = new DispositivoDAL(_connectionString); var device = model.Detalles(id); result = Converter.ConvertToBL(device); CacheData.Add(nombreCache, result); } else { result = (Dispositivo)CacheData.Get(nombreCache); } } catch (Exception ex) { log.Error("Detalles()", ex); } return(result); }
public Rol Detalles(int id) { Rol result = null; try { string nombreCache = string.Format("Rol{0}", id); if (!CacheData.Exist(nombreCache)) { RolDAL model = new RolDAL(_connectionString); var rol = model.Detalles(id); result = Converter.ConvertToBL(rol); CacheData.Add(nombreCache, result); } else { result = (Rol)CacheData.Get(nombreCache); } } catch (Exception ex) { log.Error("Detalles()", ex); } return(result); }
public CacheBase BuildCache(string regionName, IDictionary <string, string> properties) { if (!CacheData.TryGetValue(regionName ?? string.Empty, out var data)) { data = new Hashtable(); CacheData.Add(regionName ?? string.Empty, data); } return(new SerializingCache(regionName, data)); }
public void Start(IDictionary <string, string> properties) { var serializer = new BinaryFormatter(); foreach (var cache in SerializedCacheData) { using (var stream = new MemoryStream(cache.Value)) { CacheData.Add(cache.Key, (IDictionary)serializer.Deserialize(stream)); } } }
internal override bool Reconstruct(Blam.CacheFile c) { bool result = true; if (CacheData.Count != 1) { lightmap_vertex_buffer_bucket_cache_data_block cache_data; CacheData.Add(out cache_data); result = cache_data.Reconstruct(c, this, GeometryBlockInfo); } GeometryBlockInfo.Value.ClearPostReconstruction(); return(result); }
internal override bool Reconstruct(BlamLib.Blam.CacheFile c) { bool result = true; if (CacheData.Count != 1) { lightmap_geometry_section_cache_data_block cache_data; CacheData.Add(out cache_data); result = cache_data.Reconstruct(c, GeometryInfo.Value, GeometryBlockInfo.Value); } GeometryBlockInfo.Value.ClearPostReconstruction(); return(result); }
public Tag Detalles(int id) { Tag result = null; try { string nombreCache = string.Format("tag{0}", id); if (!CacheData.Exist(nombreCache)) { TagsDAL mod = new TagsDAL(_connectionString); var tag = mod.Detalles(id); result = Converter.ConvertToBL(tag); //result = Diccionario_Get(id); if (result != null) { // Guardamos en caché para la próxima CacheData.Add(nombreCache, result); } } else { result = (Tag)CacheData.Get(nombreCache); } } catch (Exception er) { log.Error(string.Format("Detalles({0})", id), er); } return(result); }