public PurchaseOrderItemsController(IPurchaseOrderItem ipOrderItem, IInventoryService inventoryService, IPurchaseOrderService ipPurchaseOrderService, ApplicationDbContext context) { this.ipOrderItem = ipOrderItem; this.inventoryService = inventoryService; this.ipPurchaseOrderService = ipPurchaseOrderService; _context = context; }
public static IPurchaseOrderDetail GetMostRecentlyOrderedDetail(this IPurchaseOrderItem item) { return(ServiceProvider.Current.Ordering.Item.GetDetails(item.ItemID) .Where(x => x.StatusID != OrderStatus.Cancelled) .OrderByDescending(x => x.CreatedDate) .FirstOrDefault()); }
public PurchaseOrdersController(IPurchaseOrderService iPurchaseOrderService, IPurchaseOrderItem item, UserManager <ApplicationUser> userManager, IInventoryService inventories, ApplicationDbContext context) { this.iPurchaseOrderService = iPurchaseOrderService; this.iPurchaseOrderItem = item; _userManager = userManager; inventory = inventories; _context = context; }
public static IPurchaseOrderDetail Add(IPurchaseOrder po, IPurchaseOrderItem item, IPurchaseOrderCategory category, double qty, string unit, double unitPrice) { if (item.ItemID > 0) { bool isInventoryControlled = item.InventoryItemID != null; var pod = ServiceProvider.Current.Ordering.PurchaseOrder.AddDetail(po.POID, item.ItemID, category.CatID, qty, unit, unitPrice, isInventoryControlled); return(pod); } throw new ArgumentException(string.Format("ItemID = {0} is not valid.", item.ItemID), "item"); }
public HomeController(ILogger <HomeController> logger, ApplicationDbContext context, Kiemtra kiemtra, ISaleService iSaleService, ISaleItem iSaleItem, IInventoryService inventoryService, IPurchaseOrderService iPurchaseOrderService, IPurchaseOrderItem iPurchaseOrderItem) { _logger = logger; _context = context; this.kiemtra = kiemtra; this.iSaleService = iSaleService; this.iSaleItem = iSaleItem; this.inventoryService = inventoryService; this.iPurchaseOrderService = iPurchaseOrderService; this.iPurchaseOrderItem = iPurchaseOrderItem; }
public static IInventoryItem GetInventoryItem(this IPurchaseOrderItem item) { if (item == null) { return(null); } //may be null because InventoryItemID is nullable if (item.InventoryItemID.HasValue) { return(ServiceProvider.Current.Inventory.Item.GetItem(item.InventoryItemID.Value)); } else { return(null); } }