Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @using System.Web.UI.WebControls
- @model IEnumerable<SmartSolutions.Models.Question>
- @{
- Layout = "~/Views/Shared/_Layout5.cshtml";
- }
- @{
- ViewBag.Title = "Создание вопросов";
- }
- <script src="~/Scripts/jquery-3.1.1.js"></script>
- <script src="~/Scripts/jquery-ui-1.12.1.js"></script>
- <div class="inner-div2">
- <div class="right-welcome-div2">
- <div class="counterdiv">
- </div>
- <div class="listdivleft">
- <div style="height: 80%; width: 100%; overflow: auto">
- <div class="title2" style="margin-top: 15px; margin-left: 15px; margin-bottom: 15px; padding-top: 10px">
- @Html.DropDownList("Question1", null, "Вопрос 1", htmlAttributes: new {@class = "form-control", @style = "height:40px;margin-bottom: 20px;",placeholder="lol"})
- @Html.DropDownList("Question2", null, "Вопрос 2", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
- @Html.DropDownList("Question3", null, "Вопрос 3", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
- @Html.DropDownList("Question4", null, "Вопрос 4", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
- @Html.DropDownList("Question5", null, "Вопрос 5", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
- @Html.DropDownList("Question6", null, "Вопрос 6", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
- @Html.DropDownList("Question7", null, "Вопрос 7", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
- @Html.DropDownList("Question8", null, "Вопрос 8", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
- @Html.DropDownList("Question9", null, "Вопрос 9", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
- @Html.DropDownList("Question10", null, "Вопрос 10", htmlAttributes: new {@class = "form-control", @style = "height:40px; margin-bottom: 20px;"})
- </div>
- </div>
- <input id="save" class="btn btn-default" type="button" style="margin-top:20px; margin-left:200px;" value="Сохранить" />
- </div>
- </div>
- <div class="left-welcome-div2">
- <div class="counterdiv">
- </div>
- <div class="listdivright">
- <div class="count" style="height: 80%; width: 100%; overflow-y: auto;" id="style-1">
- @foreach (var item in Model)
- {
- <div class="title" style="margin-top:15px;margin-left:15px; margin-bottom: 10px;">
- <img class="click" src="@Url.Content("~/Images/plus_plus.png")" />
- <span class="test">
- @Html.TextBoxFor(modelItem => item.question, new { @class = "testclass", @readonly = "readonly" })
- </span>
- <a class="click2" style="margin-left:10px;">
- <img src='@Url.Content("~/Images/arrow.png")' />
- </a>
- <a style="margin-left:25px;" href='@Url.Action("Edit", "Questions", new {id = item.QuestionId})'>
- <img src='@Url.Content("~/Images/Edit.png")' />
- </a>
- <a href='@Url.Action("Delete", "Questions", new {id = item.QuestionId})'>
- <img src='@Url.Content("~/Images/Delete.png")' />
- </a>
- </div>
- <div class="content" style="margin-left:60px; width: 80%; height: 100px; background: white">
- <div style="width: 100%">
- <div style="float:left; width: 50%;">
- <b>@Html.LabelFor(modelItem => item.TimeForAnswer, new { @style = "margin-left:40px;" })</b>
- <b>:</b>
- <span>@Html.DisplayFor(modelItem => item.TimeForAnswer)c</span>
- </div>
- <div style="float:right;width: 50%;">
- <b>@Html.LabelFor(modelItem => item.TimeForReady)</b>
- <b>:</b>
- <b>@Html.DisplayFor(modelItem => item.TimeForReady)м</b>
- </div>
- </div>
- <div style="width: 100%; text-align: center;">
- <b>@Html.LabelFor(modelItem => item.Retries)</b>
- <b>:</b>
- <b>@Html.DisplayFor(modelItem => item.Retries)</b>
- </div>
- </div>
- }
- <div id="containerForPartialView"> @Html.Partial("~/Views/Questions/CreateQuestion.cshtml") </div>
- </div>
- <div style="height: 20%;">
- <button id="myButtonForShowDialog">Create new question</button>
- <button class="btn btn-default" style="margin-top: 15px; margin-left: 200px;">
- @Html.ActionLink("Далее", "RoleForSending", "Questions", null, new { @style = "color:white;" })
- </button>
- </div>
- </div>
- </div>
- </div>
- <script>
- var myFormDialog = $("containerForPartialView").dialog(
- { autoOpen: false, modal: true });
- $("myButtonForShowDialog").button().on("click", function () {
- myFormDialog.dialog("open");
- });
- $('.click').on('click', function () {
- $('.content').toggle();
- });
- var counter = 0;
- $(document).ready(function () {
- $('#save').click(function () {
- save();
- });
- });
- function save()
- {
- $.ajax({
- type: 'Post',
- dataType: 'Json',
- data: {
- question1: $('#Question1').val(),
- question2: $('#Question2').val(),
- question3: $('#Question3').val(),
- question4: $('#Question4').val(),
- question5: $('#Question5').val(),
- question6: $('#Question6').val(),
- question7: $('#Question7').val(),
- question8: $('#Question8').val(),
- question9: $('#Question9').val(),
- question10: $('#Question10').val(),
- },
- url: '@Url.Action("Index", "Questions")',
- success: function (da) {
- if (da.Result === "Success") {
- window.location.href = da.RedirectUrl;
- } else {
- alert( 'Error'+ da.Message);
- }
- },
- error: function (da) {
- alert('Error');
- }
- });
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement