-
Notifications
You must be signed in to change notification settings - Fork 1
/
pvmd_Home.aspx.cs
executable file
·88 lines (75 loc) · 3.23 KB
/
pvmd_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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using Ava.lib;
using Ava.lib.constant;
public partial class pvmd_Home : System.Web.UI.Page
{
//SqlDataReader oReader;
string connstring = ConfigurationManager.ConnectionStrings["AVAConnectionString"].ConnectionString;
//string query;
//SqlCommand cmd;
//SqlConnection conn;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["UserId"] == null || Session["UserId"].ToString() == "") Response.Redirect("login.aspx");
if (Session["SESSION_USERTYPE"].ToString() != "17") Response.Redirect("login.aspx");
if (IsPostBack)
{
SaveToDB();
}
PopulateFields();
}
void PopulateFields()
{
SqlDataReader oReader;
string connstring = ConfigurationManager.ConnectionStrings["AVAConnectionString"].ConnectionString;
string sCommand = "";
sCommand = "SELECT count(*) AS totalUsers FROM (SELECT t1.VendorId FROM tblVendor t1 WHERE t1.IsAuthenticated = 1 AND t1.Status = 4 ) t2";
oReader = SqlHelper.ExecuteReader(connstring, CommandType.Text, sCommand);
if (oReader.HasRows)
{
oReader.Read();
countVendors.Text = oReader["totalUsers"].ToString();
} oReader.Close();
sCommand = "SELECT count(*) AS totalUsers FROM (SELECT t1.VendorId FROM tblVendor t1 WHERE t1.IsAuthenticated = 1 AND t1.Status = 5 ) t2";
oReader = SqlHelper.ExecuteReader(connstring, CommandType.Text, sCommand);
if (oReader.HasRows)
{
oReader.Read();
countVendorsEndorsed.Text = oReader["totalUsers"].ToString();
} oReader.Close();
sCommand = "SELECT count(*) AS totalUsers FROM (SELECT t1.VendorId FROM tblVendor t1 WHERE t1.IsAuthenticated = 1 AND t1.Status = 6 ) t2";
oReader = SqlHelper.ExecuteReader(connstring, CommandType.Text, sCommand);
if (oReader.HasRows)
{
oReader.Read();
countApproved.Text = oReader["totalUsers"].ToString();
} oReader.Close();
sCommand = "SELECT count(*) AS totalUsers FROM (SELECT t1.VendorId FROM tblVendor t1 WHERE t1.IsAuthenticated = 1 AND t1.Status = 8 ) t2";
oReader = SqlHelper.ExecuteReader(connstring, CommandType.Text, sCommand);
if (oReader.HasRows)
{
oReader.Read();
countDisapproved.Text = oReader["totalUsers"].ToString();
} oReader.Close();
sCommand = "SELECT count(*) AS totalUsers FROM (SELECT t1.CompanyName FROM tblVendor t1 WHERE t1.Status >= 1 AND t1.Status <> 7 AND t1.Status <> 9 AND t1.Status <> 8 AND t1.Status <> 6) t2";
oReader = SqlHelper.ExecuteReader(connstring, CommandType.Text, sCommand);
if (oReader.HasRows)
{
oReader.Read();
pvmd_VendorOngoing_List_Count.Text = oReader["totalUsers"].ToString();
} oReader.Close();
}
void SaveToDB()
{
}
}