Esempio n. 1
0
        public PeriodController()
        {
            var entities = new Entities.Entities();

            PeriodRepository = new PeriodRepository(entities);
            YearRepository   = new YearRepository(entities);
        }
Esempio n. 2
0
 public UnitOfWork(bbuContext context)
 {
     _context             = context;
     Addresses            = new AddressRepository(_context);
     AppUsers             = new AppUserRepository(_context);
     Banks                = new BankRepository(_context);
     BankAccounts         = new BankAccountRepository(_context);
     Cemeteries           = new CemeteryRepository(_context);
     Credentials          = new CredentialsRepository(_context);
     Deceaseds            = new DeceasedRepository(_context);
     Doctors              = new DoctorRepository(_context);
     Employees            = new EmployeeRepository(_context);
     Files                = new FileRepository(_context);
     Funerals             = new FuneralRepository(_context);
     FuneralDocuments     = new FuneralDocumentRepository(_context);
     Genders              = new GenderRepository(_context);
     HomeAffairsOffices   = new HomeAffairsOfficeRepository(_context);
     HomeAffairsOfficers  = new HomeAffairsOfficerRepository(_context);
     Hospitals            = new HospitalRepository(_context);
     Informants           = new InformantRepository(_context);
     Members              = new MemberRepository(_context);
     Months               = new MonthRepository(_context);
     Mortuaries           = new MortuaryRepository(_context);
     NextOfKins           = new NextOfKinRepository(_context);
     NumberConfigurations = new NumberConfigurationRepository(_context);
     Payments             = new PaymentRepository(_context);
     PaymentPeriods       = new PaymentPeriodRepository(_context);
     People               = new PersonRepository(_context);
     PurchaseItems        = new PurchaseItemRepository(_context);
     Settings             = new SettingRepository(_context);
     States               = new StateRepository(_context);
     Suppliers            = new SupplierRepository(_context);
     Tasks                = new TaskRepository(_context);
     Years                = new YearRepository(_context);
 }
Esempio n. 3
0
        public ClassroomController()
        {
            var entities = new Entities.Entities();

            ClassroomRepository     = new ClassroomRepository(entities);
            EstablishmentRepository = new EstablishmentRepository(entities);
            UserRepository          = new UserRepository(entities);
            YearRepository          = new YearRepository(entities);
        }
Esempio n. 4
0
        public async Task TestYearRepo_GetGamesByYear()
        {
            //Arrange
            YearRepository TestRepo = CreateYearTestRepo("GamesByYear", true);

            //Act
            var result = await TestRepo.GetGamesByYear(_YearNumber - 1);

            //Assert
            Assert.IsTrue(result.Count() == 1);
        }
Esempio n. 5
0
        public async Task TestSystemRepo_Exists()
        {
            //Arrange
            YearRepository TestRepo = CreateYearTestRepo("YearExists");

            //Act
            var result = await TestRepo.Exist(_YearNumber - 1);  //Subtract one since it starts at 0

            //Assert
            Assert.IsTrue(result);
        }
Esempio n. 6
0
        public void TestYearRepo_GetAll()
        {
            //Arrange
            YearRepository TestRepo = CreateYearTestRepo("YearGetAll");

            //Act
            var result = TestRepo.GetAll();

            //Assert
            Assert.IsTrue(result.Count() == _YearNumber);
        }
Esempio n. 7
0
        public async Task TestYearRepo_GetSingle()
        {
            //Arrange
            YearRepository TestRepo = CreateYearTestRepo("YearGetSingle");

            //Act
            var result = await TestRepo.Find(_YearNumber - 1);  //Subtract one since it starts at 0

            //Assert
            Assert.IsTrue(result.Id == (_YearNumber - 1));
            Assert.IsTrue(result.Year == _YearName + (_YearNumber - 1).ToString());
        }
Esempio n. 8
0
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            if (Begin >= End)
            {
                yield return(new ValidationResult("Date fin supérieur à date de début", new string[] { "Begin", "End" }));
            }

            var YearRepository = new YearRepository(new Entities.Entities());
            var year           = YearRepository.GetById(YearId).Year;

            if (Begin.Year > year + 1 || Begin.Year < year || End.Year > year + 1 || End.Year < year)
            {
                yield return(new ValidationResult("L'année selectionnée ne correspond pas aux dates précédements selectionnées", new string[] { "YearId" }));
            }
        }
