Ejemplo n.º 1
0
 private void LoadTSCSingers(XmlDocument doc)
 {
     gd_tscsingers = new BindingList <TSCSingers>();
     db_tscsingers = new List <TSCSingers>();
     if (doc != null)
     {
         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
     {
     }
     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();
 }
Ejemplo n.º 2
0
        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';
            }
        }
Ejemplo n.º 3
0
        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';
            }
        }
Ejemplo n.º 4
0
 public bool Equals(TSCSingers a)
 {
     if ((object)a == null)
     {
         return(false);
     }
     return(FieldsEqual(this, a));
 }
Ejemplo n.º 5
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;
 }
Ejemplo n.º 6
0
 public bool KeyEquals(TSCSingers a)
 {
     if ((object)a == null)
     {
         return(false);
     }
     return(
         (a.SingerKey.Trim().ToLower() == SingerKey.Trim().ToLower())
         );
 }
Ejemplo n.º 7
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)
         );
 }
Ejemplo n.º 8
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));
        }