protected void GetAllData(DataTable dtOverall, StatusBoxHeader objStatusBox, int iCol) { objStatusBox.Label31Text = "0"; objStatusBox.Label21Text = "0"; objStatusBox.Label41Text = "0"; objStatusBox.Label11Text = "0"; IBtn.Value = "0"; MBtn.Value = "0"; NRBtn.Value = "0"; OKBtn.Value = "0"; string calloutimg = "<img class=\"callout\" src=\"../images/callout.gif\" />"; ILabel.InnerHtml = "0 server(s) have issues"; MLabel.InnerHtml = "0 server(s) are in maintenance"; NRLabel.InnerHtml = "0 server(s) are not responding"; OKLabel.InnerHtml = "0 server(s) have no issues"; DataTable dtRow1, dtRow2, dtRow3, dtRow4; DataRow[] results; if (dtOverall.Rows.Count > 0) { dtRow1 = dtOverall.Clone(); results = dtOverall.Select("StatusCode='Issue'"); foreach (DataRow dr in results) { dtRow1.ImportRow(dr); } if (dtRow1.Rows.Count > 0) { objStatusBox.Label31Text = dtRow1.Rows[0][iCol].ToString(); IBtn.Value = dtRow1.Rows[0][iCol].ToString(); ILabel.InnerHtml = dtRow1.Rows[0][iCol].ToString() + " server(s) have issues"; } dtRow2 = dtOverall.Clone(); results = dtOverall.Select("StatusCode='Maintenance'"); foreach (DataRow dr in results) { dtRow2.ImportRow(dr); } if (dtRow2.Rows.Count > 0) { objStatusBox.Label41Text = dtRow2.Rows[0][iCol].ToString(); MBtn.Value = dtRow2.Rows[0][iCol].ToString(); MLabel.InnerHtml = dtRow2.Rows[0][iCol].ToString() + " server(s) are in maintenance"; } dtRow3 = dtOverall.Clone(); results = dtOverall.Select("StatusCode='Not Responding'"); foreach (DataRow dr in results) { dtRow3.ImportRow(dr); } if (dtRow3.Rows.Count > 0) { objStatusBox.Label11Text = dtRow3.Rows[0][iCol].ToString(); NRBtn.Value = dtRow3.Rows[0][iCol].ToString(); NRLabel.InnerHtml = dtRow3.Rows[0][iCol].ToString() + " server(s) are not responding"; } dtRow4 = dtOverall.Clone(); results = dtOverall.Select("StatusCode='OK'"); foreach (DataRow dr in results) { dtRow4.ImportRow(dr); } if (dtRow4.Rows.Count > 0) { objStatusBox.Label21Text = dtRow4.Rows[0][iCol].ToString(); OKBtn.Value = dtRow4.Rows[0][iCol].ToString(); OKLabel.InnerHtml = dtRow4.Rows[0][iCol].ToString() + " server(s) have no issues"; } } }
protected void GetAllData(DataTable dtOverall, StatusBoxHeader objStatusBox, int iCol) { objStatusBox.Label31Text = "0"; objStatusBox.Label21Text = "0"; objStatusBox.Label41Text = "0"; objStatusBox.Label11Text = "0"; IBtn.Value = "0"; MBtn.Value = "0"; NRBtn.Value = "0"; OKBtn.Value = "0"; string calloutimg = "<img class=\"callout\" src=\"../images/callout.gif\" />"; ILabel.InnerHtml = "0 server(s) have issues"; MLabel.InnerHtml = "0 server(s) are in maintenance"; NRLabel.InnerHtml = "0 server(s) are not responding"; OKLabel.InnerHtml = "0 server(s) have no issues"; DataTable dtRow1, dtRow2, dtRow3, dtRow4; DataRow[] results; //CY: VS 157 if (dtOverall.Rows.Count > 0) { //if (Session["RestrictedServers"] != "" && Session["RestrictedServers"] != null) //{ // List<int> ServerID = new List<int>(); // List<int> LocationID = new List<int>(); // DataTable resServers = (DataTable)Session["RestrictedServers"]; // foreach (DataRow resser in resServers.Rows) // { // foreach (DataRow dominorow in dtOverall.Rows) // { // if (resser["serverid"].ToString() == dominorow["ID"].ToString()) // { // ServerID.Add(dtOverall.Rows.IndexOf(dominorow)); // } // } dtRow1 = dtOverall.Clone(); results = dtOverall.Select("StatusCode='Issue'"); foreach (DataRow dr in results) { dtRow1.ImportRow(dr); } if (dtRow1.Rows.Count > 0) { objStatusBox.Label31Text = dtRow1.Rows[0][iCol].ToString(); IBtn.Value = dtRow1.Rows[0][iCol].ToString(); ILabel.InnerHtml = dtRow1.Rows[0][iCol].ToString() + " server(s) have issues"; } dtRow2 = dtOverall.Clone(); results = dtOverall.Select("StatusCode='Maintenance'"); foreach (DataRow dr in results) { dtRow2.ImportRow(dr); } if (dtRow2.Rows.Count > 0) { objStatusBox.Label41Text = dtRow2.Rows[0][iCol].ToString(); MBtn.Value = dtRow2.Rows[0][iCol].ToString(); MLabel.InnerHtml = dtRow2.Rows[0][iCol].ToString() + " server(s) are in maintenance"; } dtRow3 = dtOverall.Clone(); results = dtOverall.Select("StatusCode='Not Responding'"); foreach (DataRow dr in results) { dtRow3.ImportRow(dr); } if (dtRow3.Rows.Count > 0) { objStatusBox.Label11Text = dtRow3.Rows[0][iCol].ToString(); NRBtn.Value = dtRow3.Rows[0][iCol].ToString(); NRLabel.InnerHtml = dtRow3.Rows[0][iCol].ToString() + " server(s) are not responding"; } dtRow4 = dtOverall.Clone(); results = dtOverall.Select("StatusCode='OK'"); foreach (DataRow dr in results) { dtRow4.ImportRow(dr); } if (dtRow4.Rows.Count > 0) { objStatusBox.Label21Text = dtRow4.Rows[0][iCol].ToString(); OKBtn.Value = dtRow4.Rows[0][iCol].ToString(); OKLabel.InnerHtml = dtRow4.Rows[0][iCol].ToString() + " server(s) have no issues"; } } }