public static T GetSessionObject <T>(string Key) where T : new() { try { T objSession = Newtonsoft.Json.JsonConvert.DeserializeObject <T>(SessionExtensions.GetString(HttpHelper.HttpContext.Session, Key)); return(objSession); } catch (System.Exception) { return(new T()); } }
public static string GetSessionString(string Key) { string strSession = string.Empty; try { strSession = SessionExtensions.GetString(HttpHelper.HttpContext.Session, Key); } catch (System.Exception) { } return(strSession); }
private void updateSession() { last = SessionExtensions.GetString(session, "last"); lastChoese = SessionExtensions.GetString(session, "lastChose"); //choseIndexs = SessionExtensions.GetString(session, "choseIndexs"); if (!String.IsNullOrEmpty(last)) { foreach (var item in figuresCount.Select(n => n.Key).ToArray()) { figuresCount[item] = SessionExtensions.GetInt32(session, item.ToString()); } } }