Esempio n. 1
0
        private void SetState(TSCEvents tscevent, List <TSCEvents> list)
        {
            if (tscevent.EventKey == null || tscevent.EventKey.Trim().Length == 0)
            {
                return;
            }
            bool bFound = false;

            foreach (TSCEvents s in list)
            {
                if (s.KeyEquals(tscevent))
                {
                    bFound = true;
                    if (s == tscevent)
                    {
                        tscevent.state = '=';
                    }
                    else
                    {
                        tscevent.state = 'U';
                    }
                }
            }
            if (bFound == false)
            {
                tscevent.state = 'I';
            }
        }
Esempio n. 2
0
        private void SetState(TSCEvents tscevent, BindingList <TSCEvents> list)
        {
            bool bFound = false;

            if (tscevent.EventKey != null && tscevent.EventKey.Trim().Length > 0)
            {
                foreach (TSCEvents s in list)
                {
                    if (s.EventKey != null && s.EventKey.Trim().Length > 0 && s.KeyEquals(tscevent))
                    {
                        bFound = true;
                        if (s == tscevent)
                        {
                            tscevent.state = '=';
                        }
                        else
                        {
                            tscevent.state = 'U';
                        }
                    }
                }
            }
            else
            {
                tscevent.state = '?';
                return;
            }
            if (bFound == false)
            {
                tscevent.state = 'D';
            }
        }
Esempio n. 3
0
 private void LoadEventsCombo(XmlDocument doc)
 {
     _loadingEvents = true;
     try
     {
         if (doc != null)
         {
             XmlNodeList nodelist = doc.SelectNodes("/Root/Data");
             if (nodelist != null)
             {
                 cmbEvent.Items.Clear();
                 cmbEvent.DisplayMember = "EventKey";
                 foreach (XmlNode node in nodelist)
                 {
                     TSCEvents events = new TSCEvents();
                     events.EventKey     = Utility.GetXmlString(node, "EventKey");
                     events.EventName    = Utility.GetXmlString(node, "EventName");
                     events.EventDate    = Utility.GetXmlDateTime(node, "EventDate");
                     events.EventEmail   = Utility.GetXmlString(node, "EventEmail");
                     events.EventAddress = Utility.GetXmlString(node, "EventAddress");
                     events.VenueKey     = Utility.GetXmlString(node, "VenueKey");
                     cmbEvent.Items.Add(events);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         _loadingEvents = false;
     }
 }
Esempio n. 4
0
        public void ReloadEvents()
        {
            TSCEvents currentEvent = null;

            controlTag.eventsXml = InitEvents();
            if (cmbEvent.SelectedIndex >= 0 && cmbEvent.SelectedIndex < cmbEvent.Items.Count)
            {
                currentEvent = cmbEvent.Items[cmbEvent.SelectedIndex] as TSCEvents;
            }
            LoadEventsCombo(controlTag.eventsXml);
            if (currentEvent != null && currentEvent.EventKey != null && currentEvent.EventKey.Trim().Length > 0)
            {
                foreach (object o in cmbEvent.Items)
                {
                    TSCEvents tsce = o as TSCEvents;
                    if (tsce != null)
                    {
                        if (tsce.EventKey.Trim().ToLower() == currentEvent.EventKey.Trim().ToLower())
                        {
                            cmbEvent.SelectedItem = tsce;
                            break;
                        }
                    }
                }
            }
        }
Esempio n. 5
0
 public bool Equals(TSCEvents a)
 {
     if ((object)a == null)
     {
         return(false);
     }
     return(FieldsEqual(this, a));
 }
Esempio n. 6
0
 public bool KeyEquals(TSCEvents a)
 {
     if ((object)a == null)
     {
         return(false);
     }
     return(
         (a.EventKey.Trim().ToLower() == EventKey.Trim().ToLower())
         );
 }
Esempio n. 7
0
 public TSCEvents(TSCEvents tscevents)
     : this()
 {
     EventKey     = new string(tscevents.EventKey.ToArray());
     EventName    = new string(tscevents.EventName.ToArray());
     VenueKey     = new string(tscevents.VenueKey.ToArray());
     EventDate    = tscevents.EventDate;
     EventEmail   = new string(tscevents.EventEmail.ToArray());
     EventAddress = new string(tscevents.EventAddress.ToArray());
 }
Esempio n. 8
0
 private static bool FieldsEqual(TSCEvents a, TSCEvents b)
 {
     return(
         (a.EventKey == b.EventKey) &&
         (a.EventName == b.EventName) &&
         (a.VenueKey == b.VenueKey) &&
         (a.EventDate == b.EventDate) &&
         (a.EventEmail == b.EventEmail) &&
         (a.EventAddress == b.EventAddress) &&
         (true)
         );
 }
Esempio n. 9
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            TSCEvents a = obj as TSCEvents;

            if (a == null)
            {
                return(false);
            }
            return(FieldsEqual(this, a));
        }
Esempio n. 10
0
 private void LoadTSCEvents(XmlDocument doc)
 {
     gd_tscevents = new BindingList <TSCEvents>();
     db_tscevents = new List <TSCEvents>();
     if (doc != null)
     {
         XmlNodeList nodelist = doc.SelectNodes("/Root/Data");
         if (nodelist != null)
         {
             foreach (XmlNode node in nodelist)
             {
                 TSCEvents tscevents = new TSCEvents();
                 tscevents.EventKey     = Utility.GetXmlString(node, "EventKey");
                 tscevents.EventName    = Utility.GetXmlString(node, "EventName");
                 tscevents.VenueKey     = Utility.GetXmlString(node, "VenueKey");
                 tscevents.EventDate    = Utility.GetXmlDateTime(node, "EventDate");
                 tscevents.EventEmail   = Utility.GetXmlString(node, "EventEmail");
                 tscevents.EventAddress = Utility.GetXmlString(node, "EventAddress");
                 gd_tscevents.Add(tscevents);
             }
             foreach (TSCEvents tscevents in gd_tscevents)
             {
                 db_tscevents.Add(new TSCEvents(tscevents));
             }
         }
     }
     else
     {
     }
     dataGridViewEvents.DataSource = gd_tscevents;
     dataGridViewEvents.Columns["EventKey"].DataPropertyName     = "EventKey";
     dataGridViewEvents.Columns["EventName"].DataPropertyName    = "EventName";
     dataGridViewEvents.Columns["VenueKey"].DataPropertyName     = "VenueKey";
     dataGridViewEvents.Columns["EventDate"].DataPropertyName    = "EventDate";
     dataGridViewEvents.Columns["EventEmail"].DataPropertyName   = "EventEmail";
     dataGridViewEvents.Columns["EventAddress"].DataPropertyName = "EventAddress";
     SetHeaders();
 }