/// <summary> /// Get All Inventory Items in the database /// </summary> /// <returns></returns> public IHttpActionResult Get() { InventoryItemService InventoryItemService = CreateInventoryItemService(); var inventoryItems = InventoryItemService.GetInventoryItem(); return(Ok(inventoryItems)); }
private InventoryItemService CreateInventoryItemService() { var userId = Guid.Parse(User.Identity.GetUserId()); var stateService = new InventoryItemService(userId); return(stateService); }
public InventoryItemsVM(InventoryItemService inventoryService, MainWindowVM mainVM) { _inventoryService = inventoryService; _mainVM = mainVM; _saveInventoryItemsCommand = new Command(async () => await SaveInventoryItemsAsync()); _loadInventoryItemsCommand = new Command(async () => await LoadInventoryItemsAsync()); }
public OrderItemVM(OrderItemService service, InventoryItemService inventoryService, MainWindowVM mainVM) : base(service) { _mainVM = mainVM; _shipCommand = new Command(async() => await ShipAsync()); _inventoryService = inventoryService; }
public InventoryItemController(SCMSContext _context) { var optionBuilder = new DbContextOptions <SCMSContext>(); _inventoryItemRepository = new InventoryItemRepository(_context); _inventoryItemService = new InventoryItemService(_inventoryItemRepository); }
public CreateProductCommand(Product product, IProductDataProxy productDataProxy, InventoryItemService inventoryService, ITransactionContext transactionContext) { CurrentProduct = product; _productDataProxy = productDataProxy; _inventoryService = inventoryService; _transactionContext = transactionContext; }
public async Task <IEnumerable <InventoryItem> > SearchInventoryItem(List <string> lst, List <string> includeLst = null) { using (var ctx = new InventoryItemService()) { return(await ctx.GetInventoryItemsByExpressionLst(lst, includeLst).ConfigureAwait(false)); } }
public ProductCatalogStructurePackage(BaseProductService baseProductService, ProductListService productListService, RelationshipTypeService relationshipTypeService, CategoryService categoryService, UnitOfMeasurementService unitOfMeasurementService, DataService dataService, FieldTemplateService fieldTemplateService, LanguageService languageService, VariantService variantService, InventoryService inventoryService, PriceListService priceListService, StructureInfoService structureInfoService, CurrencyService currencyService, FilterService filterService, InventoryItemService inventoryItemService, PriceListItemService priceListItemService, ProductListItemService productListItemService) { _baseProductService = baseProductService; _categoryService = categoryService; _dataService = dataService; _fieldTemplateService = fieldTemplateService; _languageService = languageService; _variantService = variantService; _inventoryService = inventoryService; _priceListService = priceListService; _structureInfoService = structureInfoService; _currencyService = currencyService; _filterService = filterService; _productListService = productListService; _relationshipTypeService = relationshipTypeService; _unitOfMeasurementService = unitOfMeasurementService; _bidirectionalRelationList = new List <ImportBidirectionalRelation>(); _inventoryItemService = inventoryItemService; _priceListItemService = priceListItemService; _productListItemService = productListItemService; }
public ShipOrderItemCommand(long orderItemID, IOrderItemDataProxy orderItemDataProxy, InventoryItemService inventoryService, ITransactionContext transactionContext) { _orderItemID = orderItemID; _orderItemDataProxy = orderItemDataProxy; _inventoryService = inventoryService; _transactionContext = transactionContext; }
public InventoryItemsVM(InventoryItemService inventoryService, MainWindowVM mainVM) { _inventoryService = inventoryService; _mainVM = mainVM; _saveInventoryItemsCommand = new Command(async() => await SaveInventoryItemsAsync()); _loadInventoryItemsCommand = new Command(async() => await LoadInventoryItemsAsync()); }
private void ConfigureHttpClientUsage() { string hostSettingName = "apiHostNameAddress"; var baseAddress = ConfigurationManager.AppSettings[hostSettingName]; if (baseAddress == null) { throw new Exception($"The setting '{hostSettingName}' in the AppSettings portion of the configuration file was not found."); } var productsDataProxy = new ProductsHttpServiceProxy(baseAddress); var inventoryDataProxy = new InventoryItemsHttpServiceProxy(baseAddress); var customerDataProxy = new CustomersHttpServiceProxy(baseAddress); var orderItemDataProxy = new OrderItemsHttpServiceProxy(baseAddress); var orderRepository = new OrdersHttpServiceProxy(baseAddress); var categoriesDataProxy = new CategoriesHttpServiceProxy(baseAddress); _inventoryService = new InventoryItemService(inventoryDataProxy); _orderItemsService = new OrderItemClientService(orderItemDataProxy, productsDataProxy, inventoryDataProxy, new DTCTransactionContext()); _ordersService = new OrderService(orderRepository, _orderItemsService, new DTCTransactionContext()); _customersService = new CustomerService(customerDataProxy, _ordersService); _productsService = new ProductClientService(productsDataProxy, orderRepository, _inventoryService, new DTCTransactionContext()); _categoriesService = new CategoryService(categoriesDataProxy, productsDataProxy); this.DataContext = new MainWindowVM(_eventAggregator, _customersService, _productsService, _categoriesService, _ordersService, _inventoryService); }
private async Task ImportInventory(List <CSVDataSummary> eslst) { var itmlst = from i in eslst group i by i.ItemNumber.ToUpper() into g select new { ItemNumber = g.Key, g.FirstOrDefault().ItemDescription }; using (var ctx = new InventoryItemService()) { foreach (var item in itmlst) { var i = BaseDataModel.Instance.InventoryCache.GetSingle( x => x.ItemNumber.ToUpper() == item.ItemNumber.ToUpper()); if (i == null) { i = new InventoryItem() { Description = item.ItemDescription, ItemNumber = item.ItemNumber }; await ctx.CreateInventoryItem(i).ConfigureAwait(false); BaseDataModel.Instance.InventoryCache.AddItem(i); } } } }
private ICommand <Product> CreateCommand(Product product) { var productDataProxy = new ProductRepository(); var inventoryDataProxy = new InventoryItemRepository(); var inventoryService = new InventoryItemService(inventoryDataProxy); return(new CreateProductCommand(product, productDataProxy, inventoryService, new TransactionContextStub())); }
public OrderItemVM(OrderItem customer, OrderItemService service, InventoryItemService inventoryService, MainWindowVM mainVM) : base(customer, service) { _mainVM = mainVM; _shipCommand = new Command(async() => await ShipAsync()); _inventoryService = inventoryService; CurrentProductID = CurrentEntity.ProductID; CurrentCategoryID = _currentProduct.CurrentCategoryID; IsDirty = false; }
public async Task SaveInventoryItem(InventoryItem i) { if (i == null) { return; } using (var ctx = new InventoryItemService()) { await ctx.UpdateInventoryItem(i).ConfigureAwait(false); } }
public CustomerOrderWindow(OrderService orderService, CustomerService customerService, OrderItemService orderItemService, InventoryItemService inventoryService, MainWindowVM mainVM, EventAggregator eventAggregator) : this() { var vm = new CustomerOrderVM(eventAggregator, orderService, orderItemService, inventoryService, mainVM); DataContext = vm; }
public OrderUtilities( CartAccessor cartAccessor, VariantService variantService, InventoryItemService inventoryItemService, IStockStatusCalculator stockStatusCalculator) { _stockStatusCalculator = stockStatusCalculator; _inventoryItemService = inventoryItemService; _cartAccessor = cartAccessor; _variantService = variantService; }
/// <summary> /// Delete an Inventory Item from the database /// </summary> /// <param name="id"></param> /// <returns></returns> public IHttpActionResult Delete(int id) { InventoryItemService inventoryItemService = CreateInventoryItemService(); var inventoryItems = inventoryItemService.DeleteInventoryItemById(id); if (inventoryItems == true) { return(Ok(inventoryItems)); } return(InternalServerError()); }
public CustomerOrderWindow(OrderService orderService, CustomerService customerService, OrderItemService orderItemService, InventoryItemService inventoryService, MainWindowVM mainVM, EventAggregator eventAggregator) : this() { var vm = new CustomerOrderVM(eventAggregator, orderService, orderItemService, inventoryService, mainVM); DataContext = vm; }
public ActionResult Index() { CorrolationIdHelper.SetCorrolationId(Guid.NewGuid()); ServiceRequestWithData <ISingleSignOnToken, InventoryItemServiceGetAllParameters> parameters = new ServiceRequestWithData <ISingleSignOnToken, InventoryItemServiceGetAllParameters> { AuthenticationToken = GetAuthenticationToken(), Data = new InventoryItemServiceGetAllParameters() }; ViewData.Model = InventoryItemService.GetAll(parameters).ResultData; return(View()); }
public DeleteProductCommand(long productID, IProductDataProxy productDataProxy, InventoryItemService inventoryService, OrderService orderService, ITransactionContext transactionContext) { _productID = productID; _productDataProxy = productDataProxy; _inventoryService = inventoryService; _orderService = orderService; _transactionContext = transactionContext; }
public DeleteProductCommand(long productID, IProductDataProxy productDataProxy, InventoryItemService inventoryService, OrderService orderService, ITransactionContext transactionContext) { _productID = productID; _productDataProxy = productDataProxy; _inventoryService = inventoryService; _orderService = orderService; _transactionContext = transactionContext; }
public void Product_and_inventory_item_should_be_created() { var product = CreateValidProduct(); var productDataProxy = new ProductRepository(); var inventoryDataProxy = new InventoryItemRepository(); var inventoryService = new InventoryItemService(inventoryDataProxy); var command = new CreateProductCommand(product, productDataProxy, inventoryService, new TransactionContextStub()); var newProduct = command.Execute().Value; productDataProxy.GetByID(newProduct.ID).ShouldNotBeNull(); inventoryDataProxy.GetByProduct(newProduct.ID).ShouldNotBeNull(); }
public void Product_and_inventory_item_should_be_created() { var product = CreateValidProduct(); var productDataProxy = new ProductRepository(); var inventoryDataProxy = new InventoryItemRepository(); var inventoryService = new InventoryItemService(inventoryDataProxy); var command = new CreateProductCommand(product, productDataProxy, inventoryService, new TransactionContextStub()); var newProduct = command.Execute().Value; productDataProxy.GetByID(newProduct.ID).ShouldNotBeNull(); inventoryDataProxy.GetByProduct(newProduct.ID).ShouldNotBeNull(); }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { var productsDataProxy = new ProductRepository(); var inventoryDataProxy = new InventoryItemRepository(); _inventoryService = new InventoryItemService(inventoryDataProxy); _orderItemsService = new OrderItemService(new OrderItemRepository(), productsDataProxy, _inventoryService, new DTCTransactionContext()); _ordersService = new OrderService(new OrderRepository(), _orderItemsService, new DTCTransactionContext()); _customersService = new CustomerService(new CustomerRepository(), _ordersService); _productsService = new ProductService(productsDataProxy, _ordersService, _inventoryService, new DTCTransactionContext()); _categoriesService = new CategoryService(new CategoryRepository(), _productsService); this.DataContext = new MainWindowVM(_eventAggregator, _customersService, _productsService, _categoriesService, _ordersService, _inventoryService); }
public ActionResult Add(string name) { CorrolationIdHelper.SetCorrolationId(Guid.NewGuid()); ServiceRequestWithData <ISingleSignOnToken, InventoryItemServiceCreateParameters> parameters = new ServiceRequestWithData <ISingleSignOnToken, InventoryItemServiceCreateParameters> { AuthenticationToken = GetAuthenticationToken(), Data = new InventoryItemServiceCreateParameters { name = name } }; InventoryItemService.Create(parameters); return(RedirectToAction("Index")); }
public ActionResult CheckIn(Guid id) { CorrolationIdHelper.SetCorrolationId(Guid.NewGuid()); ServiceRequestWithData <ISingleSignOnToken, InventoryItemServiceGetByRsnParameters> parameters = new ServiceRequestWithData <ISingleSignOnToken, InventoryItemServiceGetByRsnParameters> { AuthenticationToken = GetAuthenticationToken(), Data = new InventoryItemServiceGetByRsnParameters { rsn = id } }; ViewData.Model = InventoryItemService.GetByRsn(parameters).ResultData; return(View()); }
public ActionResult Remove(Guid id, int number) { CorrolationIdHelper.SetCorrolationId(Guid.NewGuid()); ServiceRequestWithData <ISingleSignOnToken, InventoryItemServiceRemoveParameters> parameters = new ServiceRequestWithData <ISingleSignOnToken, InventoryItemServiceRemoveParameters> { AuthenticationToken = GetAuthenticationToken(), Data = new InventoryItemServiceRemoveParameters { rsn = id, count = number } }; InventoryItemService.Remove(parameters); return(RedirectToAction("Index")); }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { var productsDataProxy = new ProductRepository(); var inventoryDataProxy = new InventoryItemRepository(); var customerDataProxy = new CustomerRepository(); var orderItemDataProxy = new OrderItemRepository(); var orderRepository = new OrderRepository(customerDataProxy, orderItemDataProxy); _inventoryService = new InventoryItemService(inventoryDataProxy); _orderItemsService = new OrderItemService(orderItemDataProxy, productsDataProxy, inventoryDataProxy, new DTCTransactionContext()); _ordersService = new OrderService(orderRepository, _orderItemsService, new DTCTransactionContext()); _customersService = new CustomerService(customerDataProxy, _ordersService); _productsService = new ProductService(productsDataProxy, _ordersService, _inventoryService, new DTCTransactionContext()); _categoriesService = new CategoryService(new CategoryRepository(), _productsService); this.DataContext = new MainWindowVM(_eventAggregator, _customersService, _productsService, _categoriesService, _ordersService, _inventoryService); }
private void Setup(EventAggregator eventAggregator, OrderService orderService, OrderItemService orderItemService, InventoryItemService inventoryService, MainWindowVM mainVM) { _orderService = orderService; _orderItemService = orderItemService; _inventoryService = inventoryService; _mainVM = mainVM; _eventAggregator = eventAggregator; _orderItems = new ObservableCollection <OrderItemVM>(); _saveOrderCommand = new Command(async() => await SaveAsync()); _addOrderItemCommand = new Command(() => AddOrderItem(), () => CanAdd); _deleteSelectedItemCommand = new Command(async() => await DeleteSelectedItemAsync()); _submitOrderCommand = new Command(async() => await SubmitAsync()); _shipOrderCommand = new Command(async() => await ShipAsync()); _refreshCommand = new Command(async() => await LoadOrderItemsAsync()); }
private void ConfigureEFUsage() { var productsDataProxy = new DAL.EF.ProductRepository(); var inventoryDataProxy = new DAL.EF.InventoryItemRepository(); var customerDataProxy = new DAL.EF.CustomerRepository(); var orderItemDataProxy = new DAL.EF.OrderItemRepository(); var orderRepository = new DAL.EF.OrderRepository(); var categoriesDataProxy = new DAL.EF.CategoryRepository(); _inventoryService = new InventoryItemService(inventoryDataProxy); _orderItemsService = new OrderItemService(orderItemDataProxy, productsDataProxy, inventoryDataProxy, new DTCTransactionContext()); _ordersService = new OrderService(orderRepository, _orderItemsService, new DTCTransactionContext()); _customersService = new CustomerService(customerDataProxy, _ordersService); _productsService = new ProductService(productsDataProxy, orderRepository, _inventoryService, new DTCTransactionContext()); _categoriesService = new CategoryService(categoriesDataProxy, productsDataProxy); this.DataContext = new MainWindowVM(_eventAggregator, _customersService, _productsService, _categoriesService, _ordersService, _inventoryService); }
private void ConfigureEFUsage() { var productsDataProxy = new DAL.EF.ProductRepository(); var inventoryDataProxy = new DAL.EF.InventoryItemRepository(); var customerDataProxy = new DAL.EF.CustomerRepository(); var orderItemDataProxy = new DAL.EF.OrderItemRepository(); var orderRepository = new DAL.EF.OrderRepository(); var categoriesDataProxy = new DAL.EF.CategoryRepository(); _inventoryService = new InventoryItemService(inventoryDataProxy); _orderItemsService = new OrderItemService(orderItemDataProxy, productsDataProxy, inventoryDataProxy, new DTCTransactionContext()); _ordersService = new OrderService(orderRepository, _orderItemsService, new DTCTransactionContext()); _customersService = new CustomerService(customerDataProxy, _ordersService); _productsService = new ProductService(productsDataProxy, orderRepository, _inventoryService, new DTCTransactionContext()); _categoriesService = new CategoryService(categoriesDataProxy, productsDataProxy); this.DataContext = new MainWindowVM(_eventAggregator, _customersService, _productsService, _categoriesService, _ordersService, _inventoryService); }
private async Task ImportInventory(List <CSVDataSummary> eslst) { var itmlst = from i in eslst group i by i.ItemNumber.ToUpper() into g select new { ItemNumber = g.Key, g.FirstOrDefault().ItemDescription, g.FirstOrDefault().TariffCode }; using (var ctx = new InventoryItemService() { StartTracking = true }) { foreach (var item in itmlst) { var i = await ctx.GetInventoryItemByKey(item.ItemNumber, null, true).ConfigureAwait(false); if (i == null) { i = new InventoryItem(true) { Description = item.ItemDescription, ItemNumber = item.ItemNumber, TrackingState = TrackingState.Added }; if (!string.IsNullOrEmpty(item.TariffCode)) { i.TariffCode = item.TariffCode; } await ctx.CreateInventoryItem(i).ConfigureAwait(false); } else { i.StartTracking(); i.Description = item.ItemDescription; if (!string.IsNullOrEmpty(item.TariffCode)) { i.TariffCode = item.TariffCode; } await ctx.UpdateInventoryItem(i).ConfigureAwait(false); } } } }
public MainWindowVM(EventAggregator eventAggregator, CustomerService customerService, ProductService productService, CategoryService categoryService, OrderService orderService, InventoryItemService inventoryService) { _customersVM = new CustomersVM(customerService); _customersVM.LoadCustomersCommand.Execute(null); _productsVM = new ProductsVM(productService, this); _productsVM.LoadProductsCommand.Execute(null); _categoriesVM = new CategoriesVM(categoryService); _categoriesVM.LoadCategoriesCommand.Execute(null); _ordersVM = new OrdersVM(orderService, this, eventAggregator); _ordersVM.LoadOrdersCommand.Execute(null); _inventoryItemsVM = new InventoryItemsVM(inventoryService, this); _inventoryItemsVM.LoadInventoryCommand.Execute(null); }
public static async Task AssignTariffToItms(IList list, TariffCode tariffCode) { if (tariffCode == null) { throw new ApplicationException("Please Select TariffCode then Continue"); } using (var ctx = new InventoryItemService()) { foreach (VirtualListItem <InventoryQS.Business.Entities.InventoryItemsEx> item in list) { InventoryItem itm = await ctx.GetInventoryItemByKey(item.Data.ItemNumber); item.Data.TariffCode = tariffCode.TariffCodeName; itm.TariffCode = tariffCode.TariffCodeName; await ctx.UpdateInventoryItem(itm).ConfigureAwait(false); } } }
public MainWindowVM(EventAggregator eventAggregator, CustomerService customerService, ProductService productService, CategoryService categoryService, OrderService orderService, InventoryItemService inventoryService) { _customersVM = new CustomersVM(customerService); _customersVM.LoadCustomersCommand.Execute(null); _productsVM = new ProductsVM(productService, this); _productsVM.LoadProductsCommand.Execute(null); _categoriesVM = new CategoriesVM(categoryService); _categoriesVM.LoadCategoriesCommand.Execute(null); _ordersVM = new OrdersVM(orderService, this, eventAggregator); _ordersVM.LoadOrdersCommand.Execute(null); _inventoryItemsVM = new InventoryItemsVM(inventoryService, this); _inventoryItemsVM.LoadInventoryCommand.Execute(null); }
public async Task AssignTariffToItms(IEnumerable <string> lst, string tariffCode) { if (tariffCode == null) { throw new ApplicationException("Please Select TariffCode then Continue"); } using (var ctx = new InventoryItemService()) { foreach (string item in lst) { var itm = await ctx.GetInventoryItemByKey(item).ConfigureAwait(false); itm.TariffCode = tariffCode; await ctx.UpdateInventoryItem(itm).ConfigureAwait(false); } } }
public CustomerOrderWindow(OrderVM currentOrder, OrderService orderService, CustomerService customerService, OrderItemService orderItemService, InventoryItemService inventoryService, MainWindowVM mainVM, EventAggregator eventAggregator) : this() { var order = new Order() { ID = currentOrder.ID, CustomerID = currentOrder.CustomerID, OrderDate = currentOrder.OrderDate, }; var vm = new CustomerOrderVM(eventAggregator, order, orderService, orderItemService, inventoryService, mainVM); vm.RefreshCommand.Execute(null); DataContext = vm; }
private ICommand<Product> CreateCommand(Product product) { var productDataProxy = new ProductRepository(); var inventoryDataProxy = new InventoryItemRepository(); var inventoryService = new InventoryItemService(inventoryDataProxy); return new CreateProductCommand(product, productDataProxy, inventoryService, new TransactionContextStub()); }