private void SetState(TSCSingers singer, BindingList <TSCSingers> list)
        {
            bool bFound = false;

            if (singer.SingerKey != null && singer.SingerKey.Trim().Length > 0)
            {
                foreach (TSCSingers s in list)
                {
                    if (s.SingerKey != null && s.SingerKey.Trim().Length > 0 && s.KeyEquals(singer))
                    {
                        bFound = true;
                        if (s == singer)
                        {
                            singer.state = '=';
                        }
                        else
                        {
                            singer.state = 'U';
                        }
                    }
                }
            }
            else
            {
                singer.state = '?';
                return;
            }
            if (bFound == false)
            {
                singer.state = 'D';
            }
        }
        private void SetState(TSCSingers singer, List <TSCSingers> list)
        {
            if (singer.SingerKey == null || singer.SingerKey.Trim().Length == 0)
            {
                return;
            }
            bool bFound = false;

            foreach (TSCSingers s in list)
            {
                if (s.KeyEquals(singer))
                {
                    bFound = true;
                    if (s == singer)
                    {
                        singer.state = '=';
                    }
                    else
                    {
                        singer.state = 'U';
                    }
                }
            }
            if (bFound == false)
            {
                singer.state = 'I';
            }
        }
Exemple #3
0
 public bool Equals(TSCSingers a)
 {
     if ((object)a == null)
     {
         return(false);
     }
     return(FieldsEqual(this, a));
 }
Exemple #4
0
 public TSCSingers(TSCSingers tscsingers)
     : this()
 {
     SingerKey      = new string(tscsingers.SingerKey.ToArray());
     SingerName     = new string(tscsingers.SingerName.ToArray());
     SingerEmail    = new string(tscsingers.SingerEmail.ToArray());
     SingerActivity = tscsingers.SingerActivity;
 }
Exemple #5
0
 public bool KeyEquals(TSCSingers a)
 {
     if ((object)a == null)
     {
         return(false);
     }
     return(
         (a.SingerKey.Trim().ToLower() == SingerKey.Trim().ToLower())
         );
 }
Exemple #6
0
 private static bool FieldsEqual(TSCSingers a, TSCSingers b)
 {
     return(
         (a.SingerKey == b.SingerKey) &&
         (a.SingerName == b.SingerName) &&
         (a.SingerEmail == b.SingerEmail) &&
         (a.SingerActivity == b.SingerActivity) &&
         (true)
         );
 }
Exemple #7
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            TSCSingers a = obj as TSCSingers;

            if (a == null)
            {
                return(false);
            }
            return(FieldsEqual(this, a));
        }
 private void LoadTSCSingers(string xml)
 {
     gd_tscsingers = new BindingList <TSCSingers>();
     db_tscsingers = new List <TSCSingers>();
     if (xml != null && xml.Trim().Length > 0)
     {
         if (Utility.IsValidXml(xml))
         {
             XmlDocument doc = new XmlDocument();
             doc.LoadXml(xml);
             XmlNodeList nodelist = doc.SelectNodes("/Root/Data");
             if (nodelist != null)
             {
                 foreach (XmlNode node in nodelist)
                 {
                     TSCSingers tscsingers = new TSCSingers();
                     tscsingers.SingerKey      = Utility.GetXmlString(node, "SingerKey");
                     tscsingers.SingerName     = Utility.GetXmlString(node, "SingerName");
                     tscsingers.SingerEmail    = Utility.GetXmlString(node, "SingerEmail");
                     tscsingers.SingerActivity = Utility.GetXmlInteger(node, "SingerActivity");
                     gd_tscsingers.Add(tscsingers);
                 }
                 foreach (TSCSingers tscsingers in gd_tscsingers)
                 {
                     db_tscsingers.Add(new TSCSingers(tscsingers));
                 }
             }
         }
         else
         {
             MessageBox.Show(xml);
         }
     }
     else
     {
     }
     dataGridViewSingers.DataSource = gd_tscsingers;
     dataGridViewSingers.Columns["SingerKey"].DataPropertyName      = "SingerKey";
     dataGridViewSingers.Columns["SingerName"].DataPropertyName     = "SingerName";
     dataGridViewSingers.Columns["SingerEmail"].DataPropertyName    = "SingerEmail";
     dataGridViewSingers.Columns["SingerActivity"].DataPropertyName = "SingerActivity";
     SetHeaders();
 }