public void ClearLoginCache() { var clientUserCache = UserCacheManager.GetClientUserCache(Router.NspClientCachePath); clientUserCache.Remove(parentForm.GetEndPoint()); UserCacheManager.SaveChanges(Router.NspClientCachePath, clientUserCache); }
public static PodTable.Record GetPodByRes(string res) { if (!UserCacheManager.ContainesKey("USERCEH_NAMECACHE", res)) { var orgRec = PodTable.GetRecord(new SqlCmdText("CEH_NAME = @cehname and PR_DO = ''", new SqlParam("cehname", res))); UserCacheManager.Set("USERCEH_NAMECACHE", res, orgRec); return(orgRec); } return(UserCacheManager.Get <PodTable.Record>("USERCEH_NAMECACHE", Text.Convert(res))); }
public static OrgTable.Record GetOrgByCode(int org) { if (!UserCacheManager.ContainesKey("USERCONTRACTORCACHE", Text.Convert(org))) { var orgRec = OrgTable.GetRecord(org); UserCacheManager.Set("USERCONTRACTORCACHE", Text.Convert(org), orgRec); return(orgRec); } return(UserCacheManager.Get <OrgTable.Record>("USERCONTRACTORCACHE", Text.Convert(org))); }
public void CreateLoginCache(string username, string token) { var clientUserCache = UserCacheManager.GetClientUserCache(Router.NspClientCachePath); var item = new ClientUserCacheItem() { UserName = username, Token = token }; clientUserCache[parentForm.GetEndPoint()] = item; UserCacheManager.SaveChanges(Router.NspClientCachePath, clientUserCache); }
public override void OnAuthorization(HttpActionContext actionContext) { Dictionary<HttpStatusCode, string> response; if (SkipAuthorization(actionContext)) { return; } var userSessionManager = new UserCacheManager(); if (userSessionManager.ReValidateSession(out response)) { base.OnAuthorization(actionContext); } else { ApiResponse apiResponse = new ApiResponse(response.Values.FirstOrDefault()); actionContext.Response = actionContext.ControllerContext.Request.CreateResponse(response.Keys.FirstOrDefault(), apiResponse); } }
public LoadShopCacheManager(UserCacheManager userCache) { UserCache = userCache; }