Esempio n. 9
0
        //IGenericRepository IUnitOfWork.Repository => throw new NotImplementedException();

        public UnitOfWork()
        {
            dbContext                  = new DatabaseContext();
            Repository                 = new GenericRepository(dbContext);
            SchoolRepository           = new SchoolRepository(dbContext);
            ExceptionLoggerRepository  = new ExceptionLoggerRepository(dbContext);
            ApiLogRepository           = new ApiLogRepository(dbContext);
            ImageFileTypeRepository    = new ImageFileTypeRepository(dbContext);
            AssessmentRepository       = new AssessmentRepository(dbContext);
            AttendanceRepository       = new AttendanceRepository(dbContext);
            BookRepository             = new BookRepository(dbContext);
            BookTransactionRepository  = new BookTransactionRepository(dbContext);
            EventRepository            = new EventRepository(dbContext);
            HomeworkRepository         = new HomeworkRepository(dbContext);
            ImageFileUrlRepository     = new ImageFileUrlRepository(dbContext);
            ParentRepository           = new ParentRepository(dbContext);
            StandardRepository         = new StandardRepository(dbContext);
            StudentRepository          = new StudentRepository(dbContext);
            SubjectRepository          = new SubjectRepository(dbContext);
            TeacherRepository          = new TeacherRepository(dbContext);
            YearRepository             = new YearRepository(dbContext);
            OperationalStaffRepository = new OperationalStaffRepository(dbContext);
        }
Esempio n. 10
0
 public YearsController(YearRepository yearRepository)
 {
     _yearRepository = yearRepository;
 }
