Guest User

Untitled

a guest
Nov 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. public class CarListViewModel
  2. {
  3. public List<Car> cars{ get; set; }
  4. public int selectedCar { get; set; }
  5. public List<Material> materials { get; set; }
  6.  
  7. // (...)
  8. }
  9.  
  10. public class Material
  11. {
  12. public string name { get; set; }
  13. public string lot { get; set; }
  14. public int quantity { get; set; }
  15. }
  16.  
  17. @model CarListViewModel
  18.  
  19. @{
  20. ViewData["Title"] = "Registar material";
  21. }
  22.  
  23. <div class="material-registration-wrapper">
  24. <h2 class="title">Registo materiais - Carro</h2>
  25.  
  26. @using (Html.BeginForm("MaterialDummy", "Material", FormMethod.Post, new { id = "materialRegistrationForm" }))
  27. {
  28. <table class="material-registration-insertion">
  29. <tr>
  30. <th>Material</th>
  31. <th>Lote</th>
  32. <th>Quantidade</th>
  33. </tr>
  34. <tr>
  35. @{List<Material> mList = new List<Material>();}
  36. @{Material m1 = new Material();}
  37. <td>@Html.TextBoxFor(model => m1.name, null, new { type = "text" })</td>
  38. <td>@Html.TextBoxFor(model => m1.lot, null, new { type = "text" })</td>
  39. <td>@Html.TextBoxFor(model => m1.quantity, null, new { type = "text" })</td>
  40. </tr>
  41. @{ mList.Add(m1); }
  42. @Html.HiddenFor(model => mList, Model.materials)
  43. </table>
  44. <table class="submit-table">
  45. <tr>
  46. <td>
  47. <div class="submit-table">
  48. <input type="submit" value="Submeter" class="submit-button" />-->
  49. </div>
  50. </td>
  51. </tr>
  52. </table>
  53. }
  54. </div>
Add Comment
Please, Sign In to add comment