Guest User

Untitled

a guest
Nov 27th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. @Html.HiddenFor(model => model.item.lineNum)
  2.  
  3.  
  4. </div>
  5. <br /><br />
  6.  
  7. <h4>Issued Items</h4>
  8. <hr />
  9. <div class="form-group">
  10. <table>
  11. <tr>
  12. <th class="col-md-4">Item Number</th>
  13. <th class="col-md-4">Item Description</th>
  14. <th class="col-md-4">Expense Account</th>
  15. <th class="col-md-2">Quantity Requested</th>
  16. <th class="col-md-2">Quantity Issued</th>
  17. <th class="col-md-1">UOM</th>
  18. <th class="col-md-1">Item Price</th>
  19. </tr>
  20.  
  21. @{
  22. foreach (var issueditem in ViewBag.IssuedItems)
  23. {
  24. <tr>
  25.  
  26. <td class="col-md-4">@issueditem.itemNumber</td>
  27. <td class="col-md-4">@issueditem.description</td>
  28. <td class="col-md-4">@issueditem.expense_account.getDescription</td>
  29. <td class="col-md-2">@issueditem.quantity.ToString()</td>
  30. <td class="col-md-2">@issueditem.quantityI.ToString()</td>
  31. <td class="col-md-1">@issueditem.selecteduomtext </td>
  32. <td class="col-md-1">@issueditem.price.ToString()</td>
  33. <td>@Html.ActionLink("Edit", "Edit", new { id = issueditem.lineNum })</td>
  34.  
  35.  
  36. </tr>
  37. }
  38.  
  39. }
  40.  
  41.  
  42.  
  43. <tr></tr>
  44. </table>
  45.  
  46. public ActionResult Edit(int id)
  47. {
  48.  
  49. getIssue.item = getIssue.items[id - 1];//Returns the requested item for editing
  50. return View(getIssue);
  51. }
  52.  
  53.  
  54. /// <summary>
  55. /// Gets the changes submitted from the user and updates the Item in the List
  56. /// </summary>
  57. /// <param name="issue"></param>
  58. /// <returns></returns>
  59. [HttpPost]
  60. public ActionResult Edit(Issue issue)
  61. {
  62. int indx = issue.item.lineNum - 1;
  63. getIssue.items[indx] = issue.item;
  64. //return View(getIssue);
  65. return RedirectToAction("IssueItem", "Issue", new { id = indx });
  66.  
  67. }
Add Comment
Please, Sign In to add comment