Beispiel #1
0
 private void RemoveDrillDownLink(System.Web.UI.WebControls.DataGridItemEventArgs e)
 {
     CMS.ServiceElementsDS.ElementRow row = ((CMS.ServiceElementsDS.ElementRow)((System.Data.DataRowView)e.Item.DataItem).Row);
     if (row.Level == 3)
     {
         e.Item.Cells[3].FindControl("lnkThisMonthText").Visible            = false;
         ((Label)e.Item.Cells[3].FindControl("lblThisMonthText")).BackColor = ((LinkButton)e.Item.Cells[3].FindControl("lnkThisMonthText")).BackColor;
         e.Item.Cells[3].FindControl("lblThisMonthText").Visible            = true;
     }
 }
Beispiel #2
0
 private void ShowNextMonthRAG(System.Web.UI.WebControls.DataGridItemEventArgs e)
 {
     try
     {
         //bad use of exception
         CMS.ServiceElementsDS.ElementRow row = ((CMS.ServiceElementsDS.ElementRow)((System.Data.DataRowView)e.Item.DataItem).Row);
         ((Label)e.Item.Cells[4].FindControl("lblNextMonthText")).BackColor = RAG(row.NextMonth, row);
     }
     catch (System.Data.StrongTypingException)
     {
     }
 }
Beispiel #3
0
 private void ShowThisMonthRAG(System.Web.UI.WebControls.DataGridItemEventArgs e)
 {
     try
     {
         //bad use of exception
         CMS.ServiceElementsDS.ElementRow row = ((CMS.ServiceElementsDS.ElementRow)((System.Data.DataRowView)e.Item.DataItem).Row);
         ((LinkButton)e.Item.Cells[3].FindControl("lnkThisMonthText")).BackColor = RAG(row.ThisMonth, row);
         e.Item.Cells[3].ToolTip = "Target=" + row.Target.ToString("P") + System.Environment.NewLine + "Red Threshold=" + row.RThreshold.ToString("P") + System.Environment.NewLine + "Amber Threshold=" + row.AThreshold.ToString("P") + System.Environment.NewLine + "Green Threshold=" + row.GThreshold.ToString("P");
     }
     catch (System.Data.StrongTypingException)
     {
     }
 }
Beispiel #4
0
        private void ShowServiceDetailColumn(System.Web.UI.WebControls.DataGridItemEventArgs e)
        {
            CMS.ServiceElementsDS.ElementRow row = ((CMS.ServiceElementsDS.ElementRow)((System.Data.DataRowView)e.Item.DataItem).Row);

            try
            {
                this.grdElements.Columns[6].Visible = (row.Level == 3);
                e.Item.Cells[6].FindControl("lnkDetail").Visible = (row.SLADetailId > 0);
            }
            catch (System.Data.StrongTypingException)
            {
                e.Item.Cells[6].FindControl("lnkDetail").Visible = false;
            }
        }
Beispiel #5
0
 private System.Drawing.Color RAG(decimal monthValue, CMS.ServiceElementsDS.ElementRow row)
 {
     //not sure if this is how the thresholds should work?
     if (monthValue <= row.RThreshold)
     {
         return(System.Drawing.Color.Red);
     }
     else if (monthValue > row.RThreshold && monthValue < row.GThreshold)
     {
         return(System.Drawing.Color.Yellow);
     }
     else
     {
         return(System.Drawing.Color.FromArgb(0, 255, 0));
     }
 }