Пример #1
0
        private void Add()
        {
            var context = new ClassroomVM(departments.ToArray());
            var wind    = new NewClassroom()
            {
                DataContext = context
            };

            wind.ShowDialog();
            if (context.ClassRoom != null)
            {
                ClassClassroom.Add(context.ClassRoom);
            }
        }
Пример #2
0
 private void Edit()
 {
     if (Index >= 0)
     {
         var classroom = ClassClassroom[Index];
         var context   = new ClassroomVM(classroom, departments.ToArray());
         var wind      = new NewClassroom()
         {
             DataContext = context
         };
         wind.ShowDialog();
         if (context.ClassRoom != null)
         {
             ClassClassroom[Index] = context.ClassRoom;
         }
     }
 }
Пример #3
0
        private void Add()
        {
            var context = new ClassroomVM(departments.ToArray());
            var wind    = new NewClassroom()
            {
                DataContext = context
            };

            wind.ShowDialog();
            if (wind.DialogResult == true)
            {
                if (context.ClassRoom != null)
                {
                    if (RequestToDataBase.Instance.requestInsertIntoClassroom(context.ClassRoom))
                    {
                        ClassClassroom.Add(context.ClassRoom);
                    }
                }
            }
        }
Пример #4
0
 private void Edit()
 {
     if (Index >= 0)
     {
         var classroom = ClassClassroom[Index];
         var context   = new ClassroomVM(classroom, departments.ToArray());
         var wind      = new NewClassroom()
         {
             DataContext = context
         };
         wind.ShowDialog();
         if (wind.DialogResult == true)
         {
             if (context.ClassRoom != null)
             {
                 if (RequestToDataBase.Instance.requestUpdateClassroom(context.ClassRoom, ClassClassroom, Index))
                 {
                     ClassClassroom[Index] = context.ClassRoom;
                 }
             }
         }
     }
 }