Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblServerTime.Text = DateTime.Now.ToLongDateString() + " - " + DateTime.Now.ToLongTimeString() + " (" + System.Environment.MachineName + ")";

            // Load any alerts from the database
            AlertRepository alertRepository = new AlertRepository();
            List <Alert>    ActiveAlerts    = alertRepository.GetActive();

            if (ActiveAlerts.Count > 0)
            {
                StringBuilder AlertBarContent = new StringBuilder();

                foreach (Alert alert in ActiveAlerts)
                {
                    if (alert.Importance == AlertImportance.High)
                    {
                        AlertBarContent.Append("<div class=\"alertbar_high\">" + alert.Content + "</div>");
                    }
                    else
                    {
                        AlertBarContent.Append("<div class=\"alertbar_normal\">" + alert.Content + "</div>");
                    }
                }

                litAlertContainer.Text = AlertBarContent.ToString();
            }
        }