-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu.aspx.cs
84 lines (73 loc) · 2.39 KB
/
Menu.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
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.OracleClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Menu : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(Session["HRS_USER_ID"] as string))
{
Response.Redirect("Login.aspx", true);
}
if (!IsPostBack)
{
UpdatePendingInboxRequestNumber();
}
}
protected void btnInitiate_Click(object sender, EventArgs e)
{
Response.Redirect("./VisaForm.aspx",true);
}
protected void btnApprove_Click(object sender, EventArgs e)
{
Response.Redirect("./Inbox.aspx", true);
}
private void UpdatePendingInboxRequestNumber()
{
OracleConnection oc = new OracleConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
OracleCommand command = new OracleCommand
{
Connection = oc
};
try
{
oc.Open();
command.CommandText = @"SELECT count (*)
FROM VISAFORM.ATF_WF_INSTANCE_STEPS i
INNER JOIN VFF_TRAVEL_REQUEST r ON i.REQ_ID = r.TRAVEL_REQUEST_ID
WHERE i.APPROVER_ID = :APPROVER_ID
AND i.APPROVED IS NULL
AND (i.STEP_SORT_NO = ( (SELECT COUNT (*)
FROM ATF_WF_INSTANCE_STEPS
WHERE APPROVED = 'Y' AND REQ_ID = i.REQ_ID)
+ 1))
AND r.DELETE_FLAG IS null
AND i.APP_ID = 2 ";
command.Parameters.Add(new OracleParameter("APPROVER_ID", Session["PNO"].ToString()));
OracleDataReader reader = command.ExecuteReader();
string numPending = "";
if (reader.Read())
{
numPending = reader["COUNT(*)"].ToString();
numPendingRequests1.InnerText = numPending;
numPendingRequests2.InnerText = numPending;
}
}
catch
{
numPendingRequests1.InnerText = "0";
numPendingRequests2.InnerText = "0";
}
finally
{
oc.Close();
oc.Dispose();
command.Dispose();
}
}
}