Ejemplo n.º 1
0
 ///<summary>Inserts one AlertItem into the database.  Returns the new priKey.</summary>
 public static long Insert(AlertItem alertItem)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         alertItem.AlertItemNum = DbHelper.GetNextOracleKey("alertitem", "AlertItemNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(alertItem, true));
             }
             catch (Oracle.ManagedDataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     alertItem.AlertItemNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(alertItem, false));
     }
 }
Ejemplo n.º 2
0
        private void AddItemExcute()
        {
            INewItemView     view  = this.newItemsViewModel.ActiveNewItemView as INewItemView;
            NewItemModelBase model = this.viewDictionary[view];

            AlertItem item = model.ToAlertItem(Settings.Default.DefaultAlertBeforeMinutes);

            this.dataService.Items.Add(item);

            int index = this.dataService.Branches.IndexOf(model.NoticeBranch);

            if (index > 0)
            {
                this.dataService.Branches.Move(index, 0);
            }
            else if (index < 0)
            {
                this.dataService.Branches.Add(model.NoticeBranch);
            }

            if (Settings.Default.ResetCountDownData)
            {
                model.Clean();
            }
        }
Ejemplo n.º 3
0
        private void LoadData()
        {
            if (!File.Exists(DataFileName))
            {
                return;
            }

            string [] line;
            using (StreamReader sr = new StreamReader(DataFileName))
            {
                sr.ReadLine();
                sr.ReadLine();

                while (!sr.EndOfStream)
                {
                    line = sr.ReadLine().Split('|');
                    IAlertItem item = new AlertItem
                    {
                        Time      = DateTime.Parse(line[0]),
                        AlertTime = DateTime.Parse(line[1]),
                        Notice    = line[2]
                    };
                    this.dataService.Items.Add(item);
                }
            }

            if (Settings.Default.Branches != null)
            {
                for (int i = 0; i < Settings.Default.Branches.Count; i++)
                {
                    this.dataService.Branches.Add(Settings.Default.Branches[i]);
                }
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("AlertId,AlertTitel,InfoText1,InfoText2,DateOfCreation,DateOfExpiry")] AlertItem alertItem)
        {
            if (id != alertItem.AlertId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(alertItem);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AlertItemExists(alertItem.AlertId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(alertItem));
        }
Ejemplo n.º 5
0
        private object GetEditObject()
        {
            if (this.ValidateInput())
            {
                AlertItem model = this._AlertFacade.CreateNewAlertItem();

                //if (ViewState["currentPageAction"] != null && (string)ViewState["currentPageAction"] == PageActionType.Update)
                //{
                //    model.ItemSequence = (string)ViewState["editItemPK"];
                //}
                //else
                //{
                model.ItemSequence = this.txtAlertItemEdit.Text;
                //}

                model.AlertType    = this.txtAlertItemEdit.Text;
                model.Description  = string.IsNullOrEmpty(this.txtAlertItemDescEdit.Text) ? txtAlertItemEdit.Text : this.txtAlertItemDescEdit.Text;
                model.MailSubject  = this.txtAlertItemEdit.Text;
                model.MailContent  = " ";
                model.MaintainUser = this.GetUserCode();
                model.MaintainDate = FormatHelper.TODateInt(DateTime.Now.ToShortDateString());
                model.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);


                return(model);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 6
0
        protected void cmdSave_ServerClick(object sender, System.EventArgs e)
        {
            AlertItem model    = (AlertItem)GetEditObject();
            AlertItem oldModel = new AlertItem();

            oldModel.ItemSequence = txtOldAlertItemEdit.Text;
            if (model != null)
            {
                try
                {
                    this.DataProvider.BeginTransaction();
                    _AlertFacade.DeleteAlertItem(oldModel);

                    this._AlertFacade.AddAlertItem(model);
                    this.DataProvider.CommitTransaction();
                }
                catch (Exception ex)
                {
                    this.DataProvider.RollbackTransaction();
                    throw ex;
                }

                this.RequestData();

                this._ButtonHelper.PageActionStatusHandle(PageActionType.Save);
            }
            //this.txtAlertItemDescEdit.Text = this.languageComponent1.GetString(this.ddlAlertTypeEdit.SelectedValue);
        }
Ejemplo n.º 7
0
        //private void InitFirstClassList()
        //{
        //    DropDownListBuilder builder = new DropDownListBuilder(this.ddlItemFirstClass);
        //    builder.HandleGetObjectList = new GetObjectListDelegate((new ItemFacade(this.DataProvider)).GetItemFirstClass);
        //    builder.Build("FirstClass", "FirstClass");
        //    this.ddlItemFirstClass.Items.Insert(0, new ListItem("", ""));
        //    this.ddlItemFirstClass.SelectedIndex = 0;

        //    this.ddlItemSecondClass.Items.Insert(0, new ListItem("", ""));
        //    this.ddlItemSecondClass.SelectedIndex = 0;
        //}

        //private void InitSecondClassList()
        //{
        //    this.ddlItemSecondClass.Items.Clear();

        //    ItemFacade itemFacade = new ItemFacade(this.DataProvider);
        //    object[] itemClasses = itemFacade.GetItemSecondClass(FormatHelper.CleanString(this.ddlItemFirstClass.SelectedValue));

        //    if (itemClasses == null)
        //    {
        //        this.ddlItemSecondClass.Items.Insert(0, new ListItem("", ""));
        //        this.ddlItemSecondClass.SelectedIndex = 0;
        //        return;
        //    }

        //    foreach (ItemClass itemClass in itemClasses)
        //    {
        //        this.ddlItemSecondClass.Items.Add(new ListItem(itemClass.SecondClass, itemClass.SecondClass));
        //    }
        //    this.ddlItemSecondClass.Items.Insert(0, new ListItem("", ""));
        //    this.ddlItemSecondClass.SelectedIndex = 0;
        //}

        private void InitAlertItemInfo()
        {
            AlertItem obj = (AlertItem)_AlertFacade.GetAlertItem(Request["ITEMSEQUENCE"]);

            this.txtAlertItemSequence.Text = obj.ItemSequence;
            this.txtAlertItemDesc.Text     = obj.Description;
            //this.txtAlertMailSubject.Text = obj.MailSubject;
        }
Ejemplo n.º 8
0
 protected void cmdSaveMailSubject_ServerClick(object sender, System.EventArgs e)
 {
     if (ValidateSubjectInput())
     {
         AlertItem obj = (AlertItem)_AlertFacade.GetAlertItem(Request["ITEMSEQUENCE"]);
         //obj.MailSubject = this.txtAlertMailSubject.Text.Trim();
         _AlertFacade.UpdateAlertItem(obj);
     }
 }
Ejemplo n.º 9
0
        public void AlertItemNoticeValidationTest()
        {
            AlertItem item = new AlertItem();

            Assert.IsNull(item.Notice);
            Assert.AreNotEqual("", item.Validate("Notice"));

            item.Notice = "Test Alert";
            Assert.AreEqual("", item.Validate("Notice"));
        }
Ejemplo n.º 10
0
        public void AlertItemAlertTimeValidationTest()
        {
            AlertItem item = new AlertItem();

            Assert.IsNotNull(item.AlertTime);
            Assert.AreEqual("", item.Validate("AlertTime"));

            item.AlertTime = DateTime.Now;
            Assert.AreEqual("", item.Validate("AlertTime"));
        }
Ejemplo n.º 11
0
        public void GeneralAlertItemTest()
        {
            AlertItem item = new AlertItem();

            item.Time      = DateTime.Now;
            item.AlertTime = DateTime.Now.AddHours(1);
            item.Notice    = "Test Alert";
            item.HasAlert  = false;

            Assert.AreEqual("", item.Validate());
        }
        public async Task <IActionResult> Create([Bind("AlertId,AlertTitel,InfoText1,InfoText2,DateOfCreation,DateOfExpiry")] AlertItem alertItem)
        {
            if (ModelState.IsValid)
            {
                _context.Add(alertItem);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(alertItem));
        }
Ejemplo n.º 13
0
        public IActionResult Create([FromBody] AlertItem item)
        {
            if (item == null)
            {
                return(BadRequest());
            }

            _context.AlertItems.Add(item);
            _context.SaveChanges();

            return(CreatedAtRoute("GetAlert", new { id = item.Id }, item));
        }
Ejemplo n.º 14
0
        private void InitNoticeInfo()
        {
            AlertItem item = (AlertItem)this._AlertFacade.GetAlertItem(Request["ITEMSEQUENCE"]);

            this.txtAlertItemSequence.Text = item.ItemSequence;
            this.txtAlertItemDesc.Text     = item.Description;

            //初始化项次设定
            object[] alertErrors = this._AlertFacade.GetAlertDirectPasses(item.ItemSequence);

            if (alertErrors != null && alertErrors.Length > 0)
            {
                this.ddlItemType.SelectedValue = ((AlertDirectPass)alertErrors[0]).ItemType;
                this.txtBaseOutPut.Text        = ((AlertDirectPass)alertErrors[0]).BaseOutput.ToString();

                this.rblTimeDimensionGroup.SelectedValue = ((AlertDirectPass)alertErrors[0]).TimeDimension;

                this.txtAlertStandard.Text = ((AlertDirectPass)alertErrors[0]).AlertValue.ToString();

                //产生预警通告
                if (((AlertDirectPass)alertErrors[0]).GenerateNotice == "Y")
                {
                    this.chbGenerateNotice.Checked = true;
                    this.chbLinePause.Enabled      = true;
                }
                else
                {
                    this.chbGenerateNotice.Checked = false;
                    this.chbLinePause.Enabled      = false;
                }

                //发送邮件
                if (((AlertDirectPass)alertErrors[0]).SendMail == "Y")
                {
                    this.chbSendMail.Checked = true;
                }
                else
                {
                    this.chbSendMail.Checked = false;
                }

                //停线控制
                if (((AlertDirectPass)alertErrors[0]).LinePause == "Y")
                {
                    this.chbLinePause.Checked = true;
                }
                else
                {
                    this.chbLinePause.Checked = false;
                }
                this.ddlItemType.SelectedValue = ((AlertDirectPass)alertErrors[0]).ItemType;
            }
        }
Ejemplo n.º 15
0
        protected void cmdAdd_ServerClick(object sender, System.EventArgs e)
        {
            AlertItem model = (AlertItem)GetEditObject();

            if (model != null)
            {
                this._AlertFacade.AddAlertItem((AlertItem)model);
                this.RequestData();
                this._ButtonHelper.PageActionStatusHandle(PageActionType.Add);
            }
            //this.txtAlertItemDescEdit.Text = this.languageComponent1.GetString(this.ddlAlertTypeEdit.SelectedValue);
        }
Ejemplo n.º 16
0
        private string[] FormatExportRecord(object obj)
        {
            AlertItem model = (AlertItem)obj;

            return(new string[] {
                model.ItemSequence,
                model.Description.ToString(),
                this.languageComponent1.GetString(model.AlertType),
                model.GetDisplayText("MaintainUser"),
                FormatHelper.ToDateString(model.MaintainDate),
                FormatHelper.ToTimeString(model.MaintainTime)
            });
        }
Ejemplo n.º 17
0
        public static void Add(string url)
        {
            var alert = m_Alert.Value.AlertPendingList.SingleOrDefault(i => i.Url == url);

            if (alert == null)
            {
                alert = new AlertItem()
                {
                    Url = url
                };
                m_Alert.Value.AlertPendingList.Add(alert);
            }
            alert.AlertCount++;
        }
Ejemplo n.º 18
0
        private void InitNoticeInfo()
        {
            AlertItem item = (AlertItem)this._AlertFacade.GetAlertItem(Request["ITEMSEQUENCE"]);

            this.txtAlertItemSequence.Text = item.ItemSequence;
            this.txtAlertItemDesc.Text     = item.Description;

            //初始化项次设定
            object[] alertOQCNG = this._AlertFacade.GetAlertOQCNGs(item.ItemSequence);

            if (alertOQCNG != null && alertOQCNG.Length > 0)
            {
                string errorCode = "";
                foreach (AlertOQCNG error in alertOQCNG)
                {
                    errorCode += error.ErrorCode + ",";
                }
                errorCode = errorCode.TrimEnd(',');

                this.ddlItemType.SelectedValue = ((AlertOQCNG)alertOQCNG[0]).ItemType;
                this.txtErrorCode.Text         = errorCode;

                this.txtAlertStandard.Text = ((AlertOQCNG)alertOQCNG[0]).AlertValue.ToString();

                this.timeShiftBeginTimeEdit.Text = FormatHelper.ToTimeString(((AlertOQCNG)alertOQCNG[0]).StartTime);
                this.datStartDateWhere.Text      = FormatHelper.ToDateString(((AlertOQCNG)alertOQCNG[0]).StartDate);

                //产生预警通告
                if (((AlertOQCNG)alertOQCNG[0]).GenerateNotice == "Y")
                {
                    this.chbGenerateNotice.Checked = true;
                }
                else
                {
                    this.chbGenerateNotice.Checked = false;
                }

                //发送邮件
                if (((AlertOQCNG)alertOQCNG[0]).SendMail == "Y")
                {
                    this.chbSendMail.Checked = true;
                }
                else
                {
                    this.chbSendMail.Checked = false;
                }

                this.ddlItemType.SelectedValue = ((AlertOQCNG)alertOQCNG[0]).ItemType;
            }
        }
Ejemplo n.º 19
0
        public MainView() : base("MainView", null)
        {
            IMvxMessenger messenger = Mvx.Resolve <IMvxMessenger>();

            _alertToken = messenger.SubscribeOnMainThread <AlertMessage>(OnAlertMessage);
            _titleToken = messenger.Subscribe <ViewTitleMessage>(OnViewTitleMessage);

            AlertItem.Init();
            AlertItem.Alerts[AlertType.notification].Button.Clicked += (sender, e) => { ViewModel.NavigateToAsync(2); };
            AlertItem.Alerts[AlertType.location].Button.Clicked     += (sender, e) => { ViewModel.NavigateToAsync(3); };

            HamburgerItem.Init();
            HamburgerItem.Button.Clicked += (sender, e) => { PerformTableTransition(); };
        }
Ejemplo n.º 20
0
 ///<summary>Inserts one AlertItem into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(AlertItem alertItem)
 {
     if (DataConnection.DBtype == DatabaseType.MySql)
     {
         return(InsertNoCache(alertItem, false));
     }
     else
     {
         if (DataConnection.DBtype == DatabaseType.Oracle)
         {
             alertItem.AlertItemNum = DbHelper.GetNextOracleKey("alertitem", "AlertItemNum");                  //Cacheless method
         }
         return(InsertNoCache(alertItem, true));
     }
 }
Ejemplo n.º 21
0
        ///<summary>Updates one AlertItem in the database.</summary>
        public static void Update(AlertItem alertItem)
        {
            string command = "UPDATE alertitem SET "
                             + "ClinicNum   =  " + POut.Long(alertItem.ClinicNum) + ", "
                             + "Description = '" + POut.String(alertItem.Description) + "', "
                             + "Type        =  " + POut.Int((int)alertItem.Type) + ", "
                             + "Severity    =  " + POut.Int((int)alertItem.Severity) + ", "
                             + "Actions     =  " + POut.Int((int)alertItem.Actions) + ", "
                             + "FormToOpen  =  " + POut.Int((int)alertItem.FormToOpen) + ", "
                             + "FKey        =  " + POut.Long(alertItem.FKey) + ", "
                             + "ItemValue   = '" + POut.String(alertItem.ItemValue) + "' "
                             + "WHERE AlertItemNum = " + POut.Long(alertItem.AlertItemNum);

            Db.NonQ(command);
        }
Ejemplo n.º 22
0
        protected DataRow GetGridRow(object obj)
        {
            AlertItem model = (AlertItem)obj;


            DataRow row = this.DtSource.NewRow();

            row["AlertItemSequence"] = model.ItemSequence;
            row["AlertItemDesc"]     = model.Description;
            row["AlertItemType"]     = this.languageComponent1.GetString(model.AlertType);
            row["AlertMaintainUser"] = model.GetDisplayText("MaintainUser");
            row["AlertMaintainDate"] = FormatHelper.ToDateString(model.MaintainDate);
            row["AlertMaintainTime"] = FormatHelper.ToTimeString(model.MaintainTime);
            return(row);
        }
Ejemplo n.º 23
0
        private void InitNoticeInfo()
        {
            AlertItem item = (AlertItem)this._AlertFacade.GetAlertItem(Request["ITEMSEQUENCE"]);

            this.txtAlertItemSequence.Text = item.ItemSequence;
            this.txtAlertItemDesc.Text     = item.Description;

            txtSSCodeWhere.TextBox.Attributes.Add("readonly", "readonly");
            //初始化项次设定
            object[] alertLinePauses = this._AlertFacade.GetAlertLinePauses(item.ItemSequence);

            if (alertLinePauses != null && alertLinePauses.Length > 0)
            {
                string SSCode = "";
                foreach (AlertLinePause error in alertLinePauses)
                {
                    SSCode += error.SSCode + ",";
                }
                SSCode = SSCode.TrimEnd(',');

                this.txtAlertStandard.Text = ((AlertLinePause)alertLinePauses[0]).AlertValue.ToString();

                this.txtSSCodeWhere.Text = SSCode;

                this.ddlOPCode.SelectedValue = ((AlertLinePause)alertLinePauses[0]).OPCode;

                //产生预警通告
                if (((AlertLinePause)alertLinePauses[0]).GenerateNotice == "Y")
                {
                    this.chbGenerateNotice.Checked = true;
                }
                else
                {
                    this.chbGenerateNotice.Checked = false;
                }

                //发送邮件
                if (((AlertLinePause)alertLinePauses[0]).SendMail == "Y")
                {
                    this.chbSendMail.Checked = true;
                }
                else
                {
                    this.chbSendMail.Checked = false;
                }
            }
        }
Ejemplo n.º 24
0
        private void SetEditObject(object obj)
        {
            AlertItem model = (AlertItem)obj;

            if (model == null)
            {
                //this.ddlAlertTypeEdit.SelectedIndex = 0;
                //this.txtAlertItemDescEdit.Text = string.Empty;
                this.txtAlertItemDescEdit.Text = string.Empty;
                this.txtAlertItemEdit.Text     = string.Empty;
            }
            else
            {
                this.txtAlertItemDescEdit.Text = model.Description;


                this.txtAlertItemEdit.Text = model.AlertType;
            }
        }
Ejemplo n.º 25
0
        public override AlertItem ToAlertItem(int beforeAlertMinutes)
        {
            AlertItem item = new AlertItem();

            item.Time     = this.date.AddHours(this.hours).AddMinutes(this.minutes);
            item.HasAlert = false;

            if (string.IsNullOrWhiteSpace(this.Notice))
            {
                item.Notice = string.Format(Resources.OnlyNoticeBranch, this.NoticeBranch);
            }
            else
            {
                item.Notice = string.Format(Resources.NoticeFormat, this.NoticeBranch, this.Notice);
            }

            item.AlertTime = item.Time.AddMinutes(0 - beforeAlertMinutes);

            return(item);
        }
Ejemplo n.º 26
0
        public void PropertiesWithNotification()
        {
            DateTime now = DateTime.Now;

            AlertItem item = new AlertItem();

            Assert.AreEqual(false, item.HasAlert);

            AssertHelper.PropertyChangedEvent(item, x => x.Time, () => item.Time = now);
            Assert.AreEqual(now, item.Time);

            AssertHelper.PropertyChangedEvent(item, x => x.AlertTime, () => item.AlertTime = now.AddHours(1));
            Assert.AreEqual(now.AddHours(1), item.AlertTime);

            AssertHelper.PropertyChangedEvent(item, x => x.Notice, () => item.Notice = "Test Alert");
            Assert.AreEqual("Test Alert", item.Notice);

            item.HasAlert = true;
            Assert.AreEqual(true, item.HasAlert);
        }
Ejemplo n.º 27
0
    protected List <AlertItem> parseAlerts(string data)
    {
        List <AlertItem> res     = new List <AlertItem>();
        string           regexp  = "(?:<tr id=\"(.*?)\" class=\"ACTIVE\">)(.*?)(?:<\\/tr>)";
        string           regexp2 = "(?:alert-type\" colspan=\"2\"><a href=\"[^\"]*\">)(.*?)(?:<\\/a>)";
        string           regexp3 = "Feed<\\/a> <a href=\"([^\"]*)\">(.*?)<\\/a>";

        MatchCollection mc  = Regex.Matches(data, regexp, RegexOptions.IgnoreCase | RegexOptions.Singleline);
        int             cnt = 0;

        foreach (Match m in mc)
        {
            AlertItem ai = new AlertItem();
            ai.id = m.Groups[1].Value;
            if (m.Groups[2].Value.IndexOf("Feed") > 0)
            {
                ai.type = "feed";
            }
            else
            {
                ai.type = "email";
            }

            MatchCollection rrow = Regex.Matches(m.Groups[2].Value, regexp2);
            if (rrow.Count > 0)
            {
                ai.term = rrow[0].Groups[1].Value;
            }

            rrow = Regex.Matches(m.Groups[2].Value, regexp3);
            if (rrow.Count > 0)
            {
                ai.url = rrow[0].Groups[1].Value;
            }

            cnt++;
            res.Add(ai);
        }

        return(res);
    }
Ejemplo n.º 28
0
        private async Task MarkAsRead()
        {
            if (AlertItem.Alert.Read == null)
            {
                mPlatformService.ShowNetworkIndicator();
                mProgressDialogService.ShowProgressDialog();

                DateTimeOffset read     = DateTimeOffset.Now;
                var            response = await mApiService.SettingAlert(AlertItem.Alert.Id, read, null);

                mPlatformService.HideNetworkIndicator();
                mProgressDialogService.HideProgressDialog();

                if (response.StatusCode == System.Net.HttpStatusCode.OK || response.StatusCode == System.Net.HttpStatusCode.NoContent)
                {
                    AlertItem.Alert.Read = read;
                    AlertItem.RaisePropertyChanged("IsRead");
                    AlertItem.AlertsVM.RaisePropertyChanged("Title");
                }
            }
        }
Ejemplo n.º 29
0
        public IActionResult Update(long id, [FromBody] AlertItem item)
        {
            if (item == null || item.Id != id)
            {
                return(BadRequest());
            }

            var alert = _context.AlertItems.FirstOrDefault(t => t.Id == id);

            if (alert == null)
            {
                return(NotFound());
            }

            alert.IsComplete = item.IsComplete;
            alert.Name       = item.Name;

            _context.AlertItems.Update(alert);
            _context.SaveChanges();
            return(new NoContentResult());
        }
Ejemplo n.º 30
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <AlertItem> TableToList(DataTable table)
        {
            List <AlertItem> retVal = new List <AlertItem>();
            AlertItem        alertItem;

            foreach (DataRow row in table.Rows)
            {
                alertItem = new AlertItem();
                alertItem.AlertItemNum = PIn.Long(row["AlertItemNum"].ToString());
                alertItem.ClinicNum    = PIn.Long(row["ClinicNum"].ToString());
                alertItem.Description  = PIn.String(row["Description"].ToString());
                alertItem.Type         = (OpenDentBusiness.AlertType)PIn.Int(row["Type"].ToString());
                alertItem.Severity     = (OpenDentBusiness.SeverityType)PIn.Int(row["Severity"].ToString());
                alertItem.Actions      = (OpenDentBusiness.ActionType)PIn.Int(row["Actions"].ToString());
                alertItem.FormToOpen   = (OpenDentBusiness.FormType)PIn.Int(row["FormToOpen"].ToString());
                alertItem.FKey         = PIn.Long(row["FKey"].ToString());
                alertItem.ItemValue    = PIn.String(row["ItemValue"].ToString());
                retVal.Add(alertItem);
            }
            return(retVal);
        }
        protected void getList()
        {
            List<AlertItem> AlertItems = new List<AlertItem>();
            try
            {
                using (SPSite site = new SPSite(SPContext.Current.Web.Url))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        SPList list = (SPList)web.Lists["AlertsList"];

                        for (int i = 0; i < list.ItemCount; i++)
                        {
                            string title = Convert.ToString(list.Items[i]["Title"]);
                            string impact = Convert.ToString(list.Items[i]["Impact"]);
                            string desc = Convert.ToString(list.Items[i]["Description"]);
                            string pintotop = Convert.ToString(list.Items[i]["Pin to top"]);
                            string modifyedDate = Convert.ToString(list.Items[i]["Modified"]);
                            AlertItem myItem = new AlertItem(title, desc, impact, pintotop, modifyedDate);
                            AlertItems.Add(myItem);

                        }
                        AlertItems.Sort((x, y) => DateTime.Compare(x.Created, y.Created));
                        AlertItems.Reverse();

                        //AlertItems.Sort((a, b) => a.ToString().CompareTo(b.ToString()));
                        foreach (AlertItem item in AlertItems)
                        {
                            if (item.pinToTop)
                            item.addLi(AlertItemsHere);
                        }
                        //do red ones
                        foreach (AlertItem item in AlertItems)
                        {
                            if (!item.pinToTop)
                                if (item.impact == "High")
                                    item.addLi(AlertItemsHere);
                        }
                        //do yellow ones
                        foreach (AlertItem item in AlertItems)
                        {
                            if (!item.pinToTop)
                                if (item.impact == "Medium")
                                item.addLi(AlertItemsHere);
                        }
                        //do green ones
                        foreach (AlertItem item in AlertItems)
                        {
                            if (!item.pinToTop)
                                if (item.impact == "Low")
                                item.addLi(AlertItemsHere);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Label lblError = new Label();
                this.Controls.Add(lblError);
                if (e.InnerException != null)
                    lblError.Text = "An error has occured reading from the selected list. Please check the Navi properties. " + e.InnerException.ToString();
            }
        }