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);
            }
        }
 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;
         }
     }
 }
        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);
                    }
                }
            }
        }
 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;
                 }
             }
         }
     }
 }