/
AuditTrial.aspx.cs
103 lines (96 loc) · 3 KB
/
AuditTrial.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
103
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TTSHWeb.TTSHWCFReference;
namespace TTSHWeb
{
public partial class AuditTrial : System.Web.UI.Page
{
#region Events
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack)
{
//To popuplate Modules audit Dropdown
PopulateDropDown();
}
}
catch (Exception ex)
{
throw ex;
}
}
protected void ddlAuditModules_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
FillListBox((System.Web.UI.WebControls.ListBox)listSelectFrom, DropDownName.AuditModulesFields, "");
}
catch (Exception ex)
{
throw ex;
}
}
protected void btnAuditShow_Click(object sender, EventArgs e)
{
try
{
FillGrid(Convert.ToDateTime(txtAuditFromDate.Text),Convert.ToDateTime(txtAuditToDate.Text));
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region Methods
public void FillListBox(System.Web.UI.WebControls.ListBox lb, TTSHWCFReference.DropDownName listname, string Condition = "")
{
TTSHWCFServiceClient cl = new TTSHWCFServiceClient();
try
{
List<TTSHWCFReference.clsDropDown> listbox = cl.GetDropDownData(listname, ddlAuditModules.SelectedValue, "", "", "", "").ToList();
lb.DataSource = listbox;
lb.DataTextField = "DisplayField";
lb.DataValueField = "ValueField";
lb.DataBind();
//lb.Items.Insert(0, new ListItem("--Select--", "-1"));
}
catch
{ }
}
public void PopulateDropDown()
{
try
{
Common.FillComboNew((System.Web.UI.WebControls.DropDownList)ddlAuditModules, TTSHWCFReference.DropDownName.AuditModules, "");
}
catch (Exception ex)
{
throw ex;
}
}
public void FillGrid(DateTime FromDateRange ,DateTime ToDateRange)
{
try
{
TTSHWCFServiceClient Client = new TTSHWCFServiceClient();
List<Audit> gridData = new List<Audit>();
//List<ServiceReference1.Audit> = new List<ServiceReference1.Audit>();
gridData = Client.FillGrid_Audit(FromDateRange, ToDateRange).ToList();
rptrAuditTrial.DataSource = gridData;
rptrAuditTrial.DataBind();
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}