Esempio n. 1
0
 public CustomerController(UnitOfWork unitOfWork, IEmailGateway emailGateway)
 {
     _unitOfWork         = unitOfWork;
     _customerRepository = new CustomerRepository(unitOfWork);
     _industryRepository = new IndustryRepository(unitOfWork);
     _emailGateway       = emailGateway;
 }
Esempio n. 2
0
        public HttpResponseMessage IndustryOfClient(int id)
        {
            IndustryRepository _repo = new IndustryRepository();

            try
            {
                IEnumerable <int> list = _repo.IndustriesOfClient(id);
                return(Request.CreateResponse(HttpStatusCode.OK, list));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }
Esempio n. 3
0
        public HttpResponseMessage ListIndustries()
        {
            IndustryRepository _repo = new IndustryRepository();

            try
            {
                IEnumerable <Industry> list = _repo.ListOfIndustries();
                return(Request.CreateResponse(HttpStatusCode.OK, list));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
                //return StatusCode(HttpStatusCode.BadRequest);
            }
        }
Esempio n. 4
0
        public Customer CreateCustomer(string industryName = null, CustomerStatus?status = null)
        {
            using (var unitOfWork = new UnitOfWork())
            {
                Industry industry = new IndustryRepository(unitOfWork).GetByName(industryName ?? "Cars").Value;

                var customer = new Customer((CustomerName)"Customer Name", (Email)"*****@*****.**", null, industry);
                if (status == CustomerStatus.Gold)
                {
                    customer.Promote();
                    customer.Promote();
                }
                new CustomerRepository(unitOfWork).Save(customer);

                unitOfWork.Commit();

                return(customer);
            }
        }
Esempio n. 5
0
 public UnitOfWork(ApplicationDbContext context)
 {
     _context                      = context;
     GigsRepository                = new GigRepository(context);
     InfluencerRepository          = new InfluencerRepository(context);
     SpecificIndustryRepository    = new SpecificIndustryRepository(context);
     FavouriteGigRepository        = new FavouriteGigRepository(context);
     FavouriteInfluencerRepository = new FavouriteInfluencerRepository(context);
     ApplicationUserRepository     = new ApplicationUserRepository(context);
     BasicPackageRepository        = new BasicPackageRepository(context);
     AdvancedPackageRepository     = new AdvancedPackageRepository(context);
     PremiumPackageRepository      = new PremiumPackageRepository(context);
     FileUploadRepository          = new FileUploadRepository(context);
     MembershipTypeRepository      = new MembershipTypeRepository(context);
     AuroraWalletRepository        = new AuroraWalletRepository(context);
     NotificationsRepository       = new NotificationsRepository(context);
     UserNotificationsRepository   = new UserNotificationsRepository(context);
     WalletRepository              = new WalletRepository(context);
     AuctionRepository             = new AuctionRepository(context);
     IndustryRepository            = new IndustryRepository(context);
     OrderRepository               = new OrderRepository(context);
     ShoppingCartRepository        = new ShoppingCartRepository(context);
 }
 public IndustryBusiness(IUnitOfWork _unitOfWork)
 {
     unitOfWork         = _unitOfWork;
     industryRepository = new IndustryRepository(unitOfWork);
 }
Esempio n. 7
0
 public IndustryController(IndustryRepository industryRepository)
 {
     _industryRepository = industryRepository;
 }
Esempio n. 8
0
 // Ctor
 public IndustryService(IndustryRepository IndustryRepository)
 {
     this._IndustryRepository = IndustryRepository;
 }