Beispiel #1
0
        public virtual EntityT Save(EntityT entity)
        {
            if (DoBeforeSave(entity))
            {
                using (var txn = _repository.BeginTransaction())
                {
                    try
                    {
                        var model = (IBaseModel <long>)entity;
                        model.ModifyBy      = model.CreateBy = GlobalContext.GetCurrentUserId();
                        model.VersionNumber = 1;
                        _repository.Add(entity);
                        _repository.SaveChange();
                        txn.Commit();
                    }
                    catch (Exception ex)
                    {
                        txn.Rollback();
                        throw ex;
                    }
                }
                DoAfterSave(entity);
            }

            return(entity);
        }
Beispiel #2
0
        public NccPost CopyNewData(NccPost copyFrom, NccPost copyTo)
        {
            copyTo.ModificationDate = copyFrom.ModificationDate;
            copyTo.ModifyBy         = GlobalContext.GetCurrentUserId();
            copyTo.Name             = copyFrom.Name;
            copyTo.Status           = copyFrom.Status;
            copyTo.ModificationDate = copyFrom.ModificationDate;
            copyTo.PostStatus       = copyFrom.PostStatus;
            copyTo.PostType         = copyFrom.PostType;
            copyTo.Parent           = copyFrom.Parent;
            copyTo.PublishDate      = copyFrom.PublishDate;
            copyTo.Layout           = copyFrom.Layout;
            copyTo.VersionNumber    = copyFrom.VersionNumber;
            copyTo.AllowComment     = copyFrom.AllowComment;
            copyTo.Author           = copyFrom.Author;
            copyTo.CreateBy         = copyFrom.CreateBy;
            copyTo.CreationDate     = copyFrom.CreationDate;
            copyTo.IsFeatured       = copyFrom.IsFeatured;
            copyTo.IsStiky          = copyFrom.IsStiky;
            //copyTo.Comments = copyFrom.Comments;
            copyTo.RelatedPosts = copyFrom.RelatedPosts;
            copyTo.Tags         = copyFrom.Tags;
            copyTo.ThumImage    = copyFrom.ThumImage;
            copyTo.Metadata     = copyFrom.Metadata;

            copyTo.Categories = copyFrom.Categories;

            var currentDateTime = DateTime.Now;

            foreach (var item in copyFrom.PostDetails)
            {
                var            isNew = false;
                NccPostDetails temp  = copyTo.PostDetails.Where(x => x.Language == item.Language).FirstOrDefault();
                if (temp == null)
                {
                    isNew             = true;
                    temp              = new NccPostDetails();
                    temp.CreationDate = currentDateTime;
                    temp.CreateBy     = GlobalContext.GetCurrentUserId();
                    temp.Language     = item.Language;
                }
                temp.ModificationDate = currentDateTime;
                temp.ModifyBy         = GlobalContext.GetCurrentUserId();

                temp.Title           = item.Title;
                temp.Slug            = item.Slug;
                temp.Content         = item.Content;
                temp.MetaDescription = item.MetaDescription;
                temp.MetaKeyword     = item.MetaKeyword;
                temp.Metadata        = item.Metadata;
                temp.Name            = string.IsNullOrEmpty(item.Name) ? item.Slug : item.Name;
                if (isNew)
                {
                    copyTo.PostDetails.Add(temp);
                }
            }

            return(copyTo);
        }
        private void CopyNewData(NccWebSite oldEntity, NccWebSite entity)
        {
            var modificationDate = DateTime.Now;

            oldEntity.AllowRegistration = entity.AllowRegistration;
            oldEntity.DateFormat        = entity.DateFormat;
            oldEntity.DomainName        = entity.DomainName;
            oldEntity.EmailAddress      = entity.EmailAddress;
            oldEntity.Language          = entity.Language;
            oldEntity.ModificationDate  = modificationDate;
            oldEntity.ModifyBy          = entity.ModifyBy;
            oldEntity.Name           = entity.Name;
            oldEntity.NewUserRole    = entity.NewUserRole;
            oldEntity.Status         = entity.Status;
            oldEntity.TimeFormat     = entity.TimeFormat;
            oldEntity.TimeZone       = entity.TimeZone;
            oldEntity.IsMultiLangual = entity.IsMultiLangual;
            oldEntity.VersionNumber += 1;
            oldEntity.Metadata       = entity.Metadata;
            oldEntity.EnableCache    = entity.EnableCache;

            foreach (var item in entity.WebSiteInfos)
            {
                var isNew     = false;
                var oldWsInfo = oldEntity.WebSiteInfos.Where(x => x.Language == item.Language).FirstOrDefault();
                if (oldWsInfo == null)
                {
                    isNew                   = true;
                    oldWsInfo               = new NccWebSiteInfo();
                    oldWsInfo.CreateBy      = item.CreateBy;
                    oldWsInfo.CreationDate  = item.CreationDate;
                    oldWsInfo.VersionNumber = item.VersionNumber;
                    oldWsInfo.VersionNumber = 0;
                    oldWsInfo.Language      = item.Language;
                }

                oldWsInfo.Copyrights = item.Copyrights;
                oldWsInfo.FaviconUrl = item.FaviconUrl;
                //oldWsInfo.Language = item.Language;
                oldWsInfo.ModificationDate      = modificationDate;
                oldWsInfo.ModifyBy              = GlobalContext.GetCurrentUserId();
                oldWsInfo.Name                  = item.Name;
                oldWsInfo.PrivacyPolicyUrl      = item.PrivacyPolicyUrl;
                oldWsInfo.SiteLogoUrl           = item.SiteLogoUrl;
                oldWsInfo.SiteTitle             = item.SiteTitle;
                oldWsInfo.Status                = item.Status;
                oldWsInfo.Tagline               = item.Tagline;
                oldWsInfo.TermsAndConditionsUrl = item.TermsAndConditionsUrl;
                oldWsInfo.VersionNumber        += 1;
                oldWsInfo.Metadata              = item.Metadata;

                if (isNew)
                {
                    oldEntity.WebSiteInfos.Add(oldWsInfo);
                }
            }
        }
