Ejemplo n.º 1
0
 public bool DeletePresentation(int presentationId)
 {
     try
     {
         _repository.DeletePresentation(presentationId);
     }
     catch
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 2
0
 public bool RejectArticle(int articleId, int editorId)
 {
     try
     {
         var article = _repository.GetArticleById(articleId);
         article.Status         = "rejected";
         article.AcceptanceDate = null;
         var tempPresentation = article.PresentationId;
         article.PresentationId = null;
         _repository.EditArticle(article);
         if (tempPresentation.HasValue)
         {
             _presentationRepository.DeletePresentation(tempPresentation.Value);
         }
         var authors = _repository.GetAuthorsFromArticleId(articleId);
         foreach (var author in authors)
         {
             var message = new MessageDTO()
             {
                 SenderId   = editorId,
                 ReceiverId = author.AccountId,
                 Date       = DateTime.Now,
                 Content    = $"Your article {article.Topic} has been rejected"
             };
             if (message.SenderId != message.ReceiverId)
             {
                 _messageRepository.AddMessage(message);
             }
         }
     }
     catch
     {
         return(false);
     }
     return(true);
 }