public IActionResult Create(Exigeance item) { _context.Exigeance.Add(item); _context.SaveChanges(); return(CreatedAtRoute("GetExigeance", new { id = item.ExigeanceID }, item)); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Exigeance = await _context.Exigeance.FindAsync(id); if (Exigeance != null) { _context.Exigeance.Remove(Exigeance); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index", new{ id = Exigeance.ProjetID })); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Exigeance = await _context.Exigeance .Include(e => e.Projet) .Include(e => e.TypeExigeance).FirstOrDefaultAsync(m => m.ExigeanceID == id); if (Exigeance == null) { return(NotFound()); } return(Page()); }
public IActionResult Update(long id, Exigeance item) { var exigeance = _context.Exigeance.Find(id); if (exigeance == null) { return(NotFound()); } exigeance.ProjetID = exigeance.ProjetID; exigeance.TypeExigeanceID = exigeance.TypeExigeanceID; exigeance.description = exigeance.description; exigeance.nom = exigeance.nom; _context.Exigeance.Update(exigeance); _context.SaveChanges(); return(NoContent()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Exigeance = await _context.Exigeance .Include(e => e.Projet) .Include(e => e.TypeExigeance).FirstOrDefaultAsync(m => m.ExigeanceID == id); if (Exigeance == null) { return(NotFound()); } ViewData["ProjetID"] = new SelectList(_context.Projets, "ProjetID", "ProjetID"); ViewData["TypeExigeanceID"] = new SelectList(_context.TypeExigeance, "TypeExigeanceID", "nom"); return(Page()); }