-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest All Applications (UAT-B).xaml.cs
98 lines (76 loc) · 3.02 KB
/
Test All Applications (UAT-B).xaml.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
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace IIQ_Dashboard
{
/// <summary>
/// Interaction logic for Test_All_Applications__UAT_B_.xaml
/// </summary>
public partial class Test_All_Applications__UAT_B_ : Window
{
public Test_All_Applications__UAT_B_()
{
InitializeComponent();
refreshdata();
}
private void refreshdata()
{
DAL temp = new DAL();
DataSet dsub = temp.TestB();
DataTable dt1 = new DataTable();
dt1.Columns.Add("Applications");
dt1.Columns.Add("Status");
foreach (DataTable dt in dsub.Tables)
{
foreach (DataRow dr in dt.Rows)
{
string description = dr[0].ToString();
string completed = dr[1].ToString();
txtcompleted.Text = "Last Refreshed: " + completed;
string[] Status = description.Split(new string[] { "Failures:" }, StringSplitOptions.None);
string Successes1 = Status[0];
string Failures1 = Status[1];
string[] Successes = Successes1.Split(new string[] { "
" }, StringSplitOptions.None);
string[] Failures = Failures1.Split(new string[] { "
" }, StringSplitOptions.None);
foreach (string s in Successes)
{
DataRow workrow = dt1.NewRow();
workrow["Applications"] = s;
if (s != "")
{
workrow["Status"] = "Success";
}
dt1.Rows.Add(workrow);
}
for (int s = 1; s < Failures.Length; s++)
//foreach (string s in Failures)
{
DataRow workrow = dt1.NewRow();
workrow["Applications"] = Failures[s];
if (Failures[s] != "")
{
workrow["Status"] = "Fail";
}
dt1.Rows.Add(workrow);
}
}
}
dt1 = dt1.Rows.Cast<DataRow>().Where(row => !row.ItemArray.All(field => field is DBNull || string.IsNullOrWhiteSpace(field as string))).CopyToDataTable();
dt1.Rows[0].Delete();
dt1.Rows[1].Delete();
dt1.Rows[dt1.Rows.Count - 1].Delete();
Desgrid.ItemsSource = dt1.DefaultView;
}
}
}