Beispiel #4
0
 public BaseModel()
 {
     CreationDate     = DateTime.Now;
     ModificationDate = DateTime.Now;
     CreateBy         = ModifyBy = GlobalContext.GetCurrentUserId();
     Status           = EntityStatus.Active;
     VersionNumber    = 1;
     Metadata         = "";
     Name             = "";
 }
Beispiel #5
0
 private void CopyNewData(NccMenu oldEntity, NccMenu entity)
 {
     oldEntity.ModificationDate = entity.ModificationDate;
     oldEntity.ModifyBy         = GlobalContext.GetCurrentUserId();
     oldEntity.Name             = entity.Name;
     oldEntity.Status           = entity.Status;
     oldEntity.MenuIconCls      = entity.MenuIconCls;
     oldEntity.Position         = entity.Position;
     oldEntity.Status           = entity.Status;
     oldEntity.MenuItems        = entity.MenuItems;
     oldEntity.Metadata         = entity.Metadata;
 }
        public override void CopyNewData(NccPage copyFrom, NccPage copyTo)
        {
            copyTo.ModificationDate = copyFrom.ModificationDate;
            copyTo.ModifyBy         = GlobalContext.GetCurrentUserId();
            copyTo.Name             = copyFrom.Name;
            copyTo.Status           = copyFrom.Status;
            copyTo.ModificationDate = copyFrom.ModificationDate;
            copyTo.ModifyBy         = copyFrom.ModifyBy;
            copyTo.PageStatus       = copyFrom.PageStatus;
            copyTo.PageType         = copyFrom.PageType;
            copyTo.Parent           = copyFrom.Parent;
            copyTo.PublishDate      = copyFrom.PublishDate;
            copyTo.Layout           = copyFrom.Layout;
            copyTo.VersionNumber    = copyFrom.VersionNumber;
            copyTo.Metadata         = copyFrom.Metadata;

            var currentDateTime = DateTime.Now;

            foreach (var item in copyFrom.PageDetails)
            {
                var            isNew = false;
                NccPageDetails temp  = copyTo.PageDetails.Where(x => x.Language == item.Language).FirstOrDefault();
                if (temp == null)
                {
                    isNew             = true;
                    temp              = new NccPageDetails();
                    temp.CreationDate = currentDateTime;
                    temp.CreateBy     = GlobalContext.GetCurrentUserId();
                    temp.Language     = item.Language;
                }
                temp.ModificationDate = currentDateTime;
                temp.ModifyBy         = GlobalContext.GetCurrentUserId();

                temp.Title           = item.Title;
                temp.Slug            = item.Slug;
                temp.Content         = item.Content;
                temp.MetaDescription = item.MetaDescription;
                temp.MetaKeyword     = item.MetaKeyword;
                temp.Name            = string.IsNullOrEmpty(item.Name) ? item.Slug : item.Name;
                temp.Metadata        = item.Metadata;

                if (isNew)
                {
                    copyTo.PageDetails.Add(temp);
                }
            }

            //copyTo.PageDetails = copyFrom.PageDetails;
            //return copyTo;
        }
Beispiel #7
0
        public NccPostDetails Update(NccPostDetails entity)
        {
            var oldEntity = _entityRepository.Get(entity.Id);

            if (oldEntity != null)
            {
                oldEntity.ModificationDate = DateTime.Now;
                oldEntity.ModifyBy         = GlobalContext.GetCurrentUserId();
                using (var txn = _entityRepository.BeginTransaction())
                {
                    CopyNewData(entity, oldEntity);
                    _entityRepository.Edit(oldEntity);
                    _entityRepository.SaveChange();
                    txn.Commit();
                }
            }

            return(entity);
        }
Beispiel #8
0
        public NccPageDetails CopyNewData(NccPageDetails copyFrom, NccPageDetails copyTo)
        {
            copyTo.ModificationDate = copyFrom.ModificationDate;
            copyTo.ModifyBy         = GlobalContext.GetCurrentUserId();
            copyTo.Name             = copyFrom.Name;
            copyTo.Status           = copyFrom.Status;
            copyTo.ModificationDate = copyFrom.ModificationDate;
            copyTo.ModifyBy         = copyFrom.ModifyBy;
            copyTo.VersionNumber    = copyFrom.VersionNumber;
            copyTo.Content          = copyFrom.Content;
            copyTo.Language         = copyFrom.Language;
            copyTo.MetaDescription  = copyFrom.MetaDescription;
            copyTo.MetaKeyword      = copyFrom.MetaKeyword;
            copyTo.Page             = copyFrom.Page;
            copyTo.Slug             = copyFrom.Slug;
            copyTo.Title            = copyFrom.Title;
            copyTo.Metadata         = copyFrom.Metadata;

            return(copyTo);
        }
        public NccComment Update(NccComment entity)
        {
            var oldEntity = _entityRepository.Get(entity.Id, false, new List <string> {
                "Post", "Author"
            });

            if (oldEntity != null)
            {
                oldEntity.ModificationDate = DateTime.Now;
                oldEntity.ModifyBy         = GlobalContext.GetCurrentUserId();
                using (var txn = _entityRepository.BeginTransaction())
                {
                    CopyNewData(entity, oldEntity);
                    _entityRepository.Edit(oldEntity);
                    _entityRepository.SaveChange();
                    txn.Commit();
                }
            }

            return(entity);
        }
Beispiel #10
0
        public NccPost Update(NccPost entity)
        {
            RemoveChieldsForUpdate(entity);
            var oldEntity = _entityRepository.Get(entity.Id, false, new List <string> {
                "Parent", "PostDetails", "Categories", "Tags"
            });

            if (oldEntity != null)
            {
                oldEntity.ModificationDate = DateTime.Now;
                oldEntity.ModifyBy         = GlobalContext.GetCurrentUserId();
                using (var txn = _entityRepository.BeginTransaction())
                {
                    CopyNewData(entity, oldEntity);
                    _entityRepository.Edit(oldEntity);
                    _entityRepository.SaveChange();
                    txn.Commit();
                }
            }

            return(entity);
        }
Beispiel #11
0
        public NeNews Update(NeNews entity)
        {
            RemoveCategories(entity);
            var oldEntity = _entityRepository.Get(entity.Id, false, new List <string>()
            {
                "CategoryList", "Details"
            });

            if (oldEntity != null)
            {
                oldEntity.ModifyBy = GlobalContext.GetCurrentUserId();
                using (var txn = _entityRepository.BeginTransaction())
                {
                    CopyNewData(oldEntity, entity);
                    _entityRepository.Edit(oldEntity);
                    _entityRepository.SaveChange();
                    txn.Commit();
                }
            }

            return(entity);
        }
