public GetCustomerApplianceActivityRequestHandler(IValidator <GetCustomerApplianceActivityRequest> validator,
                                                   IApplianceService applianceService, IUnitOfWork <ICaretakerRepository, Caretaker> unitOfWork)
 {
     _validator        = validator;
     _applianceService = applianceService;
     _unitOfWork       = unitOfWork;
 }
        public ActionResult Index()
        {
            var estates = new List<HomeIndexEstateViewModel>();
            var appliances = new List<HomeIndexApplianceViewModel>();

            if (this.HttpContext.Cache["Home estates"] != null && this.HttpContext.Cache["Home appliances"] != null)
            {
                ViewBag.Estates = this.HttpContext.Cache["Home estates"];
                ViewBag.Appliances = this.HttpContext.Cache["Home appliances"];
            }
            else
            {
                estates = this.estates
                    .GetAll()
                    .OrderByDescending(e => e.Ratings.Count() == 0 ? 0 : e.Ratings.Sum(r => r.Value) / e.Ratings.Count())
                    .Take(15)
                    .To<HomeIndexEstateViewModel>()
                    .ToList();

                appliances = this.appliances
                    .GetAll()
                    .OrderByDescending(a => a.Ratings.Count() == 0 ? 0 : a.Ratings.Sum(r => r.Value) / a.Ratings.Count())
                    .Take(15)
                    .To<HomeIndexApplianceViewModel>()
                    .ToList();

                ViewBag.Estates = estates;
                ViewBag.Appliances = appliances;

                this.HttpContext.Cache["Home estates"] = estates;
                this.HttpContext.Cache["Home appliances"] = appliances;
            }
                        
            return this.View(ViewBag);
        }
 public GetCustomerAppliancesRequestHandler(IApiClient client,
                                            IValidator <GetCustomerAppliancesRequest> validator, IApplianceService applianceService)
 {
     _client           = client;
     _validator        = validator;
     _applianceService = applianceService;
 }
示例#4
0
 public UserController(IApplianceService applianceService, INotificationService notificationService, IEventService eventService, IOptions <AppSetting> appSettings, IAccountApplianceService accountApplianceService, IAccountService accountService) : base(appSettings.Value)
 {
     this._accountApplianceService = accountApplianceService;
     this._accountService          = accountService;
     this._eventService            = eventService;
     this._notificationService     = notificationService;
     this._applianceService        = applianceService;
 }
示例#5
0
 public SettingController(IHelperService helperService, ITimerScheduleService timerScheduleService, IAccountApplianceService accountApplianceService, IApplianceService applianceService, IStateService stateService, IOptions <AppSetting> appSettings) : base(appSettings.Value)
 {
     this._helperService           = helperService;
     this._applianceService        = applianceService;
     this._stateService            = stateService;
     this._accountApplianceService = accountApplianceService;
     this._timerScheduleService    = timerScheduleService;
 }
示例#6
0
 public CustomerService(IApiClient client, IUnitOfWork <IApplianceTypeRepository, ApplianceType> unitOfWork,
                        IUnitOfWork <ICustomerRepository, Core.Models.Application.Customer> cUnitOfWork, IApplianceService applianceService)
 {
     _client           = client;
     _unitOfWork       = unitOfWork;
     _cUnitOfWork      = cUnitOfWork;
     _applianceService = applianceService;
 }
 public SetApplianceCategoryRequestHandler(IValidator <SetApplianceCategoryRequest> validator, IApplianceService service,
                                           IUnitOfWork <ICustomerRepository, Customer> unitOfWork,
                                           IUnitOfWork <IApplianceTypeRepository, ApplianceType> atUnitOfWork)
 {
     _validator    = validator;
     _unitOfWork   = unitOfWork;
     _service      = service;
     _atUnitOfWork = atUnitOfWork;
 }
 public GetDetailedCustomerPageRequestHandler(IApiClient client,
                                              IValidator <GetDetailedCustomerPageRequest> validator, IApplianceService applianceService,
                                              IUnitOfWork <ICustomerRepository, Customer> unitOfWork)
 {
     _client           = client;
     _validator        = validator;
     _applianceService = applianceService;
     _unitOfWork       = unitOfWork;
 }
