Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2017
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.29 KB | None | 0 0
  1. @using System.Web.UI.WebControls
  2. @model IEnumerable<SmartSolutions.Models.Question>
  3.  
  4. @{
  5. Layout = "~/Views/Shared/_Layout5.cshtml";
  6. }
  7.  
  8. @{
  9. ViewBag.Title = "Создание вопросов";
  10. }
  11. <script src="~/Scripts/jquery-3.1.1.js"></script>
  12. <script src="~/Scripts/jquery-ui-1.12.1.js"></script>
  13. <div class="inner-div2">
  14. <div class="right-welcome-div2">
  15. <div class="counterdiv">
  16. </div>
  17. <div class="listdivleft">
  18. <div style="height: 80%; width: 100%; overflow: auto">
  19. <div class="title2" style="margin-top: 15px; margin-left: 15px; margin-bottom: 15px; padding-top: 10px">
  20. @Html.DropDownList("Question1", null, "Вопрос 1", htmlAttributes: new {@class = "form-control", @style = "height:40px;margin-bottom: 20px;",placeholder="lol"})
  21. @Html.DropDownList("Question2", null, "Вопрос 2", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
  22. @Html.DropDownList("Question3", null, "Вопрос 3", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
  23. @Html.DropDownList("Question4", null, "Вопрос 4", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
  24. @Html.DropDownList("Question5", null, "Вопрос 5", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
  25. @Html.DropDownList("Question6", null, "Вопрос 6", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
  26. @Html.DropDownList("Question7", null, "Вопрос 7", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
  27. @Html.DropDownList("Question8", null, "Вопрос 8", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
  28. @Html.DropDownList("Question9", null, "Вопрос 9", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
  29. @Html.DropDownList("Question10", null, "Вопрос 10", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
  30. </div>
  31. </div>
  32. <input id="save" class="btn btn-default" type="button" style="margin-top:20px; margin-left:200px;" value="Сохранить" />
  33. </div>
  34.  
  35. </div>
  36.  
  37. <div class="left-welcome-div2">
  38. <div class="counterdiv">
  39.  
  40. </div>
  41. <div class="listdivright">
  42. <div class="count" style="height: 80%; width: 100%; overflow-y: auto;" id="style-1">
  43.  
  44. @foreach (var item in Model)
  45. {
  46. <div class="title" style="margin-top:15px;margin-left:15px; margin-bottom: 10px;">
  47. <img class="click" src="@Url.Content("~/Images/plus_plus.png")" />
  48. <span class="test">
  49. @Html.TextBoxFor(modelItem => item.question, new { @class = "testclass", @readonly = "readonly" })
  50. </span>
  51. <a class="click2" style="margin-left:10px;">
  52. <img src='@Url.Content("~/Images/arrow.png")' />
  53.  
  54. </a>
  55. <a style="margin-left:25px;" href='@Url.Action("Edit", "Questions", new {id = item.QuestionId})'>
  56. <img src='@Url.Content("~/Images/Edit.png")' />
  57. </a>
  58. <a href='@Url.Action("Delete", "Questions", new {id = item.QuestionId})'>
  59. <img src='@Url.Content("~/Images/Delete.png")' />
  60. </a>
  61. </div>
  62. <div class="content" style="margin-left:60px; width: 80%; height: 100px; background: white">
  63. <div style="width: 100%">
  64. <div style="float:left; width: 50%;">
  65. <b>@Html.LabelFor(modelItem => item.TimeForAnswer, new { @style = "margin-left:40px;" })</b>
  66. <b>:</b>
  67. <span>@Html.DisplayFor(modelItem => item.TimeForAnswer)c</span>
  68. </div>
  69. <div style="float:right;width: 50%;">
  70. <b>@Html.LabelFor(modelItem => item.TimeForReady)</b>
  71. <b>:</b>
  72. <b>@Html.DisplayFor(modelItem => item.TimeForReady)м</b>
  73. </div>
  74. </div>
  75. <div style="width: 100%; text-align: center;">
  76. <b>@Html.LabelFor(modelItem => item.Retries)</b>
  77. <b>:</b>
  78. <b>@Html.DisplayFor(modelItem => item.Retries)</b>
  79. </div>
  80. </div>
  81.  
  82. }
  83. <div id="containerForPartialView"> @Html.Partial("~/Views/Questions/CreateQuestion.cshtml") </div>
  84. </div>
  85. <div style="height: 20%;">
  86. <button id="myButtonForShowDialog">Create new question</button>
  87.  
  88.  
  89. <button class="btn btn-default" style="margin-top: 15px; margin-left: 200px;">
  90. @Html.ActionLink("Далее", "RoleForSending", "Questions", null, new { @style = "color:white;" })
  91. </button>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96.  
  97. <script>
  98. var myFormDialog = $("containerForPartialView").dialog(
  99. { autoOpen: false, modal: true });
  100. $("myButtonForShowDialog").button().on("click", function () {
  101. myFormDialog.dialog("open");
  102. });
  103. $('.click').on('click', function () {
  104. $('.content').toggle();
  105. });
  106. var counter = 0;
  107. $(document).ready(function () {
  108. $('#save').click(function () {
  109. save();
  110. });
  111. });
  112. function save()
  113. {
  114. $.ajax({
  115. type: 'Post',
  116. dataType: 'Json',
  117. data: {
  118. question1: $('#Question1').val(),
  119. question2: $('#Question2').val(),
  120. question3: $('#Question3').val(),
  121. question4: $('#Question4').val(),
  122. question5: $('#Question5').val(),
  123. question6: $('#Question6').val(),
  124. question7: $('#Question7').val(),
  125. question8: $('#Question8').val(),
  126. question9: $('#Question9').val(),
  127. question10: $('#Question10').val(),
  128.  
  129. },
  130. url: '@Url.Action("Index", "Questions")',
  131. success: function (da) {
  132. if (da.Result === "Success") {
  133.  
  134. window.location.href = da.RedirectUrl;
  135.  
  136. } else {
  137.  
  138. alert( 'Error'+ da.Message);
  139. }
  140. },
  141. error: function (da) {
  142. alert('Error');
  143. }
  144. });
  145. }
  146.  
  147. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement