Example #1
0
 private void Add(HistoryItem objTempAdd)
 {
     objHistoryList.Add(objTempAdd);
 }
Example #2
0
        private void GetList()
        {
            System.Xml.XmlDocument objDoc = new System.Xml.XmlDocument();
            try
            {
                objDoc.Load("History.xml");
                System.Xml.XmlNodeList objHistoryNodes = objDoc.GetElementsByTagName("HistoryItem");
                foreach (System.Xml.XmlElement objNode in objHistoryNodes)
                {
                    HistoryItem objItem = new HistoryItem();
                    System.Xml.XmlNodeList objProperties = objNode.ChildNodes;
                    foreach (System.Xml.XmlElement objElement in objProperties)
                    {
                        if (String.Compare(objElement.Name, "ID", true) == 0)
                        {
                            objItem.ID = objElement.InnerText;

                        }
                        else if (String.Compare(objElement.Name, "FromDate", true) == 0)
                        {
                            objItem.FromDate = objElement.InnerText;
                        }
                        else if (String.Compare(objElement.Name, "ToDate", true) == 0)
                        {
                            objItem.ToDate = objElement.InnerText;


                        }



                    }
                    if (DateTime.Parse(objItem.ToDate) > DateTime.Now)
                    {
                        // will only add to list items whos too date has already expired.
                        objHistoryList.Add(objItem);
                    }


                }
            }
            catch (Exception ex)
            {


            }

        }
Example #3
0
        public void AddEvent(String ID, String FromDate, String ToDate)
        {
            HistoryItem objHistory = new HistoryItem();
            objHistory.ID = ID;
            objHistory.FromDate = FromDate;
            objHistory.ToDate = ToDate;
            Add(objHistory);

            
        }