public static async Task ValidateSearch(IProductSearch search) { try { } catch (Exception e) { throw e; } }
public static async Task <IPhysicalProductSearchOutput> Execute(IProductSearch search) { try { return(await PhysicalProductDAO.SearchPhysicalProducts(search)); } catch (Exception e) { throw e; } }
public ManagerMenu(ICustomerBL customerBL, IProductBL productBL, ILocationBL locationBL, IInventoryBL inventoryBL, IOrderBL orderBL, ICartBL cartBL, ICartProductsBL cartProductsBL, IOrderItemsBL orderItemsBL) { _customerBL = customerBL; _productBL = productBL; _locationBL = locationBL; _orderBL = orderBL; _inventoryBL = inventoryBL; _cartBL = cartBL; _cartProductsBL = cartProductsBL; _orderItemsBL = orderItemsBL; //generate menus necessary for managermenu access customerSearch = new CustSearch(_customerBL, _orderBL); productSearch = new ProductSearch(_productBL, _cartProductsBL, _inventoryBL); inventorySearch = new InventorySearch(_inventoryBL); orderSearch = new OrderSearch(_orderBL, _orderItemsBL, _productBL); }
public SearchController(IProductSearch search) { _search = search; }
public SearchController(IProductSearch search) { this.search = search; }
public static async Task <IPhysicalProductSearchOutput> SearchPhysicalProductsAsync(IProductSearch search) { try { await ProductSearchEntity.ValidateSearch(search); return(await SearchPhysicalProducts.Execute(search)); } catch (Exception e) { throw e; } }
public static async Task <IPhysicalProductSearchOutput> SearchPhysicalProducts(IProductSearch search) { try { var idFilter = Builders <PhysicalProduct> .Filter.Empty; var nameFilter = Builders <PhysicalProduct> .Filter.Empty; var categoryFilter = Builders <PhysicalProduct> .Filter.Empty; var brandFilter = Builders <PhysicalProduct> .Filter.Empty; var ownerFilter = Builders <PhysicalProduct> .Filter.Empty; var filter = Builders <PhysicalProduct> .Filter.Empty; if (search.Id.IsActive) { idFilter = Builders <PhysicalProduct> .Filter.Where(product => product.Id == ObjectId.Parse(search.Id.Value)); } if (search.Name.IsActive) { nameFilter = Builders <PhysicalProduct> .Filter.Where(product => product.Name == search.Name.Value); } if (search.Owner.IsActive) { ownerFilter = Builders <PhysicalProduct> .Filter.Where(product => product.Owner == search.Owner.Value); } filter = Builders <PhysicalProduct> .Filter.And(idFilter, nameFilter, ownerFilter); var query = Collections.PhysicalProducts.Find(filter).Skip(search.Pagination.Offset).Limit(search.Pagination.Limit); return(new PhysicalProductSearchOutput() { Products = query.ToList(), Pagination = new PaginationOut() { Offset = search.Pagination.Offset, Limit = search.Pagination.Limit, Total = await Count(filter) } }); } catch (Exception e) { throw e; } }
public HomeController(IProductSearch productSearch) { _productSearch = productSearch; }
public SearchController(IProductSearch search, ITelemetryProvider telemetryProvider) { this.search = search; this.telemetryProvider = telemetryProvider; }