-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBannerFilter.aspx.cs
More file actions
48 lines (43 loc) · 1.49 KB
/
BannerFilter.aspx.cs
File metadata and controls
48 lines (43 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class analytics_BannerFilter : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
rptYourGames.DataSource = GetYourGames();
rptYourGames.DataBind();
}
public static DataSet GetYourGames()
{
string strKey = "GetYourGames_" + SessionObjects.SessionUserId.ToString();
if (HttpContext.Current.Cache[strKey] == null)
{
using (SqlConnection con = Utils.GetNewConnection())
{
con.Open();
using (SqlCommand cmd = new SqlCommand("W_GetYourGames", con))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@UserId", SessionObjects.SessionUserId);
using (SqlDataAdapter da = new SqlDataAdapter(cmd))
{
DataSet ds = new DataSet();
da.Fill(ds);
HttpContext.Current.Cache.Insert(strKey, ds, null, DateTime.Now.AddMinutes(Utils.C_TIMEOUT_FORMS), System.Web.Caching.Cache.NoSlidingExpiration);
return ds;
}
}
}
}
else
{
return (DataSet)HttpContext.Current.Cache[strKey];
}
}
}