Create.cshtml 5.3 KB

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