-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReportTechnicians.aspx.cs
84 lines (63 loc) · 2.7 KB
/
ReportTechnicians.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;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using PolytexData;
using UniStr;
using PolytexControls;
using PolytexObjects;
public partial class ReportTechnicians : PolyReport
{
#region VARIABLES
public int TerritoryId = 0;
public string IncludeDisabled = "";
#endregion
#region METHODS
protected void Page_Load(object sender, EventArgs e)
{
if (ShowReport)
{
TableReport.Visible = true;
TerritoryId = Util.ValidateInt(PolyUtils.RequestFormOrQuerystringByContainedKey("TerritoryId"), CurrentUser.TerritoryId);
IncludeDisabled = PolyUtils.RequestFormOrQuerystringByContainedKey("IncludeDisabled");
ObjectDataSource1.SelectParameters["skip"].DefaultValue = Skip.ToString();
ObjectDataSource1.SelectParameters["fromDate"].DefaultValue = FromDateTime.ToString();
ObjectDataSource1.SelectParameters["toDate"].DefaultValue = ToDateTime.ToString();
ObjectDataSource1.SelectParameters["territoryId"].DefaultValue = TerritoryId.ToString();
ObjectDataSource1.SelectParameters["IncludeDisabled"].DefaultValue = (IncludeDisabled == "on" ? "true" : "false");
LabelTerritoryName.Text = ApplicationData.UpdateLableTerritoryName(CurrentUser.TerritoryId, CurrentUser.SystemUserId, TerritoryId);
}
else
{
TableReport.Visible = false;
}
}
public void GridViewOnRowCommand(object sender, GridViewCommandEventArgs e)
{
string name = e.CommandName;
if (name == "SystemUserId")
{
int id = Convert.ToInt32(e.CommandArgument);
string fromDate = ObjectDataSource1.SelectParameters["fromDate"].DefaultValue;
string toDate = ObjectDataSource1.SelectParameters["toDate"].DefaultValue;
Response.Redirect("ReportActivities.aspx?ShowReport=1&fromPopup=false&FromDateTime=" + fromDate + "&ToDateTime=" + toDate + "&" + name + "=" + id, true);
}
}
public string GetTotalHours()
{
string totalHours = GlobalFunctions.CalculateTotalHours(Util.ValidateInt(ObjectDataSource1.ObjectDataSourceDataTable.ExtendedProperties["TOTAL"].ToString(), 0).ToString());
return totalHours;
}
public string GetTotalActivities()
{
string totalActivities = Util.ValidateInt(ObjectDataSource1.ObjectDataSourceDataTable.ExtendedProperties["TOTAL_ACTIVITIES"].ToString(), 0).ToString();
return totalActivities;
}
#endregion
}