switch (i)
{
case "dublfs01": //add server hd space to correct listbox
dublin1ListBox.Items.Add(ndivSize.ToString("#0.00"));
dublinImage2.Visible = true;
//display hd size in label
totalSize += ndivSize;
if (((((totalSize - totalSize2[0]) / totalSize) * 100) > -5) && ((((totalSize - totalSize2[0]) / totalSize) * 100) < 5))
{
dublin1Label.ForeColor = Color.Black; dublin1perLabel.ForeColor = Color.Black;
dublin1perLabel.Text = string.Format((((totalSize - totalSize2[0]) / totalSize) * 100).ToString("#0.0") + "{0}", " %");
dublin1Label.Text = string.Format( (totalSize - totalSize2[0]).ToString("#0.0") + "{1}", "+", " GB");
}
else
{
dublin1Label.ForeColor = Color.Red; dublin1perLabel.ForeColor = Color.Red;
dublin1perLabel.Text = string.Format((((totalSize - totalSize2[0]) / totalSize) * 100).ToString("#0.0") + "{0}", " %");
dublin1Label.Text = string.Format((totalSize - totalSize2[0]).ToString("#0.0") + "{1}", "-", " GB");
}
//this if else checks to see that 7 days ago was drive space total above or below 5% then displays
// in black or red text accordingly along with the percentage of change
if (((((totalSize - Days7AgoResultsStore[0]) / totalSize) * 100) > -10) && ((((totalSize - Days7AgoResultsStore[0]) / totalSize) * 100) < 10))
{
dublin1SevenLabel.ForeColor = Color.Black; dublin1SevenLabelDrives.ForeColor = Color.Black;
dublin1SevenLabel.Text = string.Format((((totalSize - Days7AgoResultsStore[0]) / totalSize) * 100).ToString("#0.0") + "{0}", " %");
dublin1SevenLabelDrives.Text = string.Format((totalSize - Days7AgoResultsStore[0]).ToString("#0.0") + "{1}", "+", " GB");
}
else
{
dublin1SevenLabel.ForeColor = Color.Red; dublin1SevenLabelDrives.ForeColor = Color.Red;
dublin1SevenLabel.Text = string.Format((((totalSize - Days7AgoResultsStore[0]) / totalSize) * 100).ToString("#0.0") + "{0}", " %");
dublin1SevenLabelDrives.Text = string.Format((totalSize - Days7AgoResultsStore[0]).ToString("#0.0") + "{1}", "-", " GB");
}
break;
case "dublmx01": //add hd space to correct listbox
dublmx01ListBox.Items.Add(ndivSize.ToString("#0.00"));
Image12.Visible = true;
totalSize += ndivSize;
//display hd size in label
if (((((totalSize - totalSize2[1]) / totalSize) * 100) > -5) && ((((totalSize - totalSize2[1]) / totalSize) * 100) < 5))
{
dublmx01Label.ForeColor = Color.Black; dublmx01perLabel.ForeColor = Color.Black;
dublmx01perLabel.Text = string.Format((((totalSize - totalSize2[1]) / totalSize) * 100).ToString("#0.0") + "{0}", " %");
dublmx01Label.Text = string.Format( (totalSize - totalSize2[1]).ToString("#0.0") + "{1}", "+", " GB");
}
else
{
dublmx01Label.ForeColor = Color.Red; dublmx01perLabel.ForeColor = Color.Red;
dublmx01perLabel.Text = string.Format((((totalSize - totalSize2[1]) / totalSize) * 100).ToString("#0.0") + "{0}", " %");
dublmx01Label.Text = string.Format((totalSize - totalSize2[1]).ToString("#0.0") + "{1}", "-", " GB");
}
//this if else checks to see that 7 days ago was drive space total above or below 5% then displays
// in black or red text accordingly along with the percentage of change
if (((((totalSize - Days7AgoResultsStore[1]) / totalSize) * 100) > -10) && ((((totalSize - Days7AgoResultsStore[1]) / totalSize) * 100) < 10))
{
dublmx01SevenLabel.ForeColor = Color.Black; dublmx01SevenLabelDrives.ForeColor = Color.Black;
dublmx01SevenLabel.Text = string.Format((((totalSize - Days7AgoResultsStore[1]) / totalSize) * 100).ToString("#0.0") + "{0}", " %");
dublmx01SevenLabelDrives.Text = string.Format( (totalSize - Days7AgoResultsStore[1]).ToString("#0.0") + "{1}", "+", " GB");
}
else
{
dublmx01SevenLabel.ForeColor = Color.Red; dublmx01SevenLabelDrives.ForeColor = Color.Red;
dublmx01SevenLabel.Text = string.Format((((totalSize - Days7AgoResultsStore[1]) / totalSize) * 100).ToString("#0.0") + "{0}", " %");
dublmx01SevenLabelDrives.Text = string.Format((totalSize - Days7AgoResultsStore[1]).ToString("#0.0") + "{1}", "-", " GB");
}
break;
|