示例#9
0
 public GetApplianceHistoryRequestHandler(IApiClient client,
                                          IValidator <GetApplianceHistoryRequest> validator, IApplianceService applianceService,
                                          IUnitOfWork <ICaretakerRepository, Caretaker> unitOfWork)
 {
     _client           = client;
     _validator        = validator;
     _applianceService = applianceService;
     _unitOfWork       = unitOfWork;
 }
示例#10
0
 public HomeController(IStripeService stripeService, IAccountService accountService, ITimerScheduleService timerScheduleService, IApplianceService applianceService, IEventService eventService, IAccountApplianceService accountApplianceService, IOptions <AppSetting> appSettings) : base(appSettings.Value)
 {
     this._accountApplianceService = accountApplianceService;
     this._eventService            = eventService;
     this._applianceService        = applianceService;
     this._timerScheduleService    = timerScheduleService;
     this._accountService          = accountService;
     this._stripeService           = stripeService;
 }
 public SetAliasForApplianceRequestHandler(IValidator <SetAliasForApplianceRequest> validator,
                                           IApplianceService applianceService,
                                           IUnitOfWork <ICustomerRepository, Customer> unitOfWork,
                                           IUnitOfWork <IApplianceTypeRepository, ApplianceType> apUnitOfWork)
 {
     _validator        = validator;
     _applianceService = applianceService;
     _unitOfWork       = unitOfWork;
     _apUnitOfWork     = apUnitOfWork;
 }
示例#12
0
 public TelitGatewayController(IStateService stateService, ITimerScheduleService timerScheduleService, IAccountApplianceService accountApplianceService, INotificationPreferenceService notificationPreferenceService, INotificationService notificationService, IEventService eventService, IApplianceService applianceService, IOptions <AppSetting> appSettings) : base(appSettings.Value)
 {
     this._stateService                  = stateService;
     this._accountApplianceService       = accountApplianceService;
     this._applianceService              = applianceService;
     this._eventService                  = eventService;
     this._notificationService           = notificationService;
     this._notificationPreferenceService = notificationPreferenceService;
     this._timerScheduleService          = timerScheduleService;
 }
示例#13
0
 public ApplianceController(IApplianceService applianceService)
 {
     _applianceService = applianceService;
 }
 public CacheCustomerApplianceHistoryJob(IUnitOfWork <ICaretakerRepository, Caretaker> unitOfWork,
                                         IApplianceService applianceService)
 {
     _unitOfWork       = unitOfWork;
     _applianceService = applianceService;
 }
示例#15
0
 public StripeCallBackController(IAccountService accountService, IApplianceService applianceService, IAccountApplianceService accountApplianceService, IOptions <AppSetting> appSettings) : base(appSettings.Value)
 {
     this._accountApplianceService = accountApplianceService;
     this._applianceService        = applianceService;
     this._accountService          = accountService;
 }
示例#16
0
 public GetApplianceActivityRequestHandler(IValidator <GetApplianceActivityRequest> validator, IApplianceService applianceService)
 {
     _validator        = validator;
     _applianceService = applianceService;
 }
示例#17
0
 public MoveController(IMoveService moveService, IApplianceService applianceService, ILabService labService)
 {
     _moveService      = moveService;
     _applianceService = applianceService;
     _labService       = labService;
 }
示例#18
0
 public BackgroundTaskScheduler(IApplianceService applianceService, IBackgroundTaskService taskService, IServiceProvider serviceProvider)
 {
     _applianceService = applianceService;
     _taskService      = taskService;
     _serviceProvider  = serviceProvider;
 }
 public HomeController(IEstateService estates, IApplianceService appliances)
 {
     this.estates = estates;
     this.appliances = appliances;
 }