コード例 #1
0
 public StudentRegisterViewModel()
 {
     try
     {
         database = new YZYDbContextAzure();
     }
     catch (SystemException ex)
     {
         Log.WriteLine(ex.Message);
         Environment.Exit(1);
     }
     Users = new ObservableCollection <User>();
     //RegisterCommand = new YZYCommand(this.OnAdd, this.CanAdd);
     RegisterCommand = new YZYCommand(this.OnAdd);
 }
コード例 #2
0
 public ProfileViewModel()
 {
     Log.setLogOnFile();
     try
     {
         ctx = new YZYDbContextAzure();
     }
     catch (SystemException ex)
     {
         Log.WriteLine(ex.Message);
         Environment.Exit(1);
     }
     LoadUser();
     UpdateCommand = new YZYCommand(this.OnUpdate, this.CanUpdate);
 }
コード例 #3
0
 public TeacherViewModel()
 {
     Log.setLogOnFile();
     try
     {
         ctx = new YZYDbContextAzure();
     }
     catch (SystemException ex)
     {
         Log.WriteLine(ex.Message);
         Environment.Exit(1);
     }
     Courses = new ObservableCollection <Course>();
     LoadCourse();
     UpdateCommand = new YZYCommand(this.OnUpdate, this.CanUpdate);
     //UpdateGradeCommand = new YZYCommand(this.OnUpdateGrade, this.CanUpdateGrade);
 }
コード例 #4
0
 public TeacherDialogViewModel(int selectedCourseID)
 {
     _selectedCourseID = selectedCourseID;
     Log.setLogOnFile();
     try
     {
         ctx = new YZYDbContextAzure();
     }
     catch (SystemException ex)
     {
         Log.WriteLine(ex.Message);
         Environment.Exit(1);
     }
     Registers = new ObservableCollection <Register>();
     LoadRegistrations();
     UpdateGradeCommand = new YZYCommand(this.OnUpdateGrade, this.CanUpdateGrade);
 }
コード例 #5
0
 public StudentSearchCoursViewModel()
 {
     Log.setLogOnFile();
     try
     {
         ctx = new YZYDbContextAzure();
     }
     catch (SystemException ex)
     {
         Log.WriteLine(ex.Message);
         Environment.Exit(1);
     }
     Courses         = new ObservableCollection <Course>();
     Categories      = new List <Category>();
     CategoryStrings = new List <string>();
     LoadCourse();
     SearchCommand = new YZYCommand(this.OnSearch);
 }
コード例 #6
0
        //public YZYCommand RegisterCommand { get; set; }

        public SearchAccountViewModel()
        {
            Log.setLogOnFile();
            try
            {
                ctx = new YZYDbContextAzure();
            }
            catch (SystemException ex)
            {
                Log.WriteLine(ex.Message);
                Environment.Exit(1);
            }
            Users = new ObservableCollection <User>();
            LoadCourse();
            DeleteCommand = new YZYCommand(this.OnDelete, this.CanExecute);
            UpdateCommand = new YZYCommand(this.OnUpdate, this.CanExecute);
            AddCommand    = new YZYCommand(this.OnAdd, this.CanAdd);
            //RegisterCommand = new YZYCommand(this.OnRegister, this.CanRegister);
        }
コード例 #7
0
 public SearchCourseViewModel()
 {
     Log.setLogOnFile();
     try
     {
         ctx = new YZYDbContextAzure();
     }
     catch (SystemException ex)
     {
         Log.WriteLine(ex.Message);
         Environment.Exit(1);
     }
     Courses         = new ObservableCollection <Course>();
     Categories      = new List <Category>();
     CategoryStrings = new List <string>();
     LoadCourse();
     DeleteCommand = new YZYCommand(this.OnDelete, this.CanDelete);
     UpdateCommand = new YZYCommand(this.OnUpdate, this.CanExecute);
     AddCommand    = new YZYCommand(this.OnAdd, this.CanExecute);
 }