Guest User

Untitled

a guest
Oct 23rd, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. @model List<PlumbingCalculation>
  2.  
  3. <form method="post" asp-action="IncludeCalculationSelectData" asp-controller="Plumbing" asp-route-id="@ViewBag.Id">
  4. <table class="table">
  5. <tbody>
  6. @{foreach (PlumbingCalculation item in Model)
  7. {
  8. <tr>
  9. <td>
  10. <input type="checkbox" value="true" name="col" />
  11. <input type="hidden" value="false" name="col" />
  12. </td>
  13. <td>
  14. <input type="hidden" name="col" asp-for="@item.CalculationName" />
  15. @item.CalculationName
  16. </td>
  17. </tr>
  18. }
  19. }
  20. </tbody>
  21. </table>
  22. <br />
  23. <input type="submit" class="btn btn-default" value="Далее" />
  24. </form>
  25.  
  26. public class PlumbingCalculation
  27. {
  28. public int PlumbingCalculationId { get; set; }
  29. public int PlumbingMainId { get; set; }
  30. public string CalculationName { get; set; }
  31. //
  32. [NotMapped]
  33. public bool isChecked { get; set; }
  34.  
  35. public PlumbingMain PlumbingMain { get; set; }
  36. }
  37.  
  38. [HttpPost]
  39. public IActionResult IncludeCalculationSelectData(int id, List<PlumbingCalculation> col)
  40. {
  41. ViewBag.count = names.Count();
  42. return View("test");
  43. }
  44.  
  45. @{foreach (PlumbingCalculation item in Model)
  46. {
  47. <tr>
  48. <td>
  49. <input type="checkbox" value="true" name="checkbox" />
  50. <input type="hidden" value="false" name="checkbox" />
  51. </td>
  52. <td>
  53. <input type="hidden" name="CalculationName" asp-for="@item.CalculationName" />
  54. @item.CalculationName
  55. </td>
  56. </tr>
  57. }
  58. }
  59.  
  60. [HttpPost]
  61. public IActionResult IncludeCalculationSelectData(int id, List<bool> checkbox, List<string> CalculationName )
  62. {
  63. ViewBag.count = CaclulationName.Count();
  64. return View("test");
  65. }
Add Comment
Please, Sign In to add comment