public TimeMap GetTimeMap() { if (_timeMapInstance == null || IsTimeMapExpired()) { lock (_syncRoot) { if (_timeMapInstance == null || IsTimeMapExpired()) { IOrderUnitOfWork database = _container.Resolve <IOrderUnitOfWork>(); IConfig config = _container.Resolve <IConfig>(); DateTime todayStartDate = DateTimeHelper.GetStartDateOfToday(); DateTime todayEndDate = DateTimeHelper.GetEndDateOfToday(); var todayOrdersMap = database.Orders.Find(o => o.TargetStartDate >= todayStartDate && o.TargetEndDate <= todayEndDate ).ToList <Order>(); var timeMapConfig = new TimeMapConfig(config.WorkingDayStartTime.ToTimeSpan(), config.WorkingDayEndTime.ToTimeSpan(), config.TimeMapTraySize.ToTimeSpan(), config.CookingDelayTime.ToTimeSpan(), config.OrderExpireTime.ToTimeSpan(), config.TimeMapRules.ToList <TimeMapRule>()); _timeMapInstance = new TimeMap(todayOrdersMap, timeMapConfig); database.Dispose(); } } } return(_timeMapInstance); }
public OrderService(IMapper mapper, IOrderUnitOfWork orderUnitOfWork, IAppCacheService appCacheService) { _orderUnitOfWork = orderUnitOfWork; _mapper = mapper; _orderValidator = new OrderServiceValidator(_orderUnitOfWork); _appCacheService = appCacheService; }
private void Refresh(IOrderUnitOfWork orderUnitOfWork) { _orders.Clear(); foreach (var item in orderUnitOfWork.Orders.GetAll()) { _orders.Add(item); } }
public OrderService( IOrderRepository orderRepository, IOrderUnitOfWork orderUnitOfWork ) { this.orderRepository = orderRepository; this.orderUnitOfWork = orderUnitOfWork; }
public AvailableDriverFoundConsumer(IOrderUnitOfWork unitOfWork, IOrderService orderService, IMapper mapper) { _unitOfWork = unitOfWork; _orderService = orderService; _mapper = mapper; }
public SendEmailViewModel(ILoginUnitOfWork loginUnitOfWork, IOrderUnitOfWork orders, OrdersViewModel viewModel, IOrderProcessor processor) { _orderViemModel = viewModel; _users = loginUnitOfWork.Users.GetAll().ToList(); _orderDetails = orders.OrderDetails.GetAll().ToList(); _orders = orders.Orders.GetAll().ToList(); _orderProcessor = processor; _reposiroty = orders; }
private OrdersObservableCollection(IOrderUnitOfWork repository) { _orders = new ObservableCollection <Order>(repository.Orders.GetAll().ToList()); var timer = new System.Windows.Threading.DispatcherTimer(); timer.Interval = new TimeSpan(0, 1, 0); timer.IsEnabled = true; timer.Tick += (o, t) => Refresh(repository); timer.Start(); }
private void Refresh(IOrderUnitOfWork orderUnitOfWork) { SeriesCollection[0].Values.Clear(); var countOrdersPerDayEnumerable = orderUnitOfWork.Orders.GetAll().OrderBy(y => y.DateTime.Date) .GroupBy(x => x.DateTime.Date) .Select(g => new { Count = g.Count() }).ToEnumerable(); foreach (var item in countOrdersPerDayEnumerable) { SeriesCollection[0].Values.Add(item.Count); } }
public StatisticViewModel(int row, IOrderUnitOfWork orderUnitOfWork) { Row = row; CountOrdersPerDay = new ChartValues <int>(); var countOrdersPerDayEnumerable = orderUnitOfWork.Orders.GetAll().OrderBy(y => y.DateTime.Date) .GroupBy(x => x.DateTime.Date) .Select(g => new { Count = g.Count() }).ToEnumerable(); foreach (var item in countOrdersPerDayEnumerable) { CountOrdersPerDay.Add(item.Count); } //var start = DateTime.Now.StartOfWeek(); //var end = DateTime.Now.EndOfWeek(); //.Where(x => x.Date >= start && x.Date <= end) Labels = orderUnitOfWork.Orders.GetAll().OrderBy(y => y.DateTime.Date) .Select(x => x.DateTime.Date.ToString("dd/MM/yyyy")) .Distinct().ToArray(); SeriesCollection = new SeriesCollection() { new LineSeries { Values = CountOrdersPerDay, PointGeometry = DefaultGeometries.Circle, PointGeometrySize = 10, PointForeground = MyColorForPoint } }; YFormatter = value => value.ToString("C"); ((LineSeries)SeriesCollection[0]).Stroke = MyColorForStroke; ((LineSeries)SeriesCollection[0]).Fill = MyColorForFill; var timer = new System.Windows.Threading.DispatcherTimer(); timer.Interval = new TimeSpan(0, 1, 0); timer.IsEnabled = true; timer.Tick += (o, t) => Refresh(orderUnitOfWork); timer.Start(); }
public CartController (IProductRepository productRep, IShoppingCartRepository shoppingCartRep, IOrderUnitOfWork orderUnitOfWork, IConfiguration config, IWebHostEnvironment webHostEnvironment, UserManager <IdentityUser> userManager, IEmailSender emailSender) { _productRep = productRep; _orderUnitOfWork = orderUnitOfWork; _shoppingCartRep = shoppingCartRep; _config = config; _webHostEnvironment = webHostEnvironment; _userManager = userManager; _emailSender = emailSender; }
public MainViewModel(IProductUnitOfWork productUnitOfWork, IOrderUnitOfWork orderUnitOfWork, ILoginUnitOfWork login, IOrderProcessor processor) { OrdersViewModel ordersVM = new OrdersViewModel(orderUnitOfWork, 0); PageViewModels.Add(ordersVM); PageViewModels.Add(new ProductImagesViewModel(productUnitOfWork, 1)); PageViewModels.Add(new ProductsViewModel(productUnitOfWork, 2)); PageViewModels.Add(new ProductSizesViewModel(productUnitOfWork, 3)); PageViewModels.Add(new StatisticViewModel(4, orderUnitOfWork)); CurrentPageViewModel = PageViewModels[0]; AddViews.Add(this); AddViews.Add(new SendEmailViewModel(login, orderUnitOfWork, ordersVM, processor)); AddViews.Add(new AddNewImageViewModel(productUnitOfWork, this)); AddViews.Add(new AddNewSizeViewModel(productUnitOfWork, this)); AddViews.Add(new AddProductViewModel(productUnitOfWork, this)); AddViews.Add(new StatisticRightViewModel(orderUnitOfWork)); CurrentAddView = AddViews[1]; CloseWindowCommand = new RelayCommand(x => CloseWindow((ICloseable)x)); }
public OrderService(IOrderUnitOfWork ordersDatabase, IContactService contactService, ITimeMapService timeMapService, IConfig config, OrderFactory orderFactory) { if (ordersDatabase == null) { throw new ArgumentNullException(nameof(ordersDatabase)); } _ordersDatabase = ordersDatabase; if (contactService == null) { throw new ArgumentNullException(nameof(contactService)); } _contactService = contactService; if (timeMapService == null) { throw new ArgumentNullException(nameof(timeMapService)); } _timeMapService = timeMapService; if (config == null) { throw new ArgumentNullException(nameof(config)); } _config = config; if (orderFactory == null) { throw new ArgumentNullException(nameof(orderFactory)); } _orderFactory = orderFactory; }
public static ViewManager GetInstance(ILoginUnitOfWork loginUnitOfWork, IProductUnitOfWork productUnitOfWork, IOrderUnitOfWork orderUnitOfWork, IOrderProcessor processor) { if (_instance == null) { _instance = new ViewManager(loginUnitOfWork, productUnitOfWork, orderUnitOfWork, processor); } return(_instance); }
public OrderIncomeInvoiceQueryHandler(IOrderUnitOfWork unitOfWork) { _unitOfWork = unitOfWork; }
public AppView(ILoginUnitOfWork loginUnitOfWork, IProductUnitOfWork productUnitOfWork, IOrderUnitOfWork orderUnitOfWork, IOrderProcessor processor) { InitializeComponent(); DataContext = ViewManager.GetInstance(loginUnitOfWork, productUnitOfWork, orderUnitOfWork, processor); }
public OrderServiceValidator(IOrderUnitOfWork orderUnitOfWork) { _orderUnitOfWork = orderUnitOfWork; }
/// <summary> /// Initializes a new instance of the <seealso cref="OrderController"/> class. /// </summary> /// <param name="unitOfWork"></param> public OrderController(IOrderUnitOfWork unitOfWork) { _unitOfWork = unitOfWork; }
public RideFinishedConsumer(IOrderUnitOfWork unitOfWork, IOrderService orderService) { _unitOfWork = unitOfWork; _orderService = orderService; }
public OrdersQueryHandler(IOrderUnitOfWork unitOfWork) { _unitOfWork = unitOfWork; }
public OrderService(IOrderUnitOfWork unitOfWork, IMapper mapper, ILogger <OrderService> logger) { _unitOfWork = unitOfWork; _mapper = mapper; _logger = logger; }
public AccountController(IOrderUnitOfWork orderUnitOfWork) { _orderUnitOfWork = orderUnitOfWork; }
public OrderRepository(IOrderUnitOfWork unitOfWork) : base(unitOfWork) { }
/// <summary> /// Constructor for OrderService. /// </summary> /// <param name="orderUnitOfWork"></param> /// <param name="orderProductUnitOfWork"></param> public OrderService(IOrderUnitOfWork <OrderEntity> orderUnitOfWork, IOrderProductUnitOfWork <OrderProductEntity> orderProductUnitOfWork) { this._orderUnitOfWork = orderUnitOfWork; this._orderProductUnitOfWork = orderProductUnitOfWork; }
public OrderPaymentInvoiceQueryHandler(IOrderUnitOfWork unitOfWork) { _unitOfWork = unitOfWork; }
public GridController(IOrderUnitOfWork work, IHostingEnvironment hostingEnvironment) { this.work = work; _hostingEnvironment = hostingEnvironment; }
public OrderCancelledConsumer(IOrderUnitOfWork unitOfWork) { _unitOfWork = unitOfWork; }
private ViewManager(ILoginUnitOfWork loginUnitOfWork, IProductUnitOfWork productUnitOfWork, IOrderUnitOfWork orderUnitOfWork, IOrderProcessor processor) { PageViewModels.Add(new LoginViewModel(loginUnitOfWork)); PageViewModels.Add(new MainViewModel(productUnitOfWork, orderUnitOfWork, loginUnitOfWork, processor)); CurrentPageViewModel = PageViewModels[0]; }
public static OrdersObservableCollection GetInstance(IOrderUnitOfWork repository) { return(_instance ?? (_instance = new OrdersObservableCollection(repository))); }
public OrdersViewModel(IOrderUnitOfWork repository, int row) { _orders = OrdersObservableCollection.GetInstance(repository); Row = row; _orderDetails = repository.OrderDetails.GetAll().ToList(); }
public CheckoutController(IOrderUnitOfWork orderUnitOfWork) { _orderUnitOfWork = orderUnitOfWork; }