public UnitOfWork(AutoSolutionContext context)
 {
     _context                 = context;
     User                     = new UserRepository(_context);
     City                     = new CityRepository(_context);
     CityArea                 = new CityAreaRepository(_context);
     Province                 = new ProvinceRepository(_context);
     ServiceCategory          = new ServiceCategoryRepository(_context);
     UserServiceCatogory      = new UserServiceCatogoryRepository(_context);
     VehicleManufacturer      = new VehicleManufacturerRepository(_context);
     RoleRepository           = new RoleRepository(_context);
     VehicleModel             = new VehicleModelRepository(_context);
     TransmissionType         = new TransmissionTypeRepository(_context);
     VehicleEngineType        = new VehicleEngineTypeRepository(_context);
     PartsProductsCategory    = new PartsProductsCategoryRepository(_context);
     PartsSubCategory         = new PartsSubCategoryRepository(_context);
     VehicleVersion           = new VehicleVersionRepository(_context);
     PartsProductManufacturer = new PartsProductManufacturerRepository(_context);
     PartsProducts            = new PartsProductsRepository(_context);
     Template                 = new TemplateRepository(_context);
     WishList                 = new WishListRepository(_context);
     Order                    = new OrderRepository(_context);
     OrderDetail              = new OrderDetailRepository(_context);
     OrderStatus              = new OrderStatusRepository(_context);
 }
        public VehicleVersionViewModel AddNewVehicleVerison()
        {
            VehicleModelRepository      vehicleModelRepository      = new VehicleModelRepository(new AutoSolutionContext());
            TransmissionTypeRepository  transmissionTypeRepository  = new TransmissionTypeRepository(new AutoSolutionContext());
            VehicleEngineTypeRepository vehicleEngineTypeRepository = new VehicleEngineTypeRepository(new AutoSolutionContext());
            VehicleVersionViewModel     vehicleVersionViewModel     = new VehicleVersionViewModel()
            {
                VehicleManufacturerList = vehicleModelRepository.GetVehicleManufacturerDropDown(),
                VehicleModelList        = vehicleModelRepository.GetVehicleModelDropDownEmpty(),
                TransmissionTypeList    = transmissionTypeRepository.GetTransmissionTypeDownEmpty(),
                EngineTypeList          = vehicleEngineTypeRepository.GetVehicleEngineTypeDropDownEmpty(),
            };

            return(vehicleVersionViewModel);
        }
示例#3
0
        public PartsProductsViewModel AddNewPartsProducts()
        {
            VehicleModelRepository             vehicleModelRepository             = new VehicleModelRepository(new AutoSolutionContext());
            PartsSubCategoryRepository         partsSubCategoryRepository         = new PartsSubCategoryRepository(new AutoSolutionContext());
            TransmissionTypeRepository         transmissionTypeRepository         = new TransmissionTypeRepository(new AutoSolutionContext());
            VehicleEngineTypeRepository        vehicleEngineTypeRepository        = new VehicleEngineTypeRepository(new AutoSolutionContext());
            PartsProductManufacturerRepository partsProductManufacturerRepository = new PartsProductManufacturerRepository(new AutoSolutionContext());
            PartsProductsViewModel             partsProductsViewModel             = new PartsProductsViewModel()
            {
                VehicleManufacturerList      = vehicleModelRepository.GetVehicleManufacturerDropDown(),
                PartsProductsCategoryList    = partsSubCategoryRepository.GetPartsProductCategoryDropDown(),
                PartsProductsSubCategoryList = partsSubCategoryRepository.GetPartsProductSubCategoryDropDownEmpty(),
                PartProductManufacturerList  = partsProductManufacturerRepository.GetPPManufacturerDropDownEmpty(),
                VehicleModelList             = vehicleModelRepository.GetVehicleModelDropDownEmpty(),
                //TransmissionTypeList = transmissionTypeRepository.GetTransmissionTypeDownEmpty(),
                //EngineTypeList = vehicleEngineTypeRepository.GetVehicleEngineTypeDropDownEmpty(),
            };

            return(partsProductsViewModel);
        }