public async Task <IActionResult> Edit(string id, [Bind("SerialNumber,Plant,StoreLocation,Material,Description,LatestCalDate,CalStatus,Comment,CalDue,SystemStatus,UserStatus,Room,SuperordEquip,SortField,Machine,ToolkitMachine,ToolkitSloc,LatestSafetyDate,SafetyDue,NeedCal,NeedSafety,RemovedDate,UpdatedDate,InCal,PSN")] ToolInventory toolInventory) { if (id != toolInventory.SerialNumber) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(toolInventory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ToolInventoryExists(toolInventory.SerialNumber)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(toolInventory)); }
public async Task <IActionResult> Create([Bind("SerialNumber,Plant,StoreLocation,Material,Description,LatestCalDate,CalStatus,Comment,CalDue,SystemStatus,UserStatus,Room,SuperordEquip,SortField,Machine,ToolkitMachine,ToolkitSloc,LatestSafetyDate,SafetyDue,NeedCal,NeedSafety,RemovedDate,UpdatedDate,InCal,PSN")] ToolInventory toolInventory) { if (ModelState.IsValid) { _context.Add(toolInventory); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(toolInventory)); }
IEnumerator create(Tool tool, Building building) { isCraftingTool = true; for (int i = 0; i < tool.numberRessourcesNeeded; i++) { building.GetComponent <RessourceInventory>().remove(tool.ressourceNeeded); } ToolInventory toolInventoryBuilding = building.GetComponent <ToolInventory>(); toolInventoryBuilding.wood.text = (int.Parse(toolInventoryBuilding.wood.text) - toolInventoryBuilding.activeTool.numberRessourcesNeeded).ToString(); yield return(new WaitForSeconds(5.0f)); toolInventoryBuilding.addTool(); toolInventoryBuilding.add(tool); toolInventoryBuilding.toolCount.text = (int.Parse(toolInventoryBuilding.toolCount.text) + 1).ToString(); //toolInventoryBuilding.isCrafted(); //yield return new WaitForSeconds(1.0f); isCraftingTool = false; }
public async Task <ActionResult> SavePInfo([FromBody] PInfo PInfoData) { string clientId = PInfoData.connectionId; if (PInfoData.ChangedP) { MaterialNeedCalRepository matrep = _context.MaterialNeedCalRepository; var materialEntry = matrep.GetRecord(PInfoData.Material); materialEntry.PMaker = PInfoData.PMaker; materialEntry.PModel = PInfoData.PModel; materialEntry.PName = PInfoData.PName; matrep.UpdateRecord(materialEntry); } if (PInfoData.ChangedS) { ToolInventoryRepository toolrep = _context.ToolInventoryRepository; ToolInventory toolInvEntry = toolrep.GetRecord(PInfoData.Serial); toolInvEntry.PSN = PInfoData.PSerial; toolrep.UpdateRecord(toolInvEntry); } await _hubContext.Clients.Client(clientId).SendAsync("PInfoSaved"); return(new EmptyResult()); }
public void Add(ToolInventory ti) { filteredData.Add(ti); }
private void Awake() { tools = GetComponent <ToolInventory>(); houseObjects = new List <GameObject>(); }
protected void Awake() { toolComp = GetComponent <ToolComponent>(); toolInv = FindObjectOfType <ToolInventory>(); }