-
Notifications
You must be signed in to change notification settings - Fork 0
/
CrazyHatsMain.master.cs
65 lines (59 loc) · 1.95 KB
/
CrazyHatsMain.master.cs
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class CrazyHatsMain : System.Web.UI.MasterPage
{
HatClass gcObj = new HatClass();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
gcObj.DLCategoryBind(this.dlCategory);
if (Session["UserID"] != null)
{
this.lnkLogin.Visible = false;
this.lnkRegister.Visible = false;
this.lnkLogout.Visible = true;
this.lnkMyDetails.Visible = true;
this.Label_Welcome.Text = "HELLO : " + Session["UserName"] + " !";
}
else
{
this.lnkLogin.Visible = true;
this.lnkRegister.Visible = true;
this.lnkLogout.Visible = false;
this.lnkMyDetails.Visible = false;
this.Label_Welcome.Text = "HELLO : GUEST !";
}
}
}
protected void dlCategory_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "select")
{
Response.Redirect("~/Pages/User/CategoryList.aspx?id=" + Convert.ToInt32(e.CommandArgument.ToString()));
}
}
public string GetCategoryName(int IntCategoryID)
{
return gcObj.GetCategory(IntCategoryID);
}
protected void lnkLogout_Click(object sender, EventArgs e)
{
Session["UserID"] = null;
Session["UserName"] = null;
this.lnkLogin.Visible = true;
this.lnkRegister.Visible = true;
this.lnkLogout.Visible = false;
this.Label_Welcome.Text = "HELLO : GUEST !";
Response.Redirect("~/Default.aspx");
}
}