-
Notifications
You must be signed in to change notification settings - Fork 2
/
svWorkers.aspx.cs
executable file
·61 lines (52 loc) · 2.09 KB
/
svWorkers.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.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class svWorkers : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["statsViewer"] == null) Response.Redirect("svLogin.aspx");
DataView dvw = (DataView)(sdcwork.Select(DataSourceSelectArguments.Empty));
DataView dvj = (DataView)(sdcjob.Select(DataSourceSelectArguments.Empty));
for (int i = 0; i <dvw.Table.Rows.Count ; i++)
{
TableRow tr = new TableRow();
twork.Rows.Add(tr);
TableCell c1 = new TableCell();
TableCell c2 = new TableCell();
//TableCell c3 = new TableCell();
TableCell c4 = new TableCell();
TableCell c6 = new TableCell();
c1.BorderWidth = 1;
c2.BorderWidth = 1;
//c3.BorderWidth = 1;
c4.BorderWidth = 1;
c6.BorderWidth = 1;
c1.Text = dvw.Table.Rows[i]["workerName"].ToString();
c2.Text = (dvw.Table.Rows[i][1].ToString() != dvw.Table.Rows[i][2].ToString()) ? dvw.Table.Rows[i][2].ToString() : "-";
//c3.BackColor = (dvw.Table.Rows[i][3].Equals(true)) ? System.Drawing.Color.Green : System.Drawing.Color.Black;
c4.Text = Convert.ToDateTime(dvw.Table.Rows[i][4]).ToShortDateString();
Button b = new Button();
b.Text = "VIEW DETAILS";
b.CssClass = "btn btn-default";
b.PostBackUrl = "workDesc.aspx?wid=" + dvw.Table.Rows[i][0].ToString();
c6.Controls.Add(b);
tr.Cells.Add(c1);
tr.Cells.Add(c2);
//tr.Cells.Add(c3);
tr.Cells.Add(c4);
tr.Cells.Add(c6);
}
foreach (TableRow tr in twork.Rows)
{
foreach (TableCell tc in tr.Cells)
{
tc.Attributes.CssStyle.Add("text-align","center");
}
}
}
}