Exemplo n.º 1
0
        public void AddToCourse()
        {
            Course course = new Course {
                CourseCode  = this.CourseCode,
                CourseName  = this.CourseName,
                Faculty     = this.Faculty,
                Sem         = Semester,
                CreatedAt   = DateTime.Now,
                Deleted     = false,
                CreatedBy   = 2,
                LastUpdated = DateTime.Now,
                IsActive    = true,
            };

            if (_services.Create(course) != null)
            {
                CourseCode = "";
                CourseName = "";
                Faculty    = "";
                Semester   = "";
                MessageBox.Show("Course Successfully Added ", "Action Successfull", MessageBoxButton.OK, MessageBoxImage.Information);
                OnPropertyChanged(nameof(CourseCode));
                OnPropertyChanged(nameof(CourseName));
                OnPropertyChanged(nameof(Faculty));
                OnPropertyChanged(nameof(Semester));
            }
            else
            {
                MessageBox.Show("Course Fail to add ", "Unsuccessfull", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }