private ModerationQueueModel PrepareListModel(ModerationQueue queue)
        {
            var model = queue.ToModel();

            var editLink = new ModelActionLink
            {
                Alt = "Edit",
                Icon = Url.Content("~/Areas/Admin/Content/images/icon-edit.png"),
            };

            switch (model.RequestType)
            {
                case ModerationRequestType.ProjectApproval:
                    editLink.Target = Url.Action("projectapproval", new { id = queue.Id });
                    var approvalRequest = _moderationQueueService.GetProjectApprovalByModerationQueueId(queue.Id);
                    if (approvalRequest != null && approvalRequest.Project != null)
                    {
                        model.RelatedDate = approvalRequest.Project.StartDate != null ? approvalRequest.Project.StartDate.Value.ToString("dd/MM/yyyy") : "";

                        var projectLocation = approvalRequest.Project.Locations.FirstOrDefault(x => x.Primary);
                        if (projectLocation != null && projectLocation.Location != null)
                            model.RelatedLocation = projectLocation.Location.Name;

                        model.RelatedProject = approvalRequest.Project.Name;
                    }
                    break;
                case ModerationRequestType.ProjectChange:
                    editLink.Target = Url.Action("change", "project", new { id = queue.Id });
                    var changeRequest = _moderationQueueService.GetProjectChangeRequestByModerationQueueId(queue.Id);
                    if (changeRequest != null && changeRequest.ParentProject != null)
                    {
                        model.RelatedDate = changeRequest.ParentProject.StartDate != null ? changeRequest.ParentProject.StartDate.Value.ToString("dd/MM/yyyy") : "";

                        var projectLocation = changeRequest.ParentProject.Locations.FirstOrDefault(x => x.Primary);
                        if (projectLocation != null && projectLocation.Location != null)
                            model.RelatedLocation = projectLocation.Location.Name;

                        model.RelatedProject = changeRequest.ParentProject.Name;
                    }
                    break;
                case ModerationRequestType.ProjectComment:
                    editLink.Target = Url.Action("comment", "comment", new {id = queue.Id});
                    var commentRequest = _moderationQueueService.GetProjectCommentModerationByModerationQueueId(queue.Id);
                    if (commentRequest != null && commentRequest.Comment != null && commentRequest.Comment.Project != null)
                    {
                        model.RelatedDate = commentRequest.Comment.Project.StartDate != null ? commentRequest.Comment.Project.StartDate.Value.ToString("dd/MM/yyyy") : "";

                        var projectLocation = commentRequest.Comment.Project.Locations.FirstOrDefault(x => x.Primary);
                        if (projectLocation != null && projectLocation.Location != null)
                            model.RelatedLocation = projectLocation.Location.Name;

                        model.RelatedProject = commentRequest.Comment.Project.Name;
                    }
                    break;
                case ModerationRequestType.ProjectModeration:
                    editLink.Target = Url.Action("moderation", "project", new { id = queue.Id });
                    var projectFlagRequest = _moderationQueueService.GetProjectModerationByModerationQueueId(queue.Id);
                    if (projectFlagRequest != null && projectFlagRequest.Project != null)
                    {
                        model.RelatedDate = projectFlagRequest.Project.StartDate != null ? projectFlagRequest.Project.StartDate.Value.ToString("dd/MM/yyyy") : "";

                        var projectLocation = projectFlagRequest.Project.Locations.FirstOrDefault(x => x.Primary);
                        if (projectLocation != null && projectLocation.Location != null)
                            model.RelatedLocation = projectLocation.Location.Name;

                        model.RelatedProject = projectFlagRequest.Project.Name;
                    }
                    break;
                case ModerationRequestType.ProjectWithdrawal:
                    editLink.Target = Url.Action("withdrawal", "project", new { id = queue.Id });
                    var withdrawalRequest = _moderationQueueService.GetProjectWithdrawalByModerationQueueId(queue.Id);
                    if (withdrawalRequest != null && withdrawalRequest.Project != null)
                    {
                        model.RelatedDate = withdrawalRequest.Project.StartDate != null ? withdrawalRequest.Project.StartDate.Value.ToString("dd/MM/yyyy") : "";

                        var projectLocation = withdrawalRequest.Project.Locations.FirstOrDefault(x => x.Primary);
                        if (projectLocation != null && projectLocation.Location != null)
                            model.RelatedLocation = projectLocation.Location.Name;

                        model.RelatedProject = withdrawalRequest.Project.Name;
                    }
                    break;
            }

            model.Actions.Add(editLink);

            if (_permissionService.Authorize(PermissionProvider.DeleteModerationRequests))
                model.Actions.Add(new DeleteActionLink(queue.Id, Search, Page));

            return model;
        }
        /// <summary>
        /// Updates the moderation gueue
        /// </summary>        
        /// <param name="queue"> ModerationQueue</param>
        public void UpdateModerationQueue(ModerationQueue queue)
        {
            if (queue == null)
                throw new ArgumentNullException("queue");

            queue.ModeratedBy = _workContext.CurrentUser.Id;
            queue.ModeratedDate = DateTime.Now;

            _moderationQueueRepository.Update(queue);
        }