-
Notifications
You must be signed in to change notification settings - Fork 1
/
root-manage-complaint.aspx.cs
61 lines (39 loc) · 1.58 KB
/
root-manage-complaint.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
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;
namespace ComplaintManagement
{
public partial class root_manage_complaint : System.Web.UI.Page
{
String con = System.Configuration.ConfigurationManager.ConnectionStrings["Complaint_dbConnectionString"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
string current_user = Session["logged_user"].ToString();
string departmentId = Session["department"].ToString();
string department = "";
string id = "";
using (SqlConnection myConnection = new SqlConnection(con))
{
string oString = "Select d.department_name as dept , a.id from dbo.admin_data a join departments d on d.id = a.department where email=@email";
SqlCommand oCmd = new SqlCommand(oString, myConnection);
oCmd.Parameters.AddWithValue("@email", current_user);
myConnection.Open();
using (SqlDataReader oReader = oCmd.ExecuteReader())
{
while (oReader.Read())
{
id = oReader["id"].ToString();
department = oReader["dept"].ToString();
}
Session["user_id"] = id;
}
}
lbl_user_name.Text = department;
}
}
}