Пример #1
0
 public void updateTrainee(MY_BE.Trainee trainee)
 {
     foreach (MY_BE.Trainee item in DS.DataSource.traineesList)
     {
         if (item.id == trainee.id)
         {
             DS.DataSource.traineesList.Remove(trainee);
             DS.DataSource.traineesList.Add(trainee);
             break;
         }
     }
 }
        public void updateTrainee(MY_BE.Trainee trainee)
        {
            bool flag = false;

            MY_BE.Trainee t = new MY_BE.Trainee();
            foreach (MY_BE.Trainee item in DS.DataSource.traineesList)
            {
                if (item.id == trainee.id)
                {
                    t    = item;
                    flag = true;
                    break;
                }
            }
            if (flag)
            {
                DS.DataSource.traineesList.Remove(t);
                DS.DataSource.traineesList.Add(trainee);
            }
            else
            {
                throw new Exception("trainee not found");
            }
        }
Пример #3
0
 public void removeTrainee(MY_BE.Trainee trainee)
 {
     DS.DataSource.traineesList.Remove(trainee);
 }
Пример #4
0
 public void addTrainee(MY_BE.Trainee trainee)
 {
     DS.DataSource.traineesList.Add(trainee);
 }