Beispiel #1
0
 public CommentWithPagingViewModel commentsPaging(int curretPage = 0)
 {
     //TODO: Paging Comments
     int take = 10;
     CommentWithPagingViewModel CommentWithPaging = new CommentWithPagingViewModel();
     List<CommentsViewModel> CommentsModel = db.comments.Where(c=> c.LanguageTitle == language).Select(c => new CommentsViewModel
     {
         Text = c.Text,
         FullName = c.FullName,
         isPublic = c.isPublic,
         Date = c.Date
     }).Skip(curretPage * take).Take(take).OrderByDescending(c=>c.Date).ToList();
     CommentWithPaging.comments = CommentsModel;
     CommentWithPaging.pageCount = db.comments.Count() / take;
     CommentWithPaging.currentPage = curretPage;
     return CommentWithPaging;
 }
Beispiel #2
0
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
            BeginContext(72, 2, true);
            WriteLiteral("\r\n");
            EndContext();
#line 4 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"

            ViewData["Title"] = "Comments";
            Layout            = "~/Views/Shared/_mainLayout.cshtml";

            CommentWithPagingViewModel comments = ViewBag.CommentListModel as CommentWithPagingViewModel;

#line default
#line hidden
            BeginContext(270, 87, true);
            WriteLiteral("\r\n<div class=\"container-fluid\">\r\n\r\n    <div class=\"row\" style=\"margin-bottom: 100px\">\r\n");
            EndContext();
#line 14 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
            if (ViewBag.IsSuccess != null)
            {
#line default
#line hidden
                BeginContext(409, 191, true);
                WriteLiteral("            <div class=\"alert alert-success text-center\">\r\n                <p class=\"help-block\"> ثبت نظر با موفقیت انجام شد. نظر شما پس از تایید نمایش داده خواهد شد</p>\r\n            </div>\r\n");
                EndContext();
#line 19 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
            }

#line default
#line hidden
            BeginContext(611, 516, true);
            WriteLiteral(@"        <div class=""section-title row text-center"" style=""margin-top: 100px"">
            <div class=""col-md-8 col-md-offset-2"">
                <h3>Comments</h3>
                <hr class=""grd1"">
                <p style=""color: black"">Let us know your opinion</p>
            </div>
        </div><!-- end title -->
        <div class=""col-md-8 col-md-offset-2"">
            <div class=""contact_form"" style=""background-color:rgba(0, 0, 0, 0.70)"">
                <div id=""message""></div>
                ");
            EndContext();
            BeginContext(1127, 1448, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "8d711036d031887f745d7bd4a0db36b3693ef68811268", async() => {
                BeginContext(1239, 159, true);
                WriteLiteral("\r\n                    <fieldset class=\"row-fluid\">\r\n                        <div class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\">\r\n                            ");
                EndContext();
                BeginContext(1398, 83, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "8d711036d031887f745d7bd4a0db36b3693ef68811819", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_0.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
#line 33 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.FullName);

#line default
#line hidden
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(1481, 138, true);
                WriteLiteral("\r\n                        </div>\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-6 col-xs-12\">\r\n                            ");
                EndContext();
                BeginContext(1619, 82, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "8d711036d031887f745d7bd4a0db36b3693ef68813952", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_3.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3);
#line 36 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Email);

#line default
#line hidden
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(1701, 140, true);
                WriteLiteral("\r\n\r\n                        </div>\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-6 col-xs-12\">\r\n                            ");
                EndContext();
                BeginContext(1841, 87, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "8d711036d031887f745d7bd4a0db36b3693ef68816086", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_0.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
#line 40 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.PhoneNumber);

#line default
#line hidden
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(1928, 141, true);
                WriteLiteral("\r\n                        </div>\r\n                        <div class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\">\r\n                            ");
                EndContext();
                BeginContext(2069, 93, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("textarea", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "8d711036d031887f745d7bd4a0db36b3693ef68818225", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_TextAreaTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.TextAreaTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_TextAreaTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
#line 43 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                __Microsoft_AspNetCore_Mvc_TagHelpers_TextAreaTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Text);

#line default
#line hidden
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_TextAreaTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2162, 58, true);
                WriteLiteral("\r\n                        </div>\r\n                        ");
                EndContext();
                BeginContext(2220, 40, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "8d711036d031887f745d7bd4a0db36b3693ef68820163", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationSummaryTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper);
#line 45 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper.ValidationSummary = global::Microsoft.AspNetCore.Mvc.Rendering.ValidationSummary.All;

#line default
#line hidden
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-validation-summary", __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper.ValidationSummary, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2260, 308, true);
                WriteLiteral(@"
                        <div class=""col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center"">
                            <input type=""submit"" value=""SEND"" id=""submit"" class=""btn btn-light btn-radius btn-brd btn-block subt"" />
                        </div>
                    </fieldset>
                ");
                EndContext();
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Action = (string)__tagHelperAttribute_8.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_8);
            __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Controller = (string)__tagHelperAttribute_9.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_9);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_10);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_11);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_12);
            __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_13.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_13);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(2575, 237, true);
            WriteLiteral("\r\n            </div>\r\n        </div><!-- end col -->\r\n    </div><!-- end row -->\r\n    <hr />\r\n    <!-- Comments List -->\r\n    <div class=\"container\" style=\"border: 2px solid rgba(0, 0, 0, 0.34); background-color: white; padding: 30px\">\r\n");
            EndContext();
#line 57 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
            if (comments.comments.Count < 1)
            {
#line default
#line hidden
                BeginContext(2866, 58, true);
                WriteLiteral("            <h2>No comments have been received yet!</h2>\r\n");
                EndContext();
#line 60 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
            }
            else
            {
                foreach (var comment in comments.comments)
                {
                    if (comment.isPublic)
                    {
#line default
#line hidden
                        BeginContext(3089, 120, true);
                        WriteLiteral("                    <div class=\"row\">\r\n                        <div class=\"col col-md-12\">\r\n                            ");
                        EndContext();
                        BeginContext(3209, 100, false);
                        __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "8d711036d031887f745d7bd4a0db36b3693ef68825182", 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_14);
                        __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_15);
                        __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_16);
                        await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                        if (!__tagHelperExecutionContext.Output.IsContentModified)
                        {
                            await __tagHelperExecutionContext.SetOutputContentAsync();
                        }
                        Write(__tagHelperExecutionContext.Output);
                        __tagHelperExecutionContext = __tagHelperScopeManager.End();
                        EndContext();
                        BeginContext(3309, 36, true);
                        WriteLiteral("\r\n                            <span>");
                        EndContext();
                        BeginContext(3346, 16, false);
#line 70 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                        Write(comment.FullName);

#line default
#line hidden
                        EndContext();
                        BeginContext(3362, 61, true);
                        WriteLiteral("</span>\r\n                            <p style=\"color: black\">");
                        EndContext();
                        BeginContext(3424, 12, false);
#line 71 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                        Write(comment.Text);

#line default
#line hidden
                        EndContext();
                        BeginContext(3436, 66, true);
                        WriteLiteral("</p>\r\n                        </div>\r\n                    </div>\r\n");
                        EndContext();
#line 74 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                    }

#line default
#line hidden
                    BeginContext(3521, 24, true);
                    WriteLiteral("                <hr />\r\n");
                    EndContext();
#line 76 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                }
            }

