Esempio n. 1
0
        public override void Execute()
        {
            WriteLiteral("\n");


            #line 4 "..\..\Views\Awards\Index.cshtml"

            Layout = "~/Views/Awards/PartialView/LayoutAwards.cshtml";


            #line default
            #line hidden
            WriteLiteral("\n\n");


            #line 8 "..\..\Views\Awards\Index.cshtml"
            if (Request.IsAuthenticated && (HttpContext.Current.User.IsInRole("Admin") || HttpContext.Current.User.IsInRole("CandidateAdmin")))
            {
            #line default
            #line hidden
                WriteLiteral("    <div");

                WriteLiteral(" class=\"panel panel-default\"");

                WriteLiteral(">\n        <div");

                WriteLiteral(" class=\"panel-heading\"");

                WriteLiteral(">\n            <h4");

                WriteLiteral(" class=\"panel-title\"");

                WriteLiteral(">\n                <a");

                WriteLiteral(" class=\"accordion-toggle\"");

                WriteLiteral(" data-toggle=\"collapse\"");

                WriteLiteral(" href=\"#collapseOne\"");

                WriteLiteral(" aria-expanded=\"false\"");

                WriteLiteral(">\n                    Добавление новой записи\n                </a>\n            </" +
                             "h4>\n        </div>\n        <div");

                WriteLiteral(" id=\"collapseOne\"");

                WriteLiteral(" class=\"panel-collapse collapse in\"");

                WriteLiteral(">\n            <div");

                WriteLiteral(" class=\"panel-body\"");

                WriteLiteral(">\n");

                WriteLiteral("                ");


            #line 20 "..\..\Views\Awards\Index.cshtml"
                Write(Html.Partial("~/Views/Awards/CreateAwardPartial.cshtml", ViewData.Model.AwardModel));


            #line default
            #line hidden
                WriteLiteral("\n            </div>\n        </div>\n    </div>\n");


            #line 24 "..\..\Views\Awards\Index.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("\n<p>\n");

            WriteLiteral("    ");


            #line 27 "..\..\Views\Awards\Index.cshtml"
            Write(Ajax.ActionLink("Обновить список", "Index", "Awards", new { }, new AjaxOptions {
                HttpMethod = "GET", UpdateTargetId = "awardsList", InsertionMode = InsertionMode.Replace
            }, new { @class = "btn btn-default" }));


            #line default
            #line hidden
            WriteLiteral("\n</p>\n\n<div");

            WriteLiteral(" id=\"awardsList\"");

            WriteLiteral(">\n");

            WriteLiteral("    ");


            #line 31 "..\..\Views\Awards\Index.cshtml"
            Write(Html.Partial("~/Views/Awards/ListAwardsPartial.cshtml"));


            #line default
            #line hidden
            WriteLiteral("\n</div>\n\n");

            DefineSection("Scripts", () => {
                WriteLiteral("\n\n");

                WriteLiteral("    ");


            #line 36 "..\..\Views\Awards\Index.cshtml"
                Write(Scripts.Render("~/bundles/jqueryval"));


            #line default
            #line hidden
                WriteLiteral("\n\n    <script");

                WriteLiteral(" type=\"text/javascript\"");

                WriteLiteral(@">

        function OnAwardRemove(data, status, request) {
            if (data.error) {
                OnError(request, status, data.error);
                return;
            }
            var awardId = data.id;
            $('tr[data-award-id = ' + awardId + ']').remove();
        }

        function OnError(request, status, error) {
            alert(error);
        }
    </script>

");
            });
        }
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
            BeginContext(29, 281, true);
            WriteLiteral(@"
<table class=""table table-striped table-bordered"">
    <thead>
        <tr>
            <th>ID</th>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Email Address</th>
            <th>Phone No.</th>
        </tr>
    </thead>
    <tbody>
");
            EndContext();
#line 14 "D:\Visual Studio\VS2017\VSCode\HtmlInject\MvcApp\Views\Home\ContactListPartial.cshtml"
         foreach (var contact in Model)
        {

#line default
#line hidden
            BeginContext(362, 38, true);
            WriteLiteral("            <tr>\r\n                <td>");
            EndContext();
            BeginContext(401, 135, false);
#line 17 "D:\Visual Studio\VS2017\VSCode\HtmlInject\MvcApp\Views\Home\ContactListPartial.cshtml"
               Write(Ajax.ActionLink(contact.Id, "Update", new { contactId = contact.Id }, new AjaxOptions { OnSuccess = "showDialog", HttpMethod = "GET" }));

#line default
#line hidden
            EndContext();
            BeginContext(536, 27, true);
            WriteLiteral("</td>\r\n                <td>");
            EndContext();
            BeginContext(564, 17, false);
#line 18 "D:\Visual Studio\VS2017\VSCode\HtmlInject\MvcApp\Views\Home\ContactListPartial.cshtml"
               Write(contact.FirstName);

#line default
#line hidden
            EndContext();
            BeginContext(581, 27, true);
            WriteLiteral("</td>\r\n                <td>");
            EndContext();
            BeginContext(609, 16, false);
#line 19 "D:\Visual Studio\VS2017\VSCode\HtmlInject\MvcApp\Views\Home\ContactListPartial.cshtml"
               Write(contact.LastName);

#line default
#line hidden
            EndContext();
            BeginContext(625, 27, true);
            WriteLiteral("</td>\r\n                <td>");
            EndContext();
            BeginContext(653, 20, false);
#line 20 "D:\Visual Studio\VS2017\VSCode\HtmlInject\MvcApp\Views\Home\ContactListPartial.cshtml"
               Write(contact.EmailAddress);

#line default
#line hidden
            EndContext();
            BeginContext(673, 27, true);
            WriteLiteral("</td>\r\n                <td>");
            EndContext();
            BeginContext(701, 15, false);
#line 21 "D:\Visual Studio\VS2017\VSCode\HtmlInject\MvcApp\Views\Home\ContactListPartial.cshtml"
               Write(contact.PhoneNo);

#line default
#line hidden
            EndContext();
            BeginContext(716, 26, true);
            WriteLiteral("</td>\r\n            </tr>\r\n");
            EndContext();
#line 23 "D:\Visual Studio\VS2017\VSCode\HtmlInject\MvcApp\Views\Home\ContactListPartial.cshtml"
        }

#line default
#line hidden
            BeginContext(753, 22, true);
            WriteLiteral("    </tbody>\r\n</table>");
            EndContext();
        }
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
            BeginContext(0, 2, true);
            WriteLiteral("\r\n");
            EndContext();
#line 2 "C:\Users\Admin\Desktop\ASP.NET core\BanHangOnline\WebSiteBanHang\Views\DemoAjax\DemoAjax.cshtml"

            ViewBag.Title = "DemoAjax";
            Layout        = "~/Views/Layout/HomeLayout.cshtml";

#line default
#line hidden
            BeginContext(92, 23, true);
            WriteLiteral("\r\n<h2>DemoAjax</h2>\r\n\r\n");
            EndContext();
            BeginContext(162, 190, false);
#line 10 "C:\Users\Admin\Desktop\ASP.NET core\BanHangOnline\WebSiteBanHang\Views\DemoAjax\DemoAjax.cshtml"
            Write(Ajax.ActionLink("link test", "LoadAjaxActionLink", new AjaxOptions {
                HttpMethod = "GET", UpdateTargetId = "ketqua", InsertionMode = InsertionMode.InsertAfter, LoadingElementId = "Loading"
            }));

#line default
#line hidden
            EndContext();
            BeginContext(352, 4, true);
            WriteLiteral("\r\n\r\n");
            EndContext();
#line 13 "C:\Users\Admin\Desktop\ASP.NET core\BanHangOnline\WebSiteBanHang\Views\DemoAjax\DemoAjax.cshtml"
            using (Ajax.BeginForm("LoadAjaxBeginForm", new AjaxOptions {
                HttpMethod = "Post", UpdateTargetId = "ketqua", InsertionMode = InsertionMode.Replace, LoadingElementId = "Loading"
            }))
            {
#line default
#line hidden
                BeginContext(592, 20, false);
#line 15 "C:\Users\Admin\Desktop\ASP.NET core\BanHangOnline\WebSiteBanHang\Views\DemoAjax\DemoAjax.cshtml"
                Write(Html.TextBox("txt1"));

#line default
#line hidden
                EndContext();
                BeginContext(614, 44, true);
                WriteLiteral("    <input type=\"submit\" value=\"Submit\" />\r\n");
                EndContext();
#line 17 "C:\Users\Admin\Desktop\ASP.NET core\BanHangOnline\WebSiteBanHang\Views\DemoAjax\DemoAjax.cshtml"
            }

#line default
#line hidden
            BeginContext(661, 94, true);
            WriteLiteral("\r\n<input id=\"button\" type=\"button\" value=\"Submit\" />\r\n<input id=\"ip1\" />\r\n<input id=\"ip2\" />\r\n");
            EndContext();
            BeginContext(792, 443, true);
            WriteLiteral(@"<script>
    $(""#button"").click(function () {
        $('#Loading').show();
        var ip1 = $(""#ip1"").val();
        var ip2 = $(""#ip2"").val();
        $.ajax({
            type: 'GET',
            data: { a: ip1, b: ip2 },
            url: 'LoadAjaxJquery',
            success: function (ketqua) {
                $('#Loading').hide();
                $('#ketqua').html(ketqua);
            }
        })
    })
</script>

");
            EndContext();
            BeginContext(1263, 186, false);
#line 41 "C:\Users\Admin\Desktop\ASP.NET core\BanHangOnline\WebSiteBanHang\Views\DemoAjax\DemoAjax.cshtml"
            Write(Ajax.ActionLink("link test", "SanPhamPartial", new AjaxOptions {
                HttpMethod = "GET", UpdateTargetId = "ketqua", InsertionMode = InsertionMode.InsertAfter, LoadingElementId = "Loading"
            }));

#line default
#line hidden
            EndContext();
            BeginContext(1449, 52, true);
            WriteLiteral("\r\n\r\n\r\n<div id=\"Loading\" style=\"display:none;\">\r\n    ");
            EndContext();
            BeginContext(1501, 40, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "29d828e276d24d3a8d74cf13e14eabf0", async() => {
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(1541, 80, true);
            WriteLiteral("\r\n</div>\r\n\r\n<div id=\"ketqua\" style=\"height:500px\">\r\n    Đây là kết quả\r\n</div>\r\n");
            EndContext();
        }