Edit.cshtml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. @model esoft_API.Models.Entities.Task
  2. @{
  3. ViewBag.Title = "Edit";
  4. }
  5. <h2>Edit</h2>
  6. @using (Html.BeginForm())
  7. {
  8. @Html.AntiForgeryToken()
  9. <div class="form-horizontal">
  10. <h4>Task</h4>
  11. <hr />
  12. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  13. @Html.HiddenFor(model => model.ID)
  14. <div class="form-group">
  15. @Html.LabelFor(model => model.ExecutorID, "ExecutorID", htmlAttributes: new { @class = "control-label col-md-2" })
  16. <div class="col-md-10">
  17. @Html.DropDownList("ExecutorID", null, htmlAttributes: new { @class = "form-control" })
  18. @Html.ValidationMessageFor(model => model.ExecutorID, "", new { @class = "text-danger" })
  19. </div>
  20. </div>
  21. <div class="form-group">
  22. @Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" })
  23. <div class="col-md-10">
  24. @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
  25. @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })
  26. </div>
  27. </div>
  28. <div class="form-group">
  29. @Html.LabelFor(model => model.Description, htmlAttributes: new { @class = "control-label col-md-2" })
  30. <div class="col-md-10">
  31. @Html.EditorFor(model => model.Description, new { htmlAttributes = new { @class = "form-control" } })
  32. @Html.ValidationMessageFor(model => model.Description, "", new { @class = "text-danger" })
  33. </div>
  34. </div>
  35. <div class="form-group">
  36. @Html.LabelFor(model => model.CreateDateTime, htmlAttributes: new { @class = "control-label col-md-2" })
  37. <div class="col-md-10">
  38. @Html.EditorFor(model => model.CreateDateTime, new { htmlAttributes = new { @class = "form-control" } })
  39. @Html.ValidationMessageFor(model => model.CreateDateTime, "", new { @class = "text-danger" })
  40. </div>
  41. </div>
  42. <div class="form-group">
  43. @Html.LabelFor(model => model.Deadline, htmlAttributes: new { @class = "control-label col-md-2" })
  44. <div class="col-md-10">
  45. @Html.EditorFor(model => model.Deadline, new { htmlAttributes = new { @class = "form-control" } })
  46. @Html.ValidationMessageFor(model => model.Deadline, "", new { @class = "text-danger" })
  47. </div>
  48. </div>
  49. <div class="form-group">
  50. @Html.LabelFor(model => model.Difficulty, htmlAttributes: new { @class = "control-label col-md-2" })
  51. <div class="col-md-10">
  52. @Html.EditorFor(model => model.Difficulty, new { htmlAttributes = new { @class = "form-control" } })
  53. @Html.ValidationMessageFor(model => model.Difficulty, "", new { @class = "text-danger" })
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. @Html.LabelFor(model => model.Time, htmlAttributes: new { @class = "control-label col-md-2" })
  58. <div class="col-md-10">
  59. @Html.EditorFor(model => model.Time, new { htmlAttributes = new { @class = "form-control" } })
  60. @Html.ValidationMessageFor(model => model.Time, "", new { @class = "text-danger" })
  61. </div>
  62. </div>
  63. <div class="form-group">
  64. @Html.LabelFor(model => model.Status, htmlAttributes: new { @class = "control-label col-md-2" })
  65. <div class="col-md-10">
  66. @Html.EditorFor(model => model.Status, new { htmlAttributes = new { @class = "form-control" } })
  67. @Html.ValidationMessageFor(model => model.Status, "", new { @class = "text-danger" })
  68. </div>
  69. </div>
  70. <div class="form-group">
  71. @Html.LabelFor(model => model.WorkType, htmlAttributes: new { @class = "control-label col-md-2" })
  72. <div class="col-md-10">
  73. @Html.EditorFor(model => model.WorkType, new { htmlAttributes = new { @class = "form-control" } })
  74. @Html.ValidationMessageFor(model => model.WorkType, "", new { @class = "text-danger" })
  75. </div>
  76. </div>
  77. <div class="form-group">
  78. @Html.LabelFor(model => model.CompletedDateTime, htmlAttributes: new { @class = "control-label col-md-2" })
  79. <div class="col-md-10">
  80. @Html.EditorFor(model => model.CompletedDateTime, new { htmlAttributes = new { @class = "form-control" } })
  81. @Html.ValidationMessageFor(model => model.CompletedDateTime, "", new { @class = "text-danger" })
  82. </div>
  83. </div>
  84. <div class="form-group">
  85. @Html.LabelFor(model => model.IsDeleted, htmlAttributes: new { @class = "control-label col-md-2" })
  86. <div class="col-md-10">
  87. <div class="checkbox">
  88. @Html.EditorFor(model => model.IsDeleted)
  89. @Html.ValidationMessageFor(model => model.IsDeleted, "", new { @class = "text-danger" })
  90. </div>
  91. </div>
  92. </div>
  93. <div class="form-group">
  94. <div class="col-md-offset-2 col-md-10">
  95. <input type="submit" value="Save" class="btn btn-default" />
  96. </div>
  97. </div>
  98. </div>
  99. }
  100. <div>
  101. @Html.ActionLink("Back to List", "Index")
  102. </div>
  103. @section Scripts {
  104. @Scripts.Render("~/bundles/jqueryval")
  105. }