public IActionResult Create(Exigeance item)
        {
            _context.Exigeance.Add(item);
            _context.SaveChanges();

            return(CreatedAtRoute("GetExigeance", new { id = item.ExigeanceID }, item));
        }
Exemplo n.º 2
0
        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 }));
        }
Exemplo n.º 3
0
        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());
        }
Exemplo n.º 5
0
        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());
        }