#line default
#line hidden
            BeginContext(3571, 202, true);
            WriteLiteral("\r\n    </div>\r\n\r\n \r\n    <!-- paging section -->\r\n    <div class=\"dataTables_paginate paging_simple_numbers\" id=\"dtBasicExample_paginate\" style=\"text-align: center\">\r\n            <ul class=\"pagination\">\r\n");
            EndContext();
#line 85 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
            for (int i = 0; i < comments.pageCount; i++)
            {
#line default
#line hidden
                BeginContext(3855, 23, true);
                WriteLiteral("                    <li");
                EndContext();
                BeginWriteAttribute("class", " class=\"", 3878, "\"", 3984, 1);
#line 87 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                WriteAttributeValue("", 3886, (comments.currentPage == i ? "paginate_button page-item active" : "paginate_button page-item"), 3886, 98, false);

#line default
#line hidden
                EndWriteAttribute();
                BeginContext(3985, 29, true);
                WriteLiteral(">\r\n                        <a");
                EndContext();
                BeginWriteAttribute("href", " href=\"", 4014, "\"", 4033, 2);
                WriteAttributeValue("", 4021, "/Comments/", 4021, 10, true);
#line 88 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                WriteAttributeValue("", 4031, i, 4031, 2, false);

#line default
#line hidden
                EndWriteAttribute();
                BeginContext(4034, 50, true);
                WriteLiteral(" aria-controls=\"dtBasicExample\" class=\"page-link\">");
                EndContext();
                BeginContext(4086, 5, false);
#line 88 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
                Write(i + 1);

#line default
#line hidden
                EndContext();
                BeginContext(4092, 33, true);
                WriteLiteral("</a>\r\n                    </li>\r\n");
                EndContext();
#line 90 "D:\Project\Fardin\Project Core\Fardin\Fardin\Views\Home\Comments.cshtml"
            }

#line default
#line hidden
            BeginContext(4144, 71, true);
            WriteLiteral("            </ul>\r\n    </div><br /><br /><br /><br /><br />\r\n\r\n</div>\r\n");
            EndContext();
        }