Esempio n. 1
0
        public void UpdateArticle(ArticleGetViewModel articleView)
        {
            List <AuthorInArticle> authorInArticle  = _authorInArticleRepository.GetArticle(articleView.Article.Id);
            ArticleInJournal       articleInJournal = _articleInJournalRepository.GetJournal(articleView.Journal.Id).First();

            if (authorInArticle != null)
            {
                List <AuthorInArticle> updateArticle = CreateAuthorInArticle(articleView, authorInArticle.First().Id);
                _authorInArticleRepository.Update(updateArticle);
            }
            if (articleInJournal != null)
            {
                var article = new List <ArticleInJournal>();
                article.Add(articleInJournal);
                _articleInJournalRepository.Update(article);
            }
        }
Esempio n. 2
0
        public void Delete(JournalGetViewModel journalView)
        {
            List <ArticleInJournal> articleInJournal = _articleInjournalRepository.GetJournal(journalView.Juornal.Id).ToList();

            if (articleInJournal != null)
            {
                _articleInjournalRepository.Delete(articleInJournal);
            }
        }