public Client(Credentials credentials) { if (credentials == null) { throw new ArgumentNullException("credentials"); } _requester = new OAuthRequest(credentials); Company = new CompanyResource(_requester); CompanySubscription = new CompanySubscriptionResource(_requester); User = new UserResource(_requester); Contact = new ContactResource(_requester); Product = new ProductResource(_requester); ProductCategory = new ProductCategoryResource(_requester); ProductUnit = new ProductUnitResource(_requester); //Dashboard = new DashboardResource(_requester); //Receipt = new ReceiptResource(_requester); Inventory = new InventoryResource(_requester); BillingNote = new BillingNoteResource(_requester); Invoice = new InvoiceResource(_requester); //PurchaseOrder = new PurchaseOrderResource(_requester); //Quotation = new QuotationResource(_requester); //Expense = new ExpenseResource(_requester); CreditNote = new CreditNoteResource(_requester); DebitNote = new DebitNoteResource(_requester); WithHoldingTax = new WithHoldingTaxResource(_requester); }
//destroys the object that is grabbed when it is added to the Bag public void Bag(Grabdis grabdis) { InventoryResource ir = grabdis.GetComponent <InventoryResource> (); if (ir != null) { this.myInventory.AddResource(ir); Destroy(grabdis.gameObject); } }
public Inventory ParseInventory(InventoryResource inventory) { return(new Inventory { InventoryId = inventory.InventoryId, Quantity = inventory.Quantity, ProductForeingId = inventory.ProductForeingId, LocationForeignId = inventory.LocationForeignId, Product = ParseProduct(inventory.Product), //Location = ParseLocation(inventory.Location), }); }
//If the dictionary contains a type of resource, it will add the resource if it containts the proper typeOfResource, //increases the count, and adds the prefab public void AddResource(InventoryResource ir) { if (this.Keys.ContainsKey(ir.typeOfResource)) { this.Keys [ir.typeOfResource].count++; } else { this.Keys.Add(ir.typeOfResource, new Keychain() { prefab = ir.resourcePrefab, count = 1 }); } }
public void Has() { var items = new InventoryItem[] { new InventoryItem("key", 255), new InventoryItem("pen", 20), }; var resource = new InventoryResource(items, 1); this.interpreter.ResourceManager = new ResourceManager(); this.interpreter.ResourceManager.InventoryResource = resource; this.kernel.Has(0).Should().BeTrue(); this.kernel.Has(1).Should().BeFalse(); }
public IActionResult GetInventoryItem(int productId, int locationId) { try { InventoryResource all = _mapper.ParseInventory(_inventoryService.GetInventoryItem(productId, locationId)); //var all =_mapper.ParseInventory(_inventoryService.GetAllInventory()); return(Ok(all)); } catch (Exception) { Log.Warning("Inventory item access failed"); return(BadRequest()); } }