Ejemplo n.º 1
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            AcceptedArticle = await _context.AcceptedArticle.FindAsync(id);

            if (AcceptedArticle != null)
            {
                _context.BibliographicReference.Add(new BibliographicReference
                {
                    Title       = AcceptedArticle.Title,
                    Author      = AcceptedArticle.Author,
                    Source      = AcceptedArticle.Source,
                    Year        = AcceptedArticle.Year,
                    DOI         = AcceptedArticle.DOI,
                    SEMethod    = AcceptedArticle.SEMethod,
                    Practice    = AcceptedArticle.Practice,
                    Method      = AcceptedArticle.Method,
                    Participant = AcceptedArticle.Participant,
                    Result      = AcceptedArticle.Result
                });
                _context.AcceptedArticle.Remove(AcceptedArticle);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            AcceptedArticle = await _context.AcceptedArticle.FirstOrDefaultAsync(m => m.ID == id);

            if (AcceptedArticle == null)
            {
                return(NotFound());
            }
            return(Page());
        }