-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHome.aspx.cs
102 lines (89 loc) · 3.51 KB
/
Home.aspx.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Globalization;
using System.Data.SqlClient;
public partial class Home : System.Web.UI.Page
{
public static string kode, Codeostan, un, uo, um, ua = "";
protected void Page_Load(object sender, EventArgs e)
{
kode = "98";// Request.QueryString["code"];
if (kode != null)
{
Session["kode"] = kode;
}
SqlDataReader drUser;
Dictionary<string, object> param = new Dictionary<string, object>();
param.Add("@kode", kode);
drUser = DB.ExecuteReader("SELECT Name,Markaz,Tag51,Tag52,Tag53 FROM [Shoora].[dbo].[TblUser] where Code=@kode", param);
if (drUser.Read())
{
lblUser.Text = drUser["Name"].ToString();
Codeostan = drUser["Markaz"].ToString();
lblCodeOstan.Text = drUser["Markaz"].ToString();
un = drUser["Name"].ToString();
uo= drUser["Tag51"].ToString();
um= drUser["Tag52"].ToString();
ua= drUser["Tag53"].ToString();
}
if ((ua != "1") && (um != "1") && (uo != "1"))
{
imgBtnInsert.Enabled = false;
imgBtnReport.Enabled = false;
imgBtnAdmin.Enabled = false;
imgBtnCenter.Enabled = false;
}
else
{
if (uo == "1")
{
imgBtnInsert.Enabled = true;
imgBtnReport.Enabled = true;
imgBtnAdmin.Enabled = false;
imgBtnCenter.Enabled = false;
}
if (um == "1")
{
imgBtnInsert.Enabled = true;
imgBtnReport.Enabled = true;
imgBtnAdmin.Enabled = true;
imgBtnCenter.Enabled = false;
}
if (ua == "1")
{
imgBtnInsert.Enabled = true;
imgBtnReport.Enabled = true;
imgBtnAdmin.Enabled = true;
imgBtnCenter.Enabled = true;
}
}
}
protected void imgBtnReport_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Reports.aspx?uo="+uo+"&um="+um+"&Kode="+kode+ "&Codeostan="+ Codeostan.Substring(0, 2));
}
protected void imgBtnInsert_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("positions.aspx?Codeostan=" + Codeostan.Substring(0, 2) + "&USRName=" +lblUser.Text+ "&kode=" + kode);
}
protected void imgBtnCenter_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Center.aspx");
}
protected void imgBtnAdmin_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Admin.aspx?uo=" + uo + "&um=" + um + "&code=" + kode );
}
protected void imgBtnExit_Click(object sender, ImageClickEventArgs e)
{
ClientScript.RegisterStartupScript(typeof(Page), "closePage", "window.close();", true);
}
protected void imgBtnHelp_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Help.aspx");
}
}