Beispiel #1
0
        public JsonResult SaveVideo(VideoModel video)
        {
            var sessionId = this.Session["SessionID"].ToString();
            IUserSessionRepository userSessionRepository = RepositoryClassFactory.GetInstance().GetUserSessionRepository();
            UserSession            userSession           = userSessionRepository.FindByID(sessionId);

            if (userSession == null)
            {
                return(Json(new { errorCode = (int)ErrorCode.Redirect, message = Resources.AdminResource.msg_sessionInvalid }, JsonRequestBehavior.AllowGet));
            }

            InsertResponse response = new InsertResponse();

            video.Title = video.Title.Length > 200 ? video.Title.Substring(0, 100) + "..." : video.Title;
            if (!string.IsNullOrEmpty(video.Shortcontent))
            {
                video.Shortcontent = video.Shortcontent.Length > 300 ? video.Shortcontent.Substring(0, 296) + "..." : video.Shortcontent;
            }
            else
            {
                video.Shortcontent = null;
            }
            video.ActionURL   = string.Format("{0}-{1}", UrlSlugger.ToUrlSlug(video.Title), UrlSlugger.Get8Digits());
            video.CreatedDate = DateTime.Now;
            video.VideoID     = Guid.NewGuid().ToString();
            video.CreatedBy   = userSession != null ? userSession.UserID : string.Empty;
            response          = _videoService.CreateVideo(video);

            return(Json(new { errorCode = response.ErrorCode, message = response.Message }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult SaveImportantDeadline(ImportantDeadlineModel importantDeadline)
        {
            var sessionId = this.Session["SessionID"].ToString();
            IUserSessionRepository userSessionRepository = RepositoryClassFactory.GetInstance().GetUserSessionRepository();
            UserSession            userSession           = userSessionRepository.FindByID(sessionId);

            if (userSession == null)
            {
                return(Json(new { errorCode = (int)ErrorCode.Redirect, message = Resources.AdminResource.msg_sessionInvalid }, JsonRequestBehavior.AllowGet));
            }
            InsertResponse response = new InsertResponse();

            importantDeadline.Title = importantDeadline.Title.Length > 200 ? importantDeadline.Title.Substring(0, 100) + "..." : importantDeadline.Title;
            if (importantDeadline.ShortContent != null)
            {
                importantDeadline.ShortContent = importantDeadline.ShortContent.Length > 300 ? importantDeadline.ShortContent.Substring(0, 296) + "..." : importantDeadline.ShortContent;
            }
            importantDeadline.DeadlineID  = Guid.NewGuid().ToString();
            importantDeadline.ActionURL   = string.Format("{0}-{1}", UrlSlugger.ToUrlSlug(importantDeadline.Title), UrlSlugger.Get8Digits());
            importantDeadline.CreatedDate = DateTime.Now;
            importantDeadline.CreatedBy   = userSession != null ? userSession.UserID : string.Empty;
            response = _importantDeadline.CreateImportantDeadline(importantDeadline);

            return(Json(new { errorCode = response.ErrorCode, message = response.Message }, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public JsonResult SaveAlbum(AlbumModel album)
        {
            var sessionId = this.Session["SessionID"].ToString();
            IUserSessionRepository userSessionRepository = RepositoryClassFactory.GetInstance().GetUserSessionRepository();
            UserSession            userSession           = userSessionRepository.FindByID(sessionId);

            if (userSession == null)
            {
                return(Json(new { errorCode = (int)ErrorCode.Redirect, message = Resources.AdminResource.msg_sessionInvalid }, JsonRequestBehavior.AllowGet));
            }

            InsertResponse response = new InsertResponse();

            album.Title = album.Title.Length > 200 ? album.Title.Substring(0, 100) + "..." : album.Title;
            if (!string.IsNullOrEmpty(album.Description))
            {
                album.Description = album.Description.Length > 300 ? album.Description.Substring(0, 296) + "..." : album.Description;
            }
            else
            {
                album.Description = null;
            }
            album.ActionURL   = string.Format("{0}-{1}", UrlSlugger.ToUrlSlug(album.Title), UrlSlugger.Get8Digits());
            album.CreatedDate = DateTime.Now;
            album.AlbumID     = Guid.NewGuid().ToString();
            album.CreatedBy   = userSession != null ? userSession.UserID : string.Empty;

            response = _albumService.CreateAlbum(album);

            return(Json(new { errorCode = response.ErrorCode, message = response.Message }, JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
 public override Tag Add(Tag entity, string addedBy)
 {
     if (string.IsNullOrEmpty(entity.UrlSlug))
     {
         entity.UrlSlug = UrlSlugger.ToUrlSlug(entity.Name);
     }
     return(base.Add(entity, addedBy));
 }
        public override async Task <Result> UpdateAsync(CancellationToken cancellationToken, DND.Domain.Blog.Locations.Location entity, string updatedBy)
        {
            if (string.IsNullOrEmpty(entity.UrlSlug))
            {
                entity.UrlSlug = UrlSlugger.ToUrlSlug(entity.Name);
            }

            return(await base.UpdateAsync(cancellationToken, entity, updatedBy).ConfigureAwait(false));
        }
        public override Task <Result> UpdateAsync(object id, LocationDto dto, string updatedBy, CancellationToken cancellationToken)
        {
            if (string.IsNullOrEmpty(dto.UrlSlug))
            {
                dto.UrlSlug = UrlSlugger.ToUrlSlug(dto.Name);
            }

            return(base.UpdateAsync(id, dto, updatedBy, cancellationToken));
        }
        public override Task <Result <LocationDto> > CreateAsync(LocationDto dto, string createdBy, CancellationToken cancellationToken)
        {
            if (string.IsNullOrEmpty(dto.UrlSlug))
            {
                dto.UrlSlug = UrlSlugger.ToUrlSlug(dto.Name);
            }

            return(base.CreateAsync(dto, createdBy, cancellationToken));
        }
Beispiel #8
0
        public override BlogPost Add(BlogPost entity, string addedBy)
        {
            if (string.IsNullOrEmpty(entity.UrlSlug))
            {
                entity.UrlSlug = UrlSlugger.ToUrlSlug(entity.Title);
            }

            return(base.Add(entity, addedBy));
        }
        public async override Task <Result <BlogPost> > CreateAsync(CancellationToken cancellationToken, BlogPost entity, string createdBy)
        {
            if (string.IsNullOrEmpty(entity.UrlSlug))
            {
                entity.UrlSlug = UrlSlugger.ToUrlSlug(entity.Title);
            }

            return(await base.CreateAsync(cancellationToken, entity, createdBy).ConfigureAwait(false));
        }
Beispiel #10
0
        public override Category Update(Category entity, string updatedBy)
        {
            if (string.IsNullOrEmpty(entity.UrlSlug))
            {
                entity.UrlSlug = UrlSlugger.ToUrlSlug(entity.Name);
            }

            return(base.Update(entity, updatedBy));
        }
        public override Task <Result <Form> > CreateAsync(CancellationToken cancellationToken, Form entity, string createdBy)
        {
            if (string.IsNullOrEmpty(entity.UrlSlug))
            {
                entity.UrlSlug = UrlSlugger.ToUrlSlug(entity.Name);
            }

            return(base.CreateAsync(cancellationToken, entity, createdBy));
        }
Beispiel #12
0
        public override BlogPost Update(BlogPost entity, string updatedBy)
        {
            if (string.IsNullOrEmpty(entity.UrlSlug))
            {
                entity.UrlSlug = UrlSlugger.ToUrlSlug(entity.Title);
            }

            return(base.Update(entity, updatedBy));
        }
        public override async Task <Result <Location> > CreateAsync(CancellationToken cancellationToken, Location entity, string createdBy)
        {
            if (string.IsNullOrEmpty(entity.UrlSlug))
            {
                entity.UrlSlug = UrlSlugger.ToUrlSlug(entity.Name);
            }

            return(await base.CreateAsync(cancellationToken, entity, createdBy).ConfigureAwait(false));
        }
Beispiel #14
0
        public override Task <Result> UpdateAsync(CancellationToken cancellationToken, Section entity, string updatedBy)
        {
            if (string.IsNullOrEmpty(entity.UrlSlug))
            {
                entity.UrlSlug = UrlSlugger.ToUrlSlug(entity.Name);
            }

            return(base.UpdateAsync(cancellationToken, entity, updatedBy));
        }
 public ActionResult UpdateCategoryMenu(MenuModel menu)
 {
     if (ModelState.IsValid)
     {
         menu.ActionURL = string.Format("{0}-{1}", UrlSlugger.ToUrlSlug(menu.Title), UrlSlugger.Get8Digits());
         BaseResponse response = _menuCategoryService.UpdateMenu(menu);
         ViewBag.Message = response;
     }
     return(View("UpdateCategory", menu));
 }
        public JsonResult SaveNews(NewsModel news, HttpPostedFileBase imageFile)
        {
            var sessionId = this.Session["SessionID"].ToString();
            IUserSessionRepository userSessionRepository = RepositoryClassFactory.GetInstance().GetUserSessionRepository();
            UserSession            userSession           = userSessionRepository.FindByID(sessionId);

            if (userSession == null)
            {
                return(Json(new { errorCode = (int)ErrorCode.Redirect, message = Resources.AdminResource.msg_sessionInvalid }, JsonRequestBehavior.AllowGet));
            }

            InsertResponse response = new InsertResponse();

            news.Title        = news.Title.Length > 200 ? news.Title.Substring(0, 100) + "..." : news.Title;
            news.ShortContent = news.ShortContent.Length > 300 ? news.ShortContent.Substring(0, 296) + "..." : news.ShortContent;
            news.ActionURL    = string.Format("{0}-{1}", UrlSlugger.ToUrlSlug(news.Title), UrlSlugger.Get8Digits());
            news.CreatedDate  = DateTime.Now;
            news.NewsID       = Guid.NewGuid().ToString();
            news.CreatedBy    = userSession != null ? userSession.UserID : string.Empty;

            response = _newsService.CreateNews(news);

            if (response.ErrorCode == (int)ErrorCode.None)
            {
                //Image
                if (imageFile != null)
                {
                    //Create folder
                    try
                    {
                        if (!System.IO.File.Exists(Server.MapPath("~/Content/upload/images/news/")))
                        {
                            Directory.CreateDirectory(Server.MapPath("~/Content/upload/images/news/"));
                        }
                    }
                    catch (Exception) { }

                    string extension = imageFile.FileName.Substring(imageFile.FileName.LastIndexOf("."));
                    string filename  = imageFile.FileName.Substring(0, imageFile.FileName.LastIndexOf(".")).Replace(" ", "-");
                    filename = string.Format("{0}-{1}", filename, UrlSlugger.Get8Digits());
                    imageFile.SaveAs(Server.MapPath("~/Content/upload/images/news/" + filename + extension));

                    news.ThumbnailURL = "/Content/upload/images/news/" + filename + extension;
                    _newsService.UpdateNews(news);
                }
            }
            return(Json(new { errorCode = response.ErrorCode, message = response.Message }, JsonRequestBehavior.AllowGet));
        }
        public async Task <Result> UpdateAsync(BlogPost entity, IEnumerable <BlogPostTag> insertTags, IEnumerable <BlogPostTag> deleteTags, IEnumerable <BlogPostLocation> insertLocations, IEnumerable <BlogPostLocation> deleteLocations, string updatedBy, CancellationToken cancellationToken)
        {
            if (string.IsNullOrEmpty(entity.UrlSlug))
            {
                entity.UrlSlug = UrlSlugger.ToUrlSlug(entity.Title);
            }

            using (var UoW = UnitOfWorkFactory.Create(UnitOfWorkScopeOption.JoinExisting))
            {
                UoW.Repository <ApplicationContext, BlogPost>().UpdateGraph(entity);

                await UoW.CompleteAsync(cancellationToken).ConfigureAwait(false);
            }

            return(Result.Ok());
        }
        public ActionResult CreateCategoryMenu(MenuModel menu, string parentTitle)
        {
            if (ModelState.IsValid)
            {
                FindItemReponse <MenuModel> findParentMenu = _menuCategoryService.FindByTitle(parentTitle);
                if (findParentMenu.Item != null)
                {
                    menu.ParentID = findParentMenu.Item.MenuID;
                }
                menu.MenuID      = Guid.NewGuid().ToString();
                menu.ActionURL   = string.Format("{0}-{1}", UrlSlugger.ToUrlSlug(menu.Title), UrlSlugger.Get8Digits());
                menu.CreatedDate = DateTime.Now;

                InsertResponse response = _menuCategoryService.CreateMenu(menu);
            }
            return(RedirectToAction("Index"));
        }
        public ActionResult Upload(int?chunk, string name, string AlbumID)
        {
            FindItemReponse <AlbumModel> albumResponse = _albumService.FindAlbumByID(AlbumID);

            if (albumResponse.Item == null)
            {
                return(Json(new { success = false }, JsonRequestBehavior.AllowGet));
            }

            var sessionId = this.Session["SessionID"].ToString();
            IUserSessionRepository userSessionRepository = RepositoryClassFactory.GetInstance().GetUserSessionRepository();
            UserSession            userSession           = userSessionRepository.FindByID(sessionId);

            if (userSession == null)
            {
                return(Json(new { errorCode = (int)ErrorCode.Redirect, message = Resources.AdminResource.msg_sessionInvalid }, JsonRequestBehavior.AllowGet));
            }

            chunk = chunk ?? 0;

            InsertResponse response = new InsertResponse();

            PhotoModel photo = new PhotoModel();

            if (chunk == 0)
            {
                photo.Title       = name.Length > 200 ? name.Substring(0, 100) + "..." : name;
                photo.ActionURL   = string.Format("{0}-{1}", UrlSlugger.ToUrlSlug(photo.Title), UrlSlugger.Get8Digits());
                photo.CreatedDate = DateTime.Now;
                photo.PhotoID     = Guid.NewGuid().ToString();
                photo.ImageURL    = "";
                photo.CreatedBy   = userSession != null ? userSession.UserID : string.Empty;
                photo.AlbumID     = AlbumID;

                response = _photoService.CreatePhoto(photo);
            }

            if (response.ErrorCode == (int)ErrorCode.None)
            {
                var fileUpload = Request.Files[0];

                //Image
                if (fileUpload != null)
                {
                    //Create Folder
                    try
                    {
                        if (!System.IO.File.Exists(Server.MapPath("~/Content/upload/images/Photo/")))
                        {
                            Directory.CreateDirectory(Server.MapPath("~/Content/upload/images/Photo/"));
                        }
                    }
                    catch (Exception) { }

                    var    uploadPath = Server.MapPath("~/Content/upload/images/Photo/");
                    string extension  = name.Substring(name.LastIndexOf("."));
                    string filename   = name.Substring(0, name.LastIndexOf(".")).Replace(" ", "-");
                    filename = string.Format("{0}-{1}", filename, UrlSlugger.Get8Digits());

                    using (var fs = new FileStream(Path.Combine(uploadPath, string.Format("{0}{1}", filename, extension)), chunk == 0 ? FileMode.Create : FileMode.Append))
                    {
                        var buffer = new byte[fileUpload.InputStream.Length];
                        fileUpload.InputStream.Read(buffer, 0, buffer.Length);
                        fs.Write(buffer, 0, buffer.Length);
                    }

                    if (chunk == 0)
                    {
                        photo.ImageURL = "/Content/upload/images/Photo/" + filename + extension;
                        _photoService.UpdatePhoto(photo);
                    }
                }
            }
            return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
        }
 public static string ToUrlSlug(this string s)
 {
     return(UrlSlugger.ToUrlSlug(s));
 }
Beispiel #21
0
        public JsonResult SaveArticle(ArticleModel article, string menuTitle, HttpPostedFileBase file)
        {
            var sessionId = this.Session["SessionID"].ToString();
            IUserSessionRepository userSessionRepository = RepositoryClassFactory.GetInstance().GetUserSessionRepository();
            UserSession            userSession           = userSessionRepository.FindByID(sessionId);

            if (userSession == null)
            {
                return(Json(new { errorCode = (int)ErrorCode.Redirect, message = Resources.AdminResource.msg_sessionInvalid }, JsonRequestBehavior.AllowGet));
            }

            InsertResponse response = new InsertResponse();

            string menuID = null;
            string url    = string.Empty;

            if (!string.IsNullOrEmpty(menuTitle))
            {
                FindItemReponse <MenuModel> findParentMenu = _menuCategoryService.FindByTitle(menuTitle);
                if (findParentMenu.Item == null)
                {
                    return(Json(new { errorCode = (int)ErrorCode.Error, message = string.Format(Resources.AdminResource.msg_menuCategoryNotFound, menuTitle) }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    menuID = findParentMenu.Item.MenuID;
                }
            }

            //Create article
            article.Title = article.Title.Length > 200 ? article.Title.Substring(0, 100) + "..." : article.Title;
            if (article.ShortContent != null)
            {
                article.ShortContent = article.ShortContent.Length > 300 ? article.ShortContent.Substring(0, 296) + "..." : article.ShortContent;
            }
            article.ArticleID   = Guid.NewGuid().ToString();
            article.ActionURL   = string.Format("{0}-{1}", UrlSlugger.ToUrlSlug(article.Title), UrlSlugger.Get8Digits());
            article.CreatedDate = DateTime.Now;
            article.CreatedBy   = userSession.UserID;
            article.MenuID      = menuID;

            if (string.IsNullOrEmpty(menuID))
            {
                url = string.Format("{0}://{1}:{2}/Home/ArticleView/{3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, article.ActionURL);
            }

            response = _articleService.CreateArticle(article);

            if (response.ErrorCode == (int)ErrorCode.None)
            {
                //Image
                if (file != null)
                {
                    //Create folder
                    try
                    {
                        if (!System.IO.File.Exists(Server.MapPath("~/Content/upload/images/article/")))
                        {
                            Directory.CreateDirectory(Server.MapPath("~/Content/upload/images/article/"));
                        }
                    }
                    catch (Exception) { }

                    string extension = file.FileName.Substring(file.FileName.LastIndexOf("."));
                    string filename  = file.FileName.Substring(0, file.FileName.LastIndexOf(".")).Replace(" ", "-");
                    filename = string.Format("{0}-{1}", filename, UrlSlugger.Get8Digits());
                    file.SaveAs(Server.MapPath("~/Content/upload/images/article/" + filename + extension));

                    article.ImageURL = "/Content/upload/images/article/" + filename + extension;
                    _articleService.UpdateArticle(article);
                }
            }

            return(Json(new { errorCode = response.ErrorCode, message = response.Message, url = url }, JsonRequestBehavior.AllowGet));
        }
Beispiel #22
0
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
#line 2 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"

            var pesquisa  = Context.Request.Query["pesquisa"];
            var ordenacao = Context.Request.Query["ordenacao"].ToString();

#line default
#line hidden
#line 6 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
            if (Model.lista.Count > 0)
            {
#line default
#line hidden
                BeginContext(200, 105, true);
                WriteLiteral("    <div class=\"row\" style=\"margin-top:10px;\">\r\n        <div class=\"offset-md-10 col-md-2\">\r\n            ");
                EndContext();
                BeginContext(305, 102, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("select", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "c8b008da7fc2416e901054759761868d", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.SelectTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
#line 11 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => ordenacao);

#line default
#line hidden
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
#line 11 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.Items = Model.ordenacao;

#line default
#line hidden
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-items", __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.Items, 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(407, 30, true);
                WriteLiteral("\r\n        </div>\r\n    </div>\r\n");
                EndContext();
                BeginContext(439, 47, true);
                WriteLiteral("    <div class=\"row\" style=\"margin-top:50px\">\r\n");
                EndContext();
#line 16 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                foreach (var produto in Model.lista)
                {
#line default
#line hidden
                    BeginContext(544, 47, true);
                    WriteLiteral("            <div class=\"col-lg-3 col-md-6 mb-4\"");
                    EndContext();
                    BeginWriteAttribute("value", " value=\"", 591, "\"", 610, 1);
#line 18 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                    WriteAttributeValue("", 599, produto.Id, 599, 11, false);

#line default
#line hidden
                    EndWriteAttribute();
                    BeginContext(611, 70, true);
                    WriteLiteral(">\r\n                <div class=\"card h-100\">\r\n                    <a>\r\n");
                    EndContext();
#line 21 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                    if (produto.Imagens != null && produto.Imagens.Count() > 0)
                    {
#line default
#line hidden
                        BeginContext(794, 53, true);
                        WriteLiteral("                            <img class=\"card-img-top\"");
                        EndContext();
                        BeginWriteAttribute("src", " src=\"", 847, "\"", 907, 1);
#line 23 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                        WriteAttributeValue("", 853, Url.Content(produto.Imagens.FirstOrDefault().Caminho), 853, 54, false);

#line default
#line hidden
                        EndWriteAttribute();
                        BeginContext(908, 10, true);
                        WriteLiteral(" alt=\"\">\r\n");
                        EndContext();
#line 24 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                    }
                    else
                    {
#line default
#line hidden
                        BeginContext(1002, 28, true);
                        WriteLiteral("                            ");
                        EndContext();
                        BeginContext(1030, 62, false);
                        __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "7500667c83a24488b8f83fb1df1470c4", 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_2);
                        __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
                        __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
                        await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                        if (!__tagHelperExecutionContext.Output.IsContentModified)
                        {
                            await __tagHelperExecutionContext.SetOutputContentAsync();
                        }
                        Write(__tagHelperExecutionContext.Output);
                        __tagHelperExecutionContext = __tagHelperScopeManager.End();
                        EndContext();
                        BeginContext(1092, 2, true);
                        WriteLiteral("\r\n");
                        EndContext();
#line 28 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                    }

#line default
#line hidden
                    BeginContext(1121, 160, true);
                    WriteLiteral("                    </a>\r\n                    <div class=\"card-body\">\r\n                        <h4 class=\"card-title text-center\">\r\n                            ");
                    EndContext();
                    BeginContext(1282, 125, false);
#line 32 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                    Write(Html.ActionLink(produto.ToLower(produto.Nomeprod), "Produto", new { produto, Prod = UrlSlugger.ToUrlSlug(produto.Nomeprod) }));

#line default
#line hidden
                    EndContext();
                    BeginContext(1407, 81, true);
                    WriteLiteral("\r\n                        </h4>\r\n                        <h5 class=\"text-center\">");
                    EndContext();
                    BeginContext(1489, 31, false);
#line 34 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                    Write(produto.Valorprod.ToString("C"));

#line default
#line hidden
                    EndContext();
                    BeginContext(1520, 9, true);
                    WriteLiteral("</h5>\r\n\r\n");
                    EndContext();
#line 36 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                    if (produto.Descprod != null)
                    {
#line default
#line hidden
                        BeginContext(1612, 49, true);
                        WriteLiteral("                            <p class=\"card-text\">");
                        EndContext();
                        BeginContext(1662, 16, false);
#line 38 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                        Write(produto.Descprod);

#line default
#line hidden
                        EndContext();
                        BeginContext(1678, 6, true);
                        WriteLiteral("</p>\r\n");
                        EndContext();
#line 39 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                    }
                    else
                    {
#line default
#line hidden
                        BeginContext(1768, 89, true);
                        WriteLiteral("                            <p class=\"card-text text-center\">Produto sem descrição.</p>\r\n");
                        EndContext();
#line 43 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                    }

#line default
#line hidden
                    BeginContext(1884, 258, true);
                    WriteLiteral(@"                    </div>
                    <div class=""card-footer text-center"">
                        <small class=""text-muted"">&#9733; &#9733; &#9733; &#9733; &#9734;</small>
                    </div>
                </div>
            </div>
");
                    EndContext();
#line 50 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
                }

#line default
#line hidden
                BeginContext(2153, 12, true);
                WriteLiteral("    </div>\r\n");
                EndContext();
#line 52 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
            }

#line default
#line hidden
            BeginContext(2168, 113, true);
            WriteLiteral("    <div style=\"margin-left:auto; margin-right: auto;\">\r\n        <div class=\"offset-md-3 col-md-6\">\r\n            ");
            EndContext();
            BeginContext(2282, 144, false);
#line 55 "C:\inetpub\wwwroot\BazarPapelaria10\Views\Shared\Components\ProdutoListagem\Default.cshtml"
            Write(Html.PagedListPager((IPagedList)Model.lista, pagina => Url.Action("Index", new { pagina = pagina, pesquisa = pesquisa, ordenacao = ordenacao })));

#line default
#line hidden
            EndContext();
            BeginContext(2426, 30, true);
            WriteLiteral("\r\n        </div>\r\n    </div>\r\n");
            EndContext();
        }
        public JsonResult SaveConference(ConferenceDeclarationModel conference, HttpPostedFileBase imageFile, HttpPostedFileBase file)
        {
            var sessionId = this.Session["SessionID"].ToString();
            IUserSessionRepository userSessionRepository = RepositoryClassFactory.GetInstance().GetUserSessionRepository();
            UserSession            userSession           = userSessionRepository.FindByID(sessionId);

            if (userSession == null)
            {
                return(Json(new { errorCode = (int)ErrorCode.Redirect, message = Resources.AdminResource.msg_sessionInvalid }, JsonRequestBehavior.AllowGet));
            }

            InsertResponse response = new InsertResponse();

            conference.Title = conference.Title.Length > 200 ? conference.Title.Substring(0, 100) + "..." : conference.Title;
            if (!string.IsNullOrEmpty(conference.ShortContent))
            {
                conference.ShortContent = conference.ShortContent.Length > 300 ? conference.ShortContent.Substring(0, 296) + "..." : conference.ShortContent;
            }
            else
            {
                conference.ShortContent = null;
            }
            conference.ActionURL    = string.Format("{0}-{1}", UrlSlugger.ToUrlSlug(conference.Title), UrlSlugger.Get8Digits());
            conference.CreatedDate  = DateTime.Now;
            conference.ConferenceID = Guid.NewGuid().ToString();
            conference.CreatedBy    = userSession != null ? userSession.UserID : string.Empty;

            response = _conferenceService.CreateConference(conference);
            if (response.ErrorCode == (int)ErrorCode.None)
            {
                //Image
                if (imageFile != null)
                {
                    //Create Folder
                    try
                    {
                        if (!System.IO.File.Exists(Server.MapPath("~/Content/upload/images/Conference/")))
                        {
                            Directory.CreateDirectory(Server.MapPath("~/Content/upload/images/Conference/"));
                        }
                    }
                    catch (Exception) { }
                    string extension = imageFile.FileName.Substring(imageFile.FileName.LastIndexOf("."));
                    string filename  = imageFile.FileName.Substring(0, imageFile.FileName.LastIndexOf(".")).Replace(" ", "-");
                    filename = string.Format("{0}-{1}", filename, UrlSlugger.Get8Digits());
                    imageFile.SaveAs(Server.MapPath("~/Content/upload/images/Conference/" + filename + extension));
                    conference.ImageURL = "/Content/upload/images/Conference/" + filename + extension;
                    _conferenceService.UpdateConference(conference);
                }
                if (file != null)
                {
                    //Create Folder
                    try
                    {
                        if (!System.IO.File.Exists(Server.MapPath("~/Content/upload/documents/Conference/")))
                        {
                            Directory.CreateDirectory(Server.MapPath("~/Content/upload/documents/Conference/"));
                        }
                    }
                    catch (Exception) { }
                    string extension = file.FileName.Substring(file.FileName.LastIndexOf("."));
                    string filename  = file.FileName.Substring(0, file.FileName.LastIndexOf(".")).Replace(" ", "-");
                    filename = string.Format("{0}-{1}", filename, UrlSlugger.Get8Digits());
                    file.SaveAs(Server.MapPath("~/Content/upload/documents/Conference/" + filename + extension));
                    conference.AttachmentURL = "/Content/upload/documents/Conference/" + filename + extension;
                    _conferenceService.UpdateConference(conference);
                }
            }
            return(Json(new { errorCode = response.ErrorCode, message = response.Message }, JsonRequestBehavior.AllowGet));
        }