Esempio n. 11
0
        public RepositoryFactory()
        {
            Repository                           bankRepository         = new Repository(new Bank());
            CurrencyRepository                   ccyRepository          = new CurrencyRepository();
            Repository                           divRepository          = new Repository(new Division());
            Repository                           empRepository          = new EmployeeRepository(new Employee());
            Repository                           topRepository          = new Repository(new TermOfPayment());
            Repository                           unitRepository         = new Repository(new Unit());
            Repository                           cuscatRepository       = new Repository(new CustomerCategory());
            Repository                           supcatRepository       = new Repository(new SupplierCategory());
            Repository                           pricecatRepository     = new Repository(new PriceCategory());
            Repository                           taxRepository          = new Repository(new Tax());
            Repository                           prtGroupRepository     = new Repository(new PartGroup());
            Repository                           warehouseRepository    = new Repository(new Warehouse());
            Repository                           prtCategoryRepository  = new Repository(new PartCategory());
            Repository                           docTypeRepository      = new Repository(new DocumentType());
            Repository                           excRateRepository      = new Repository(new ExchangeRate());
            CustomerRepository                   customerRepository     = new CustomerRepository();
            SupplierRepository                   supplierRepository     = new SupplierRepository();
            Repository                           yearRepository         = new YearRepository();
            Repository                           partRepository         = new PartRepository(new Part());
            StockTakingRepository                stocktakingRepository  = new StockTakingRepository();
            UserRepository                       userRepository         = new UserRepository(new User());
            GeneralSetupRepository               generalsetupRepository = new GeneralSetupRepository();
            PurchaseOrderRepository              poRepository           = new PurchaseOrderRepository();
            PeriodRepository                     periodRepository       = new PeriodRepository();
            UserSettingsRepository               usRepository           = new UserSettingsRepository();
            GoodReceiveNoteRepository            grnRepository          = new GoodReceiveNoteRepository();
            PurchaseReturnRepository             prRepository           = new PurchaseReturnRepository();
            SupplierInvoiceRepository            siRepository           = new SupplierInvoiceRepository();
            SupplierOutStandingInvoiceRepository soiRepository          = new SupplierOutStandingInvoiceRepository();
            SupplierInvoiceJournalRepository     sijRepository          = new SupplierInvoiceJournalRepository();
            PaymentRepository                    payRepository          = new PaymentRepository();
            APDebitNoteRepository                apdnRepository         = new APDebitNoteRepository();
            ProcessTransactionRepository         prtrRepository         = new ProcessTransactionRepository();
            SalesOrderRepository                 slsorderRepository     = new SalesOrderRepository();
            DeliveryOrderRepository              doRepository           = new DeliveryOrderRepository();
            SalesReturnRepository                srRepository           = new SalesReturnRepository();
            CustomerOutStandingInvoiceRepository coirRepository         = new CustomerOutStandingInvoiceRepository();
            CustomerInvoiceRepository            cirRepository          = new CustomerInvoiceRepository();
            ReceiptRepository                    rcptRepository         = new ReceiptRepository();
            ARCreditNoteRepository               arcrRepository         = new ARCreditNoteRepository();
            CustomerInvoiceJournalRepository     cijRepository          = new CustomerInvoiceJournalRepository();
            OpeningStockRepository               opstRepository         = new OpeningStockRepository();
            POSRepository                        posRepository          = new POSRepository();

            m_listService.Add(BANK_REPOSITORY, bankRepository);
            m_listService.Add(CURRENCY_REPOSITORY, ccyRepository);
            m_listService.Add(DIVISION_REPOSITORY, divRepository);
            m_listService.Add(EMPLOYEE_REPOSITORY, empRepository);
            m_listService.Add(TOP_REPOSITORY, topRepository);
            m_listService.Add(UNIT_REPOSITORY, unitRepository);
            m_listService.Add(CUSTOMER_CATEGORY_REPOSITORY, cuscatRepository);
            m_listService.Add(SUPPLIER_CATEGORY_REPOSITORY, supcatRepository);
            m_listService.Add(PRICE_CATEGORY_REPOSITORY, pricecatRepository);
            m_listService.Add(TAX_REPOSITORY, taxRepository);
            m_listService.Add(PART_GROUP_REPOSITORY, prtGroupRepository);
            m_listService.Add(WAREHOUSE_REPOSITORY, warehouseRepository);
            m_listService.Add(PART_CATEGORY_REPOSITORY, prtCategoryRepository);
            m_listService.Add(DOC_TYPE_REPOSITORY, docTypeRepository);
            m_listService.Add(EXCHANGE_RATE_REPOSITORY, excRateRepository);
            m_listService.Add(CUSTOMER_REPOSITORY, customerRepository);
            m_listService.Add(SUPPLIER_REPOSITORY, supplierRepository);
            m_listService.Add(YEAR_REPOSITORY, yearRepository);
            m_listService.Add(PART_REPOSITORY, partRepository);
            m_listService.Add(STOCKTAKING_REPOSITORY, stocktakingRepository);
            m_listService.Add(USER_REPOSITORY, userRepository);
            m_listService.Add(GENERAL_SETUP_REPOSITORY, generalsetupRepository);
            m_listService.Add(PURCHASEORDER_REPOSITORY, poRepository);
            m_listService.Add(PERIOD_REPOSITORY, periodRepository);
            m_listService.Add(USER_SETTING_REPOSITORY, usRepository);
            m_listService.Add(GOODRECEIVENOTE_REPOSITORY, grnRepository);
            m_listService.Add(PURCHASE_RETURN_REPOSITORY, prRepository);
            m_listService.Add(SUPPLIERINVOICE_REPOSITORY, siRepository);
            m_listService.Add(SUPPLIERINVOICE_JOURNAL_REPOSITORY, sijRepository);
            m_listService.Add(SUPPLIER_OUTSTANDING_INVOICE_REPOSITORY, soiRepository);
            m_listService.Add(PAYMENT_REPOSITORY, payRepository);
            m_listService.Add(APDEBITNOTE_REPOSITORY, apdnRepository);
            m_listService.Add(PROCESS_TRANSACTION_REPOSITORY, prtrRepository);
            m_listService.Add(SALES_ORDER_REPOSITORY, slsorderRepository);
            m_listService.Add(DELIVERY_ORDER_REPOSITORY, doRepository);
            m_listService.Add(SALES_RETURN_REPOSITORY, srRepository);
            m_listService.Add(CUSTOMER_OUTSTANDING_INVOICE_REPOSITORY, coirRepository);
            m_listService.Add(CUSTOMERINVOICE_REPOSITORY, cirRepository);
            m_listService.Add(RECEIPT_REPOSITORY, rcptRepository);
            m_listService.Add(ARCREDITNOTE_REPOSITORY, arcrRepository);
            m_listService.Add(CUSTOMERINVOICE_JOURNAL_REPOSITORY, cijRepository);
            m_listService.Add(OPENING_STOCK_REPOSITORY, opstRepository);
            m_listService.Add(POS_REPOSITORY, posRepository);
        }