コード例 #1
0
        private void Add()
        {
            var context = new DepartmentVM(facultities.ToArray());
            var wind    = new NewDepartment()
            {
                DataContext = context
            };

            wind.ShowDialog();
            System.Console.WriteLine(context.Department != null);
            if (context.Department != null)
            {
                ClassDepartment.Add(context.Department);
            }
        }
コード例 #2
0
 private void Edit()
 {
     if (Index >= 0)
     {
         var department = ClassDepartment[Index];
         var context    = new DepartmentVM(department, facultities.ToArray());
         var wind       = new NewDepartment()
         {
             DataContext = context
         };
         wind.ShowDialog();
         if (context.Department != null)
         {
             ClassDepartment[Index] = context.Department;
         }
     }
 }
コード例 #3
0
        private void Add()
        {
            var context = new DepartmentVM(facultities.ToArray());
            var wind    = new NewDepartment()
            {
                DataContext = context
            };

            wind.ShowDialog();
            if (wind.DialogResult == true)
            {
                if (context.Department != null)
                {
                    if (RequestToDataBase.Instance.requestInsertIntoDepartment(context.Department))
                    {
                        ClassDepartment.Add(context.Department);
                    }
                }
            }
        }
コード例 #4
0
 private void Edit()
 {
     if (Index >= 0)
     {
         var department = ClassDepartment[Index];
         var context    = new DepartmentVM(department, facultities.ToArray());
         var wind       = new NewDepartment()
         {
             DataContext = context
         };
         wind.ShowDialog();
         if (wind.DialogResult == true)
         {
             if (context.Department != null)
             {
                 if (RequestToDataBase.Instance.requestUpdateDepartment(context.Department, ClassDepartment, Index))
                 {
                     ClassDepartment[Index] = context.Department;
                 }
             }
         }
     }
 }