public ActionResult BlogCategory(int Id = 0) { if (!SavePermissionsToViewBag(FeatureEnum.Blog)) return Redirect("~/home/unauthorized"); BlogCategoryModel BlogCategoryModel = new BlogCategoryModel(); BlogCategoryModel.BlogCategoryId = Id; if (Request.IsAjaxRequest()) return PartialView(BlogCategoryModel); else return View(BlogCategoryModel); }
/// <summary> /// SaveBlogCategory /// </summary> /// <param name="blogCategory"></param> public void SaveBlogCategory(BlogCategoryModel blogCategory) { BlogCategoryDC blogCategoryDC = Mapper.Map<BlogCategoryModel, BlogCategoryDC>(blogCategory); ServiceResponse<int> saveBlogCategoryResponse = _contentProxy.Execute(opt => opt.SaveBlogCategory(blogCategoryDC)); if (saveBlogCategoryResponse.Status != ResponseStatus.Success) HandleError(saveBlogCategoryResponse.Status, saveBlogCategoryResponse.ResponseMessage); else blogCategory.BlogCategoryId = saveBlogCategoryResponse.Result; }
public HttpResponseMessage SaveBlogCategory(BlogCategoryModel blogCategoryModel, int siteId) { ContentClientProcessor.UserContext.SiteId = siteId; ContentClientProcessor.SaveBlogCategory(blogCategoryModel); return Request.CreateResponse(HttpStatusCode.OK, new { Message = CoreMessages.SavedSuccessfully, Id = blogCategoryModel.BlogCategoryId }); }
/// <summary> /// GetBlogCategory /// </summary> /// <param name="blogCategoryId"></param> /// <returns></returns> public BlogCategoryModel GetBlogCategory(int blogCategoryId) { BlogCategoryModel BlogCategoryResult = new BlogCategoryModel(); ServiceResponse<BlogCategoryDC> BlogCategoryResponse = _contentProxy.Execute(opt => opt.GetBlogCategory(blogCategoryId)); if (BlogCategoryResponse.Status == ResponseStatus.Success) { BlogCategoryResult = Mapper.Map<BlogCategoryDC, BlogCategoryModel>(BlogCategoryResponse.Result); } else { HandleError(BlogCategoryResponse.Status, BlogCategoryResponse.ResponseMessage); } return BlogCategoryResult; }