Ejemplo n.º 1
0
 public PaymentService()
 {
     _SectionService                = new SectionService();
     _BookInfoService               = new BookService();
     _BookCopyService               = new BookCopyService();
     _LibraryUserService            = new LibraryUserService();
     _BookTransactionInfoRepository = new BookTransactionInfoRepository();
 }
        public void CompletePayment(string adminUsername, string adminPassword)
        {
            var UserService = new LibraryUserService();

            var admin = UserService.GetAuthenticatedAdmin(adminUsername, adminPassword);

            if (admin != null)
            {
                CompletePayment();
            }
            else
            {
                throw new InvalidOperationException("Invalid admin username and password.");
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the UsersPageViewModel class.
        /// </summary>
        public UsersPageViewModel(LibraryUserService libraryUserService,
                                  DepartmentService departmentService, CourseService courseService)
        {
            _LibraryUserService = libraryUserService;
            _DepartmentService  = departmentService;
            _CourseService      = courseService;

            using (var repo = new LibraryUserRepository())
            {
                items = new ObservableCollection <LibraryUser>(repo.GetAll());
                ItemsCollectionView = CollectionViewSource.GetDefaultView(items);
                ItemsCollectionView.SortDescriptions.Add(new SortDescription("Fullname", ListSortDirection.Ascending));
            }

            DepartmentSource = CollectionViewSource.GetDefaultView(new ObservableCollection <Department>(_DepartmentService.GetDepartments()));
            DepartmentSource.CurrentChanged += DepartmentSource_CurrentChanged;
            var courses = new ObservableCollection <Course>(courseService.GetAllCourses());

            CoursesViewSource = CollectionViewSource.GetDefaultView(courses);
        }
 public LoginWindow()
 {
     InitializeComponent();
     DataContext         = this;
     _LibraryUserService = new LibraryUserService();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the LoginPageViewModel class.
 /// </summary>
 public AuthenticationViewModel(LibraryUserService libUserService)
 {
     _LibraryUserService = libUserService;
     IsAuthenticated     = false;
 }