Ejemplo n.º 1
0
        public DashboardViewModel(
            IServiceBundle serviceBundle,
            ISalesOrderRepository salesOrderRepository,
            IInboundShipmentRepository inboundShipmentRepository,
            ISalesOrderWorkItemRepository salesOrderWorkItemRepository,
            ISalesOrderItemRepository salesOrderItemRepository,
            IInboundTransferRepository inboundTransferRepository,
            IConfigurationService configurationService,
            ICloudService cloudService,
            INetworkService networkService,
            ISyncService syncService,
            ILogService logService
            ) : base(serviceBundle)
        {
            _configurationService         = configurationService;
            _cloudService                 = cloudService;
            _networkService               = networkService;
            _syncService                  = syncService;
            _logService                   = logService;
            _salesOrderRepository         = salesOrderRepository;
            _inboundShipmentRepository    = inboundShipmentRepository;
            _salesOrderWorkItemRepository = salesOrderWorkItemRepository;
            _salesOrderItemRepository     = salesOrderItemRepository;
            _inboundTransferRepository    = inboundTransferRepository;

            SubscribeToEvents();
        }
Ejemplo n.º 2
0
 public TestMocks()
 {
     Logger               = Substitute.For <ILogger>();
     PriceService         = Substitute.For <IPriceService>();
     DiscountsService     = Substitute.For <IDiscountsService>();
     SalesOrderRepository = Substitute.For <ISalesOrderRepository>();
 }
        public FrmInputSalesOrder()
        {
            InitializeComponent();

            productRepo    = new ProductRepository(Program.log);
            salesOrderRepo = new SalesOrderRepository(Program.log);
        }
Ejemplo n.º 4
0
 public SalesController(ISalesIndentRepository indrepo,
                        ISalesIndentItemRepository inditemrepo,
                        ISalesOrderRepository order,
                        ISalesOrderItemRepository orderitem,
                        IDeliveryOrderRepository Deliveryorder,
                        IDeliveryOrderItemRepository Deliveryorderitem,
                        IDeliveryChallanRepository challan,
                        ISalesInvoiceRepository invoicerepo,
                        ISalesReturnRepository retrn,
                        ISalesReturnItemRepository returnitem,
                        IInventoryItemRepository itemrepo,
                        IDistributorRepository disrepo)
 {
     ind_repo               = indrepo;
     ind_item_repo          = inditemrepo;
     order_repo             = order;
     orderitem_repo         = orderitem;
     Deliveryorder_repo     = Deliveryorder;
     Deliveryorderitem_repo = Deliveryorderitem;
     challan_repo           = challan;
     Invoice_repo           = invoicerepo;
     return_repo            = retrn;
     returnitem_repo        = returnitem;
     item_repo              = itemrepo;
     dis_repo               = disrepo;
 }
        public async Task IssueCustomerInfoUpdateNotification(ISalesOrderRepository salesOrderRepository, string salesOrderNumber)
        {
            var salesOrder = await salesOrderRepository.TryGetSalesOrder(salesOrderNumber).ConfigureAwait(false);

            if (
                salesOrder == null ||
                string.IsNullOrWhiteSpace(salesOrder.CustomerMobileNumber)
                )
            {
                return;
            }

            var customerInfoUpdate       = BuildCustomerInfoUpdateRecord(salesOrder);
            var customerInfoUpdateString = JsonConvert.SerializeObject(customerInfoUpdate);

            if (_networkService.IsConnected)
            {
                //await SendMessage(customerInfoUpdateString).ConfigureAwait(false);
                await ProcessUnsentCustomerInfoUpdateNotification().ConfigureAwait(false);
            }
            else
            {
                await _customerInfoUpdateRepository.CreateAsync(new CustomerInfoUpdateString { Body = customerInfoUpdateString }).ConfigureAwait(false);
            }
        }
Ejemplo n.º 6
0
 public OrderProcessor(
     ISalesOrderRepository orderRepository,
     IOrderHistoryRepository orderHistoryRepository)
 {
     this.orderRepository        = orderRepository;
     this.orderHistoryRepository = orderHistoryRepository;
 }
        public async Task IssueSalesOrderUpdateNotification(
            ISalesOrderRepository salesOrderRepository,
            SalesOrderWorkItem salesOrderWorkItem,
            SalesOrderWorkflow workflow,
            decimal itemQuantity,
            decimal updatedItemQuantity)
        {
            var salesOrder = await salesOrderRepository.TryGetSalesOrder(salesOrderWorkItem.SalesOrderNumber).ConfigureAwait(false);

            var branchId = _configurationService.GetString(Config.BranchId);
            var branch   = await _branchRepository.ReadAsync(b => b.BranchId == branchId).ConfigureAwait(false);

            var salesOrderUpdateNotice = BuildEmailRecord(
                salesOrderWorkItem,
                workflow,
                itemQuantity,
                updatedItemQuantity,
                branch.BranchEmail,
                branch.BranchSvcRepEmail,
                salesOrder.SalesRepEmail
                );
            var emailString = JsonConvert.SerializeObject(salesOrderUpdateNotice);

            if (_networkService.IsConnected)
            {
                //await SendMessage(emailString).ConfigureAwait(false);
                await ProcessUnsentSalesOrderUpdateNotification().ConfigureAwait(false);
            }
            else
            {
                await _salesOrderUpdateNoticeRepository.CreateAsync(new SalesOrderUpdateNoticeString { Body = emailString }).ConfigureAwait(false);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 初始化一个<c>OrderServiceImpl</c>类型的实例。
        /// </summary>
        /// <param name="context">用来初始化<c>OrderServiceImpl</c>类型的仓储上下文实例。</param>
        /// <param name="shoppingCartRepository">“购物篮”仓储实例。</param>
        /// <param name="shoppingCartItemRepository">“购物篮项目”仓储实例。</param>
        /// <param name="productRepository">“笔记本电脑”仓储实例。</param>
        /// <param name="customerRepository">“客户”仓储实例。</param>
        /// <param name="salesOrderRepository">“销售订单”仓储实例。</param>
        public OrderServiceImpl(IRepositoryContext context,
                                IShoppingCartRepository shoppingCartRepository,
                                IShoppingCartItemRepository shoppingCartItemRepository,
                                IProductRepository productRepository,
                                IUserRepository customerRepository,
                                ISalesOrderRepository salesOrderRepository,
                                IDomainService domainService,
                                IDomainEventHandler <OrderDispatchedEvent>[] orderDispatchedDomainEventHandlers)
            : base(context)
        {
            this.shoppingCartRepository     = shoppingCartRepository;
            this.shoppingCartItemRepository = shoppingCartItemRepository;
            this.productRepository          = productRepository;
            this.userRepository             = customerRepository;
            this.salesOrderRepository       = salesOrderRepository;
            this.domainService = domainService;
            this.orderDispatchedDomainEventHandlers.AddRange(orderDispatchedDomainEventHandlers);

            foreach (var handler in this.orderDispatchedDomainEventHandlers)
            {
                DomainEventAggregator.Subscribe <OrderDispatchedEvent>(handler);
            }
            DomainEventAggregator.Subscribe <OrderConfirmedEvent>(orderConfirmedEventHandlerAction);
            DomainEventAggregator.Subscribe <OrderConfirmedEvent>(orderConfirmedEventHandlerAction2);
        }
 public BuildInvoice(ISalesOrderRepository salesOrderRepository, IInvoiceRepository invoiceRepository, IReportBuilderFactory reportBuilderFactory, ITemplateProvider templateProvider)
 {
     _salesOrderRepository = salesOrderRepository;
     _invoiceRepository    = invoiceRepository;
     _reportBuilderFactory = reportBuilderFactory;
     _templateProvider     = templateProvider;
 }
        /// <inheritdoc />
        public async Task <SalesOrderWorkItem> TryUpsertSalesOrderWorkItem(
            ISalesOrderRepository salesOrderRepository,
            ISalesOrderItemRepository salesOrderItemRepository,
            ILotRepository lotRepository,
            SalesOrderWorkflow workflow,
            string salesOrderNumber,
            string salesOrderItemNumber,
            int seq,
            string salesOrderItemLotNumber,
            string updatedLotNumber,
            decimal itemQuantity,
            decimal updatedItemQuantity,
            decimal quantityTaken,
            string salesOrderWorkItemId = null)
        {
            SalesOrderWorkItem salesOrderWorkItem;

            if (!string.IsNullOrWhiteSpace(salesOrderWorkItemId))
            {
                salesOrderWorkItem = await TryUpdateSalesOrderWorkItem(
                    workflow,
                    salesOrderWorkItemId,
                    updatedLotNumber,
                    updatedItemQuantity,
                    quantityTaken
                    ).ConfigureAwait(false);
            }
            else
            {
                salesOrderWorkItem = await TryCreateSalesOrderWorkItem(
                    salesOrderRepository,
                    salesOrderItemRepository,
                    lotRepository,
                    salesOrderNumber,
                    salesOrderItemNumber,
                    seq,
                    salesOrderItemLotNumber,
                    updatedLotNumber,
                    itemQuantity,
                    updatedItemQuantity,
                    quantityTaken
                    ).ConfigureAwait(false);
            }

            if (itemQuantity != updatedItemQuantity)
            {
                //await _syncService.SyncWithRemoteAsync().ConfigureAwait(false);

                await _salesOrderUpdateNotificationRepository.IssueSalesOrderUpdateNotification(
                    salesOrderRepository,
                    salesOrderWorkItem,
                    workflow,
                    itemQuantity,
                    updatedItemQuantity
                    ).ConfigureAwait(false);
            }

            return(salesOrderWorkItem);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// 初始化一个<c>OrderServiceImpl</c>类型的实例。
 /// </summary>
 /// <param name="context">用来初始化<c>OrderServiceImpl</c>类型的仓储上下文实例。</param>
 /// <param name="shoppingCartRepository">“购物篮”仓储实例。</param>
 /// <param name="shoppingCartItemRepository">“购物篮项目”仓储实例。</param>
 /// <param name="productRepository">“笔记本电脑”仓储实例。</param>
 /// <param name="customerRepository">“客户”仓储实例。</param>
 /// <param name="salesOrderRepository">“销售订单”仓储实例。</param>
 public OrderService(IRepositoryContext context,
                     ISalesOrderRepository salesOrderRepository,
                     IEventBus bus)
     : base(context, bus)
 {
     this.salesOrderRepository = salesOrderRepository;
     this.bus = bus;
 }
Ejemplo n.º 12
0
 public SalesOrderService(ISalesOrderRepository salesOrderRepository,
                          ISalesOrderDetailRepository salesOrderDetailRepository,
                          ICustomerRepository customerRepository)
 {
     this.Dal = salesOrderRepository;
     this.salesOrderRepository       = salesOrderRepository;
     this.salesOrderDetailRepository = salesOrderDetailRepository;
     this.customerRepository         = customerRepository;
 }
Ejemplo n.º 13
0
 public DeliverViewModel(
     IServiceBundle serviceBundle,
     ISalesOrderWorkItemRepository salesOrderWorkItemRepository,
     ISalesOrderRepository salesOrderRepository
     ) : base(serviceBundle)
 {
     _salesOrderWorkItemRepository = salesOrderWorkItemRepository;
     _salesOrderRepository         = salesOrderRepository;
 }
Ejemplo n.º 14
0
        public FrmSalesOrder()
        {
            InitializeComponent();

            salesOrderRepo = new SalesOrderRepository(Program.log);
            listSO         = salesOrderRepo.GetAll();
            salesOrderBindingSource.DataSource = listSO;

            salesOrderBindingSource.AddNew();
        }
Ejemplo n.º 15
0
 public OrderService(
     ISalesOrderRepository saleOrderRepository,
     IMediator mediator,
     IHttpContextAccessor httpContextAccessor,
     IUserRepository userRepository,
     UserManager <ApplicationUser> userManager
     ) : base(mediator, httpContextAccessor, userRepository, userManager)
 {
     _saleOrderRepository = saleOrderRepository;
 }
Ejemplo n.º 16
0
 // TODO : 1) How to create instance of repo not using cotroller constructor ? ( using new instance of repo in each action method)
 public MainController( IProductRepository productRepoParam, 
                        ISalesOrderRepository salesOrderRepoParam, 
                        ISalesOrderDetailRepository salesOrderDetailRepoParam,
                        IButtonRepository btnRepoParam
                      )
 {
     this.productRepo = productRepoParam;
     this.soRepo = salesOrderRepoParam;
     this.soDetailRepo = salesOrderDetailRepoParam;
     this.btnRepo = btnRepoParam;
 }
Ejemplo n.º 17
0
 public AccountController(
     IPersonRepository personRepository,
     IShoppingCartRepository shoppingCartRepository,
     ISalesOrderRepository orderRepository,
     IStateProvinceRepository stateProvinceRepository)
 {
     this.personRepository        = personRepository;
     this.shoppingCartRepository  = shoppingCartRepository;
     this.orderRepository         = orderRepository;
     this.stateProvinceRepository = stateProvinceRepository;
 }
Ejemplo n.º 18
0
 /// <summary>
 /// 初始化一个新的<c>DomainService</c>类型的实例。
 /// </summary>
 /// <param name="repositoryContext">仓储上下文。</param>
 /// <param name="categorizationRepository">商品分类关系仓储。</param>
 /// <param name="userRoleRepository">用户角色关系仓储。</param>
 /// <param name="shoppingCartItemRepository">购物篮项目仓储。</param>
 /// <param name="salesOrderRepository">销售订单仓储。</param>
 public DomainService(IRepositoryContext repositoryContext,
                      ICategorizationRepository categorizationRepository,
                      IUserRoleRepository userRoleRepository,
                      IShoppingCartItemRepository shoppingCartItemRepository,
                      ISalesOrderRepository salesOrderRepository)
 {
     _repositoryContext          = repositoryContext;
     _categorizationRepository   = categorizationRepository;
     _userRoleRepository         = userRoleRepository;
     _shoppingCartItemRepository = shoppingCartItemRepository;
     _salesOrderRepository       = salesOrderRepository;
 }
 public CustomerInfoViewModel(
     IRepository <SalesOrder> repository,
     IServiceBundle serviceBundle,
     ISalesOrderRepository salesOrderRepository,
     ICustomerInfoRepository customerInfoRepositoy,
     ISyncService syncService
     ) : base(serviceBundle)
 {
     _repository             = repository;
     _salesOrderRepository   = salesOrderRepository;
     _customerInfoRepository = customerInfoRepositoy;
 }
Ejemplo n.º 20
0
 /// <summary>
 /// 初始化一个新的<c>DomainService</c>类型的实例。
 /// </summary>
 /// <param name="repositoryContext">仓储上下文。</param>
 /// <param name="categorizationRepository">商品分类关系仓储。</param>
 /// <param name="userRoleRepository">用户角色关系仓储。</param>
 /// <param name="shoppingCartItemRepository">购物篮项目仓储。</param>
 /// <param name="salesOrderRepository">销售订单仓储。</param>
 public DomainService(IRepositoryContext repositoryContext,
     ICategorizationRepository categorizationRepository,
     IUserRoleRepository userRoleRepository,
     IShoppingCartItemRepository shoppingCartItemRepository,
     ISalesOrderRepository salesOrderRepository)
 {
     _repositoryContext = repositoryContext;
     _categorizationRepository = categorizationRepository;
     _userRoleRepository = userRoleRepository;
     _shoppingCartItemRepository = shoppingCartItemRepository;
     _salesOrderRepository = salesOrderRepository;
 }
Ejemplo n.º 21
0
 public SalesController(ISalesOrderRepository salesOrderRepository, ISaleBoxRepository saleBoxRepository,
                        InventoryManagement inventoryManagement, IClientRepository clientRepository,
                        OpenBox openBox, EmployeeLogin employeeLogin, RagnarokContext context)
 {
     _salesOrderRepository = salesOrderRepository;
     _saleBoxRepository    = saleBoxRepository;
     _clientRepository     = clientRepository;
     _inventoryManagement  = inventoryManagement;
     _openBox       = openBox;
     _employeeLogin = employeeLogin;
     _context       = context;
 }
Ejemplo n.º 22
0
 public ARResearchService()
 {
     _invoiceRepository       = new InvoiceRepository(context);
     _salesOrderRepository    = new SalesOrderRepository(context);
     _cpSalesOrderRepository  = new CPSalesOrderRepository(context);
     _shipmentRepository      = new ShipmentRepository(context);
     _custPaymentRepository   = new CustPaymentRepository(context);
     _ccTransactionRepository = new CCTransactionRepository(context);
     creditCardRepository     = new CreditCardRepository(context);
     shipmentBatchRepository  = new ShipmentBatchRepository(context);
     memoRemarkRepository     = new MemoRemarkRepository(context);
 }
 public PickViewModel(
     IServiceBundle serviceBundle,
     ISalesOrderWorkItemRepository salesOrderWorkItemRepository,
     ISalesOrderItemRepository salesOrderItemRepository,
     ISalesOrderRepository salesOrderRepository,
     ILogService logService
     ) : base(serviceBundle)
 {
     _salesOrderWorkItemRepository = salesOrderWorkItemRepository;
     _salesOrderItemRepository     = salesOrderItemRepository;
     _salesOrderRepository         = salesOrderRepository;
     _logService = logService;
 }
Ejemplo n.º 24
0
 public SalesOrderDetailsEditViewModel(
     IServiceBundle serviceBundle,
     ISalesOrderWorkItemRepository salesOrderWorkItemRepository,
     ISalesOrderItemRepository salesOrderItemRepository,
     ISalesOrderRepository salesOrderRepository,
     ILotRepository lotRepository
     ) : base(serviceBundle)
 {
     _salesOrderWorkItemRepository = salesOrderWorkItemRepository;
     _salesOrderItemRepository     = salesOrderItemRepository;
     _salesOrderRepository         = salesOrderRepository;
     _lotRepository = lotRepository;
 }
        public SalesOrderService(IUnitOfWork unitOfWork,
                                 ISalesOrderRepository salesOrderRepository,
                                 ICurrencyRepository currencyRepository,
                                 IBusinessPartnerRepository businessPartnerRepository)
        {
            _salesOrderRepository            = salesOrderRepository;
            _salesOrderRepository.UnitOfWork = unitOfWork;

            _currencyRepository            = currencyRepository;
            _currencyRepository.UnitOfWork = unitOfWork;

            _businessPartnerRepository            = businessPartnerRepository;
            _businessPartnerRepository.UnitOfWork = unitOfWork;
        }
Ejemplo n.º 26
0
 public TutorService(
     ITutorRepository tutorRepository,
     ICourseRepository courseRepository,
     ISalesOrderRepository salesOrderRepository,
     IMediator mediator,
     IHttpContextAccessor httpContextAccessor,
     IUserRepository userRepository,
     UserManager <ApplicationUser> userManager
     ) : base(mediator, httpContextAccessor, userRepository, userManager)
 {
     _tutorRepository      = tutorRepository;
     _courseRepository     = courseRepository;
     _salesOrderRepository = salesOrderRepository;
 }
        public async Task IssueDeliveryNotification(
            ISalesOrderWorkItemRepository salesOrderWorkItemRepository,
            ISalesOrderRepository salesOrderRepository,
            string salesOrderNumber,
            bool sendToCustomer,
            bool sendToSalesRep
            )
        {
            var salesOrder = await salesOrderRepository.TryGetSalesOrder(salesOrderNumber).ConfigureAwait(false);

            if (
                salesOrder == null ||
                (string.IsNullOrWhiteSpace(salesOrder.SalesRepMobileNumber) &&
                 (string.IsNullOrWhiteSpace(salesOrder.CustomerMobileNumber)))
                )
            {
                return;
            }

            var workItems = await salesOrderWorkItemRepository.TryGetSalesOrderWorkItems(salesOrderNumber).ConfigureAwait(false);

            // No work items (weird), do nothing.
            if (workItems.Count == 0)
            {
                return;
            }

            var notesWorkItemTable = await PinnacleApp.Get <ICloudService>().GetTableAsync <NoteWorkItem>();

            var noteItems = (await notesWorkItemTable.ReadItemsAsync(
                                 0,
                                 int.MaxValue,
                                 item => item.NoteParentFk == salesOrderNumber
                                 ).ConfigureAwait(false)).ToList();

            var salesOrderDelivery = BuildDeliveryRecord(salesOrder, workItems, noteItems, sendToCustomer, sendToSalesRep);

            var deliveryString = JsonConvert.SerializeObject(salesOrderDelivery);

            if (_networkService.IsConnected)
            {
                //await SendMessage(deliveryString).ConfigureAwait(false);
                await ProcessUnsentDeliveryNotification().ConfigureAwait(false);
            }
            else
            {
                await _salesOrderDeliveryRepository.CreateAsync(new SalesOrderDeliveryString { Body = deliveryString }).ConfigureAwait(false);
            }
        }
Ejemplo n.º 28
0
 public SalesOrderDetailsViewModel(
     IServiceBundle serviceBundle,
     ISalesOrderRepository salesOrderRepository,
     ISalesOrderItemRepository salesOrderItemRepository,
     ISalesOrderWorkItemRepository salesOrderWorkItemRepository,
     ILotRepository lotRepository,
     ISyncService syncService
     ) : base(serviceBundle)
 {
     _salesOrderRepository         = salesOrderRepository;
     _salesOrderItemRepository     = salesOrderItemRepository;
     _salesOrderWorkItemRepository = salesOrderWorkItemRepository;
     _lotRepository = lotRepository;
     _syncService   = syncService;
 }
 public DeliverSalesOrderConfirmViewModel(
     IServiceBundle serviceBundle,
     ISalesOrderWorkItemRepository salesOrderWorkItemRepository,
     ISignatureWorkItemRepository signatureWorkItemRepository,
     ISalesOrderRepository salesOrderRepository,
     ISalesOrderDeliveryNotificationRepository salesOrderDeliveryNotificationRepositoy,
     ISyncService syncService
     ) : base(serviceBundle)
 {
     _salesOrderWorkItemRepository            = salesOrderWorkItemRepository;
     _signatureWorkItemRepository             = signatureWorkItemRepository;
     _salesOrderRepository                    = salesOrderRepository;
     _salesOrderDeliveryNotificationRepositoy = salesOrderDeliveryNotificationRepositoy;
     _syncService = syncService;
 }
Ejemplo n.º 30
0
 /// <summary>
 /// 初始化一个<c>OrderServiceImpl</c>类型的实例。
 /// </summary>
 /// <param name="context">用来初始化<c>OrderServiceImpl</c>类型的仓储上下文实例。</param>
 /// <param name="shoppingCartRepository">“购物篮”仓储实例。</param>
 /// <param name="shoppingCartItemRepository">“购物篮项目”仓储实例。</param>
 /// <param name="productRepository">“笔记本电脑”仓储实例。</param>
 /// <param name="customerRepository">“客户”仓储实例。</param>
 /// <param name="salesOrderRepository">“销售订单”仓储实例。</param>
 public OrderServiceImpl(IRepositoryContext context,
     IShoppingCartRepository shoppingCartRepository,
     IShoppingCartItemRepository shoppingCartItemRepository,
     IProductRepository productRepository,
     IUserRepository customerRepository,
     ISalesOrderRepository salesOrderRepository,
     IDomainService domainService)
     : base(context)
 {
     this.shoppingCartRepository = shoppingCartRepository;
     this.shoppingCartItemRepository = shoppingCartItemRepository;
     this.productRepository = productRepository;
     this.userRepository = customerRepository;
     this.salesOrderRepository = salesOrderRepository;
     this.domainService = domainService;
 }
Ejemplo n.º 31
0
 public SalesOrderServices(
     ISalesOrderRepository salesOrderRepository,
     ICouponRepository couponRepository,
     IShoppingCartRepository shoppingCartRepository,
     IOptions <PaymentProcessConfig> paymentProcessConfigs,
     IMediator mediator,
     IHttpContextAccessor httpContextAccessor,
     IUserRepository userRepository,
     UserManager <ApplicationUser> userManager
     ) : base(mediator, httpContextAccessor, userRepository, userManager)
 {
     _salesOrderRepository   = salesOrderRepository;
     _couponRepository       = couponRepository;
     _shoppingCartRepository = shoppingCartRepository;
     _paymentProcessConfigs  = paymentProcessConfigs.Value;
 }
Ejemplo n.º 32
0
 /// <summary>
 /// 初始化一个新的<c>UserServiceImpl</c>实例。
 /// </summary>
 /// <param name="context"></param>
 /// <param name="userRepository"></param>
 /// <param name="userRoleRepository"></param>
 /// <param name="roleRepository"></param>
 /// <param name="shoppingCartRepository"></param>
 /// <param name="salesOrderRepository"></param>
 /// <param name="domainService"></param>
 public UserServiceImpl(IRepositoryContext context,
                        IUserRepository userRepository,
                        IUserRoleRepository userRoleRepository,
                        IRoleRepository roleRepository,
                        IShoppingCartRepository shoppingCartRepository,
                        ISalesOrderRepository salesOrderRepository,
                        IDomainService domainService)
     : base(context)
 {
     this.userRepository         = userRepository;
     this.userRoleRepository     = userRoleRepository;
     this.roleRepository         = roleRepository;
     this.shoppingCartRepository = shoppingCartRepository;
     this.salesOrderRepository   = salesOrderRepository;
     this.domainService          = domainService;
 }
Ejemplo n.º 33
0
 /// <summary>
 /// 初始化一个新的<c>UserServiceImpl</c>实例。
 /// </summary>
 /// <param name="context"></param>
 /// <param name="userRepository"></param>
 /// <param name="userRoleRepository"></param>
 /// <param name="roleRepository"></param>
 /// <param name="shoppingCartRepository"></param>
 /// <param name="salesOrderRepository"></param>
 /// <param name="domainService"></param>
 public UserServiceImpl(IRepositoryContext context,
     IUserRepository userRepository,
     IUserRoleRepository userRoleRepository,
     IRoleRepository roleRepository,
     IShoppingCartRepository shoppingCartRepository,
     ISalesOrderRepository salesOrderRepository,
     IDomainService domainService)
     : base(context)
 {
     this.userRepository = userRepository;
     this.userRoleRepository = userRoleRepository;
     this.roleRepository = roleRepository;
     this.shoppingCartRepository = shoppingCartRepository;
     this.salesOrderRepository = salesOrderRepository;
     this.domainService = domainService;
 }
Ejemplo n.º 34
0
 public ShoppingCartServices(
     IShoppingCartRepository shoppingCartRepository,
     ISalesOrderRepository salesOrderRepository,
     ICourseRepository courseRepository,
     ICouponRepository couponRepository,
     IMediator mediator,
     IHttpContextAccessor httpContextAccessor,
     IUserRepository userRepository,
     UserManager <ApplicationUser> userManager
     ) : base(mediator, httpContextAccessor, userRepository, userManager)
 {
     _shoppingCartRepository = shoppingCartRepository;
     _salesOrderRepository   = salesOrderRepository;
     _courseRepository       = courseRepository;
     _couponRepository       = couponRepository;
 }
 /// <summary>
 /// 初始化一个<c>OrderServiceImpl</c>类型的实例。
 /// </summary>
 /// <param name="context">用来初始化<c>OrderServiceImpl</c>类型的仓储上下文实例。</param>
 /// <param name="shoppingCartRepository">“购物篮”仓储实例。</param>
 /// <param name="shoppingCartItemRepository">“购物篮项目”仓储实例。</param>
 /// <param name="productRepository">“笔记本电脑”仓储实例。</param>
 /// <param name="customerRepository">“客户”仓储实例。</param>
 /// <param name="salesOrderRepository">“销售订单”仓储实例。</param>
 /// <param name="domainService">领域服务实例</param>
 /// <param name="bus">事件总线实例</param>
 public OrderServiceImpl(IRepositoryContext context,
     IShoppingCartRepository shoppingCartRepository,
     IShoppingCartItemRepository shoppingCartItemRepository,
     IProductRepository productRepository,
     IUserRepository customerRepository,
     ISalesOrderRepository salesOrderRepository,
     IDomainService domainService,
     IEventBus bus)
     : base(context)
 {
     _shoppingCartRepository = shoppingCartRepository;
     _shoppingCartItemRepository = shoppingCartItemRepository;
     _productRepository = productRepository;
     _userRepository = customerRepository;
     _salesOrderRepository = salesOrderRepository;
     _domainService = domainService;
     _bus = bus;
 }
Ejemplo n.º 36
0
 /// <summary>
 /// 初始化一个新的<c>DomainService</c>类型的实例。
 /// </summary>
 /// <param name="repositoryContext">仓储上下文。</param>
 /// <param name="productRepository">商品仓储。</param>
 /// <param name="categoryRepository">商品分类仓储。</param>
 /// <param name="categorizationRepository">商品分类关系仓储。</param>
 /// <param name="userRepository">用户仓储。</param>
 /// <param name="roleRepository">角色仓储。</param>
 /// <param name="userRoleRepository">用户角色关系仓储。</param>
 /// <param name="shoppingCartItemRepository">购物篮项目仓储。</param>
 /// <param name="salesOrderRepository">销售订单仓储。</param>
 public DomainService(IRepositoryContext repositoryContext,
     IProductRepository productRepository,
     ICategoryRepository categoryRepository,
     ICategorizationRepository categorizationRepository,
     IUserRepository userRepository,
     IRoleRepository roleRepository,
     IUserRoleRepository userRoleRepository,
     IShoppingCartItemRepository shoppingCartItemRepository,
     ISalesOrderRepository salesOrderRepository)
 {
     this.repositoryContext = repositoryContext;
     this.productRepository = productRepository;
     this.categoryRepository = categoryRepository;
     this.categorizationRepository = categorizationRepository;
     this.userRepository = userRepository;
     this.roleRepository = roleRepository;
     this.userRoleRepository = userRoleRepository;
     this.shoppingCartItemRepository = shoppingCartItemRepository;
     this.salesOrderRepository = salesOrderRepository;
 }
Ejemplo n.º 37
0
        /// <summary>
        /// 初始化一个<c>OrderServiceImpl</c>类型的实例。
        /// </summary>
        /// <param name="context">用来初始化<c>OrderServiceImpl</c>类型的仓储上下文实例。</param>
        /// <param name="shoppingCartRepository">“购物篮”仓储实例。</param>
        /// <param name="shoppingCartItemRepository">“购物篮项目”仓储实例。</param>
        /// <param name="productRepository">“笔记本电脑”仓储实例。</param>
        /// <param name="customerRepository">“客户”仓储实例。</param>
        /// <param name="salesOrderRepository">“销售订单”仓储实例。</param>
        public OrderServiceImpl(IRepositoryContext context,
            IShoppingCartRepository shoppingCartRepository,
            IShoppingCartItemRepository shoppingCartItemRepository,
            IProductRepository productRepository,
            IUserRepository customerRepository,
            ISalesOrderRepository salesOrderRepository,
            IDomainService domainService,
            IDomainEventHandler<OrderDispatchedEvent>[] orderDispatchedDomainEventHandlers)
            :base(context)
        {
            this.shoppingCartRepository = shoppingCartRepository;
            this.shoppingCartItemRepository = shoppingCartItemRepository;
            this.productRepository = productRepository;
            this.userRepository = customerRepository;
            this.salesOrderRepository = salesOrderRepository;
            this.domainService = domainService;
            this.orderDispatchedDomainEventHandlers.AddRange(orderDispatchedDomainEventHandlers);

            foreach (var handler in this.orderDispatchedDomainEventHandlers)
                DomainEventAggregator.Subscribe<OrderDispatchedEvent>(handler);
            DomainEventAggregator.Subscribe<OrderConfirmedEvent>(orderConfirmedEventHandlerAction);
            DomainEventAggregator.Subscribe<OrderConfirmedEvent>(orderConfirmedEventHandlerAction2);
        }
Ejemplo n.º 38
0
 public SalesOrderPresenter(ISalesOrderView view, ICustomerRepository customerRepository, ISalesOrderRepository salesOrderRepository)
 {
     this.view = view;
     this.customerRepository = customerRepository;
     this.salesOrderRepository = salesOrderRepository;
 }
 public DailySalesReportService(ISalesOrderRepository salesOrderRepository, IUnitOfWork unitOfWork)
 {
     this._SalesOrderRepository = salesOrderRepository;
     this._UnitOfWork = unitOfWork;
 }
Ejemplo n.º 40
0
 public AdminController(IProductRepository productRepoParam, ISalesOrderRepository salesOrderRepoParam, ISalesOrderDetailRepository salesOrderDetailRepoParam)
 {
     this.productRepo = productRepoParam;
     this.soRepo = salesOrderRepoParam;
     this.soDetailRepo = salesOrderDetailRepoParam;
 }
Ejemplo n.º 41
0
 public void Inject(ICustomerRepository customerRepository, ISalesOrderRepository salesOrderRepository)
 {
     this.presenter = new SalesOrderPresenter(this, customerRepository, salesOrderRepository);
 }
 public SalesOrderService(ISalesOrderRepository SalesOrderRepository, IUnitOfWork unitOfWork)
 {
     this.SalesOrderRepository = SalesOrderRepository;
     this.unitOfWork = unitOfWork;
 }
Ejemplo n.º 43
0
 public SalesOrderController()
 {
     this.repo = new SalesOrderRepository();
 }
 public TargetNAchievementReportService(ISalesOrderRepository salesOrderRepository, IUnitOfWork unitOfWork)
 {
     this._SalesOrderRepository = salesOrderRepository;
     this._UnitOfWork = unitOfWork;
 }