Beispiel #12
0
        public ActionResult CreateEdit(long Id = 0)
        {
            NccPost post = new NccPost();

            post.PublishDate = DateTime.Now;
            post.PostStatus  = NccPost.NccPostStatus.Draft;

            NccPostDetails nccPostDetails = new NccPostDetails();

            nccPostDetails.Language = GlobalContext.WebSite.Language;
            post.PostDetails.Add(nccPostDetails);

            if (Id > 0)
            {
                var temp = _nccPostService.Get(Id);
                if (temp.CreateBy == GlobalContext.GetCurrentUserId())
                {
                    post = temp;
                }
            }

            if (GlobalContext.WebSite.IsMultiLangual)
            {
                foreach (var item in SupportedCultures.Cultures)
                {
                    var count = post.PostDetails.Where(x => x.Language == item.TwoLetterISOLanguageName).Count();
                    if (count <= 0)
                    {
                        NccPostDetails _nccPostDetails = new NccPostDetails();
                        _nccPostDetails.Language = item.TwoLetterISOLanguageName;
                        post.PostDetails.Add(_nccPostDetails);
                    }
                }
            }

            SetPostViewData(post);
            return(View(post));
        }
        public NccComment CopyNewData(NccComment copyFrom, NccComment copyTo)
        {
            copyTo.ModificationDate = copyFrom.ModificationDate;
            copyTo.ModifyBy         = GlobalContext.GetCurrentUserId();
            copyTo.VersionNumber    = copyFrom.VersionNumber;
            copyTo.Status           = copyFrom.Status;
            copyTo.CreateBy         = copyFrom.CreateBy;
            copyTo.CreationDate     = copyFrom.CreationDate;
            copyTo.ModificationDate = copyFrom.ModificationDate;
            copyTo.Name             = copyFrom.Name;
            copyTo.Metadata         = copyFrom.Metadata;

            copyTo.Title         = copyFrom.Title;
            copyTo.Content       = copyFrom.Content;
            copyTo.Email         = copyFrom.Email;
            copyTo.WebSite       = copyFrom.WebSite;
            copyTo.CommentStatus = copyFrom.CommentStatus;
            copyTo.Post          = copyFrom.Post;
            copyTo.Author        = copyFrom.Author;
            copyTo.AuthorName    = copyFrom.AuthorName;

            return(copyTo);
        }
Beispiel #14
0
        private void CopyNewData(NccCategory copyFrom, NccCategory copyTo)
        {
            copyTo.ModificationDate = copyFrom.ModificationDate;
            copyTo.ModifyBy         = copyFrom.ModifyBy;
            copyTo.Name             = copyFrom.Name;
            copyTo.Status           = copyFrom.Status;
            copyTo.CategoryImage    = copyFrom.CategoryImage;
            copyTo.Parent           = copyFrom.Parent;
            copyTo.VersionNumber    = copyFrom.VersionNumber;
            copyTo.Metadata         = copyFrom.Metadata;

            var creationDate = DateTime.Now;

            copyTo.ModificationDate = creationDate;

            foreach (var item in copyFrom.CategoryDetails)
            {
                var tmpCategoryDetails = copyTo.CategoryDetails.Where(x => x.Language == item.Language).FirstOrDefault();
                if (tmpCategoryDetails == null)
                {
                    tmpCategoryDetails = new NccCategoryDetails();
                    copyTo.CategoryDetails.Add(tmpCategoryDetails);
                }

                tmpCategoryDetails.Language         = item.Language;
                tmpCategoryDetails.MetaDescription  = item.MetaDescription;
                tmpCategoryDetails.MetaKeyword      = item.MetaKeyword;
                tmpCategoryDetails.ModificationDate = creationDate;
                tmpCategoryDetails.ModifyBy         = GlobalContext.GetCurrentUserId();
                tmpCategoryDetails.Name             = item.Name;
                tmpCategoryDetails.Slug             = item.Slug;
                tmpCategoryDetails.Status           = item.Status;
                tmpCategoryDetails.Title            = item.Title;
                tmpCategoryDetails.VersionNumber    = item.VersionNumber;
                tmpCategoryDetails.Metadata         = item.Metadata;
            }
        }
