-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDashboard.master.cs
More file actions
56 lines (50 loc) · 1.37 KB
/
Copy pathDashboard.master.cs
File metadata and controls
56 lines (50 loc) · 1.37 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
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["LoggedInuser"] == null)
{
Response.Redirect("login.aspx");
return;
}
DisplayNavigationMenu();
DisplayUserNavigation();
}
}
void DisplayNavigationMenu()
{
List<Category> Categories = Category.GetAll();
string html = listNavigation.InnerHtml;
if (Categories.Count == 0)
return;
foreach (var cat in Categories)
{
html += "<li><a href = 'Category.aspx?id=" + cat.Id + "'>" + cat.Name + "</a></li>";
}
listNavigation.InnerHtml = html;
}
private void DisplayUserNavigation()
{
var userid = Session["LoggedInuser"].ToString();
int _userId;
int.TryParse(userid, out _userId);
Users User = new Users();
User.Id = _userId;
User.Get();
if(User.UserType == 0)
{
sideMenuForSeller.Style.Add("display", "none");
}
}
protected void btnSearch_Click(object sender, EventArgs e)
{
}
}