-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.Master.cs
127 lines (106 loc) · 4.01 KB
/
main.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace DB_Prpject
{
public partial class main : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (Session["role"] == null || Session["role"].ToString()=="")
{
LinkButton1.Visible = true; // user login link button
LinkButton2.Visible = true; // sign up link button
LinkButton4.Visible = true; // discounted product
LinkButton3.Visible = false; // logout link button
LinkButton7.Visible = false; // hello user link button
LinkButton8.Visible = true; // inventory link button
Button1.Visible = true;
}
else if (Session["role"].Equals("seller"))
{
LinkButton1.Visible = false; // user login link button
LinkButton2.Visible = false; // sign up link button
LinkButton3.Visible = true; // logout link button
LinkButton7.Visible = true; // hello user link button
Button1.Visible = false;
LinkButton7.Text = "Hello S " + Session["login_id"].ToString();
}
else if (Session["role"].Equals("customer"))
{
LinkButton1.Visible = false; // user login link button
LinkButton2.Visible = false; // sign up link button
LinkButton3.Visible = true; // logout link button
LinkButton7.Visible = true; // hello user link button
Button1.Visible = false;
LinkButton7.Text = "Hello C " + Session["login_id"].ToString();
}
}
catch (Exception ex)
{
}
}
protected void LinkButton6_Click(object sender, EventArgs e)
{
Response.Redirect("adminlogin.aspx");
}
protected void LinkButton5_Click(object sender, EventArgs e)
{
Response.Redirect("buyermanagement.aspx");
}
protected void LinkButton10_Click(object sender, EventArgs e)
{
Response.Redirect("sellermanagement.aspx");
}
protected void LinkButton8_Click(object sender, EventArgs e)
{
if(Session["role"]==null || Session["role"].ToString()=="")
{
Response.Write("<script>alert('Login First as a Seller');</script>");
}
else
Response.Redirect("admininventory.aspx");
}
protected void LinkButton11_Click(object sender, EventArgs e)
{
Response.Redirect("adminmange.aspx");
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("login.aspx");
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
Response.Redirect("signupuser.aspx");
}
protected void LinkButton3_Click(object sender, EventArgs e)
{
Response.Redirect("logout.aspx");
}
protected void LinkButton7_Click(object sender, EventArgs e)
{
Response.Redirect("userprofile.aspx");
}
protected void LinkButton4_Click(object sender, EventArgs e)
{
Response.Redirect("homepage.aspx");
}
protected void LinkButton13_Click(object sender, EventArgs e)
{
Response.Redirect("contactus.aspx");
}
protected void LinkButton12_Click(object sender, EventArgs e)
{
Response.Redirect("feedback.aspx");
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("adminlogin.aspx");
}
}
}