Beispiel #15
0
        public virtual EntityT Update(EntityT entity)
        {
            var model = (IBaseModel <long>)entity;

            if (DoBeforeUpdate(entity))
            {
                var oldEntity = _repository.Get(model.Id, false, _defaultIncludeRelations);
                if (oldEntity != null)
                {
                    var oldModel = (IBaseModel <long>)oldEntity;
                    oldModel.ModifyBy = GlobalContext.GetCurrentUserId();

                    using (var txn = _repository.BeginTransaction())
                    {
                        try
                        {
                            CopyNewData(entity, oldEntity);
                            _repository.Edit(oldEntity);
                            _repository.SaveChange();
                            txn.Commit();
                        }
                        catch (Exception ex)
                        {
                            txn.Rollback();
                            throw ex;
                        }
                    }
                    DoAfterUpdate(entity);
                }
                else
                {
                    throw new InvalidEntityDataException("Null Entity.");
                }
            }

            return(entity);
        }
        public JsonResult ManageAjax(int draw, int start, int length)
        {
            var CommentStatus = Enum.GetValues(typeof(NccComment.NccCommentStatus)).Cast <NccComment.NccCommentStatus>().Select(v => new SelectListItem
            {
                Text  = v.ToString(),
                Value = ((int)v).ToString()
            }).ToList();

            var  data            = new List <object>();
            long recordsTotal    = 0;
            long recordsFiltered = 0;

            try
            {
                string searchText = HttpContext.Request.Form["search[value]"];
                searchText = searchText.Trim();
                #region OrderBy and Direction
                string orderBy  = HttpContext.Request.Form["order[0][column]"];
                string orderDir = HttpContext.Request.Form["order[0][dir]"];
                if (!string.IsNullOrEmpty(orderDir))
                {
                    orderDir = orderDir.ToUpper();
                }
                if (!string.IsNullOrEmpty(orderBy))
                {
                    switch (orderBy)
                    {
                    case "0":
                        orderBy = "name";
                        break;

                    default:
                        orderBy = "";
                        break;
                    }
                }
                #endregion

                recordsTotal    = _nccCommentsService.Count(false, GlobalContext.GetCurrentUserId(), searchText);
                recordsFiltered = recordsTotal;
                List <NccComment> itemList       = _nccCommentsService.Load(start, length, false, GlobalContext.GetCurrentUserId(), searchText, orderBy, orderDir);
                string            controllerName = "Comments";
                foreach (var item in itemList)
                {
                    var str = new List <string>();
                    str.Add(item.Post.Name);
                    str.Add(item.Content);
                    str.Add(item.AuthorName);

                    if (item.CreateBy == item.ModifyBy)
                    {
                        str.Add(_nccUserService.Get(item.CreateBy)?.UserName);
                    }
                    else
                    {
                        str.Add("<b>Cr:</b> " + _nccUserService.Get(item.CreateBy)?.UserName + "<br /><b>Mo:</b> " + _nccUserService.Get(item.ModifyBy)?.UserName);
                    }

                    if (item.CreationDate == item.ModificationDate)
                    {
                        str.Add(item.CreationDate.ToString("yyyy-MM-dd hh:mm tt"));
                    }
                    else
                    {
                        str.Add("<b>Cr:</b> " + item.CreationDate.ToString("yyyy-MM-dd hh:mm tt") + "<br /><b>Mo:</b> " + item.ModificationDate.ToString("yyyy-MM-dd hh:mm tt"));
                    }

                    str.Add(item.CommentStatus.ToString());

                    string actionLink = "";
                    foreach (var commentsItem in CommentStatus)
                    {
                        if (item.CommentStatus.ToString() != commentsItem.Text)
                        {
                            actionLink += " <a href='" + Url.Action("StatusUpdate", controllerName, new { id = item.Id.ToString(), commentStatus = commentsItem.Value }) + "' class='btn btn-xs btn-info btn-outline'>" + commentsItem.Text + "</a> ";
                        }
                    }

                    actionLink += " <a href='" + Url.Action("Delete", controllerName, new { id = item.Id.ToString() }) + "' class='btn btn-xs btn-danger'>Delete</a> ";
                    str.Add(actionLink);
                    data.Add(str);
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
            }

            return(Json(new
            {
                draw = draw,
                recordsTotal = recordsTotal,
                recordsFiltered = recordsFiltered,
                start = start,
                length = length,
                data = data
            }));
        }
Beispiel #17
0
        public JsonResult ManageAjax(int draw, int start, int length)
        {
            var  data            = new List <object>();
            long recordsTotal    = 0;
            long recordsFiltered = 0;

            try
            {
                string searchText = HttpContext.Request.Form["search[value]"];
                searchText = searchText.Trim();
                #region OrderBy and Direction
                string orderBy  = HttpContext.Request.Form["order[0][column]"];
                string orderDir = HttpContext.Request.Form["order[0][dir]"];
                if (!string.IsNullOrEmpty(orderDir))
                {
                    orderDir = orderDir.ToUpper();
                }
                if (!string.IsNullOrEmpty(orderBy))
                {
                    switch (orderBy)
                    {
                    case "0":
                        orderBy = "name";
                        break;

                    default:
                        orderBy = "";
                        break;
                    }
                }
                #endregion

                recordsTotal    = _nccPostService.Count(false, false, false, true, null, null, 0, 0, GlobalContext.GetCurrentUserId(), searchText);
                recordsFiltered = recordsTotal;
                List <NccPost> itemList       = _nccPostService.Load(start, length, false, false, false, true, null, null, 0, 0, GlobalContext.GetCurrentUserId(), searchText, orderBy, orderDir);
                string         controllerName = "PostAuthor";
                foreach (var item in itemList)
                {
                    var str  = new List <string>();
                    var temp = "";
                    #region Title
                    temp = "";
                    if (GlobalContext.WebSite.IsMultiLangual)
                    {
                        foreach (var details in item.PostDetails)
                        {
                            if (!string.IsNullOrEmpty(temp))
                            {
                                temp += "<br />";
                            }
                            temp += "<b>" + details.Language + ":</b> " + details.Title;
                        }
                    }
                    else
                    {
                        temp = item.Name;
                    }
                    str.Add(temp);
                    #endregion
                    if (item.Parent != null)
                    {
                        str.Add(item.Parent.PostDetails.FirstOrDefault().Title);
                    }
                    else
                    {
                        str.Add("-");
                    }

                    //if (item.CreateBy == item.ModifyBy)
                    //{
                    //    str.Add(_nccUserService.Get(item.CreateBy)?.UserName);
                    //}
                    //else
                    //{
                    //    str.Add("<b>Cr:</b> " + _nccUserService.Get(item.CreateBy)?.UserName + "<br /><b>Mo:</b> " + _nccUserService.Get(item.ModifyBy)?.UserName);
                    //}
                    #region Categories
                    temp = "";
                    foreach (var cat in item.Categories)
                    {
                        if (temp != "")
                        {
                            temp += ", ";
                        }
                        temp += cat.Category.Name;
                    }
                    str.Add(temp);
                    #endregion
                    #region Tags
                    temp = "";
                    foreach (var tag in item.Tags)
                    {
                        if (temp != "")
                        {
                            temp += ", ";
                        }
                        temp += tag.Tag.Name;
                    }
                    str.Add(temp);
                    #endregion

                    str.Add(item.PostStatus == NccPost.NccPostStatus.Published ? NccPost.NccPostStatus.Published.ToString() + ": " + item.PublishDate.ToString("yyyy-MM-dd hh:mm tt") : "Update: " + item.ModificationDate.ToString("yyyy-MM-dd hh:mm tt"));

                    str.Add(item.Layout);
                    str.Add(item.PostType.ToString());

                    string actionLink = " <a href='" + Url.Action("CreateEdit", controllerName, new { id = item.Id.ToString() }) + "' class='btn btn-xs btn-primary btn-outline'>Edit</a> ";
                    //if (item.Status == EntityStatus.Active)
                    //    actionLink += " <a href='" + Url.Action("StatusUpdate", controllerName, new { id = item.Id.ToString() }) + "' class='btn btn-xs btn-danger btn-outline'>Inactive</a> ";
                    //else
                    //    actionLink += " <a href='" + Url.Action("StatusUpdate", controllerName, new { id = item.Id.ToString() }) + "' class='btn btn-xs btn-success btn-outline'>Active</a> ";
                    //actionLink += " <a href='" + Url.Action("Delete", controllerName, new { id = item.Id.ToString() }) + "' class='btn btn-xs btn-danger'>Delete</a> ";
                    if (GlobalContext.WebSite.IsMultiLangual == true)
                    {
                        actionLink += "";
                        foreach (var Details in item.PostDetails)
                        {
                            actionLink += " <a href='/" + Details.Language + "/Post/" + Details.Slug + "' target='_blank' class='btn btn-outline btn-info btn-xs'><i class='fa fa-eye'></i> " + Details.Language + "</a> ";
                        }
                    }
                    else
                    {
                        actionLink += " <a href='/Post/" + item.PostDetails.Where(x => x.Language == GlobalContext.WebSite.Language).FirstOrDefault().Slug + "'  target='_blank' class='btn btn-outline btn-info btn-xs'><i class='fa fa-eye'></i> " + item.PostDetails.Where(x => x.Language == GlobalContext.WebSite.Language).FirstOrDefault().Language + "</a> ";
                    }
                    str.Add(actionLink);
                    data.Add(str);
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
            }

            return(Json(new
            {
                draw = draw,
                recordsTotal = recordsTotal,
                recordsFiltered = recordsFiltered,
                start = start,
                length = length,
                data = data
            }));
        }