Exemplo n.º 1
0
        private void Add()
        {
            var context = new SubjectVM(departments.ToArray());
            var wins    = new NewSubject()
            {
                DataContext = context
            };

            wins.ShowDialog();
            System.Console.WriteLine(context.Subject != null);
            if (context.Subject != null)
            {
                ClassSubject.Add(context.Subject);
            }
        }
Exemplo n.º 2
0
 private void Edit()
 {
     if (Index >= 0)
     {
         var subject = ClassSubject[Index];
         var context = new SubjectVM(subject, departments.ToArray());
         var wins    = new NewSubject()
         {
             DataContext = context
         };
         wins.ShowDialog();
         if (context.Subject != null)
         {
             ClassSubject[Index] = context.Subject;
         }
     }
 }
Exemplo n.º 3
0
        private void Add()
        {
            var context = new SubjectVM(departments.ToArray());
            var wind    = new NewSubject()
            {
                DataContext = context
            };

            wind.ShowDialog();
            if (wind.DialogResult == true)
            {
                if (context.Subject != null)
                {
                    if (RequestToDataBase.Instance.requestInsertIntoSubject(context.Subject))
                    {
                        ClassSubject.Add(context.Subject);
                    }
                }
            }
        }
Exemplo n.º 4
0
 private void Edit()
 {
     if (Index >= 0)
     {
         var subject = ClassSubject[Index];
         var context = new SubjectVM(subject, departments.ToArray());
         var wind    = new NewSubject()
         {
             DataContext = context
         };
         wind.ShowDialog();
         if (wind.DialogResult == true)
         {
             if (context.Subject != null)
             {
                 if (RequestToDataBase.Instance.requestUpdateSubject(context.Subject, ClassSubject, Index))
                 {
                     ClassSubject[Index] = context.Subject;
                 }
             }
         }
     }
 }