Beispiel #1
0
        public void removeTester(MY_BE.Tester tester)
        {
            bool tester_exists = false;

            foreach (Tester item in getAllTesters())
            {
                if (item.id == tester.id)
                {
                    tester_exists = true;
                    d.removeTester(tester);
                }
            }
            if (!tester_exists)
            {
                throw new Exception("tried removing a tester not in database");
            }
        }
        public void updateTester(MY_BE.Tester tester)
        {
            //testers = LoadFromXML<List<Tester>>(testerspath);
            Tester t = new Tester();

            foreach (MY_BE.Tester item in testers)
            {
                if (item.id == tester.id)
                {
                    t = item;
                    break;
                }
            }
            testers.Remove(t);
            testers.Add(tester);
            SaveToXML(testers, testerspath);
        }
Beispiel #3
0
        public void updateTester(MY_BE.Tester tester)
        {
            bool tester_exists = false;

            foreach (Tester item in getAllTesters())
            {
                if (item.id == tester.id)
                {
                    tester_exists = true;
                    if (item.BirthDate == tester.BirthDate && item.TesterGender == tester.TesterGender)
                    {
                        d.updateTester(tester);
                    }
                    else
                    {
                        throw new Exception("cant change birth date & gender");
                    }
                }
            }
            if (!tester_exists)
            {
                throw new Exception("tried updating a tester not in database");
            }
        }
        public void removeTester(MY_BE.Tester tester)
        {
            //if (tester == null)
            //{
            //    throw new Exception("tester is null");
            //}
            bool tester_exists = false;

            foreach (Tester item in getAllTesters())
            {
                if (item.id == tester.id)
                {
                    tester_exists = true;
                }
            }
            if (!tester_exists)
            {
                throw new Exception("tester not found");
            }
            else
            {
                d.removeTester(tester);
            }
        }
 public void removeTester(MY_BE.Tester tester)
 {
     //testers = LoadFromXML<List<Tester>>(testerspath);
     testers.Remove(tester);
     SaveToXML(testers, testerspath);
 }
 public void addTester(MY_BE.Tester tester)
 {
     testers.Add(tester);
     SaveToXML(testers, testerspath);
 }