public async Task <IActionResult> Edit(int id, [Bind("ID,DateDepense,NomClient,VilleClient,MotifDepense,NombreKms,LocationVoiture,TaxiBus,AvionTrain,ParkingPeage,Restaurant,Hotel,Divers,TauxDevise,Commentaire,CommentaireRefus,TypeDepenseId")] Depense depense)
        {
            if (id != depense.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(depense);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DepenseExists(depense.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TypeDepenseId"] = new SelectList(_context.TypeDepense, "ID", "ID", depense.TypeDepenseId);
            return(View(depense));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,DateDebut,DateFin,PeriodeDebut,PeriodeFin,Commentaire,DateDemande,NomResponsable,PrenomResponsable,Decision,TypeCongeId,CollaborateurId")] Conge conge)
        {
            if (id != conge.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(conge);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CongeExists(conge.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CollaborateurId"] = new SelectList(_context.Collaborateur, "ID", "ID", conge.CollaborateurId);
            ViewData["TypeCongeId"]     = new SelectList(_context.TypeConge, "ID", "ID", conge.TypeCongeId);
            return(View(conge));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Label")] TypeConge typeConge)
        {
            if (id != typeConge.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(typeConge);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TypeCongeExists(typeConge.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(typeConge));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Nom,Prenom,Genre,Nationalite,DateNaissance,DateEmbauche,Addresse,Ville,CodePostal,NumeroFixe,NumeroPortable,Email,NoSecu,ServiceId")] Collaborateur collaborateur)
        {
            if (id != collaborateur.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(collaborateur);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CollaborateurExists(collaborateur.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ServiceId"] = new SelectList(_context.Service, "ID", "ID", collaborateur.ServiceId);
            return(View(collaborateur));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,DateDebut,DateFin,TypeContratId,CollaborateurId")] Contrat contrat)
        {
            if (id != contrat.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(contrat);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ContratExists(contrat.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CollaborateurId"] = new SelectList(_context.Collaborateur, "ID", "ID", contrat.CollaborateurId);
            ViewData["TypeContratId"]   = new SelectList(_context.TypeContrat, "ID", "ID", contrat.TypeContratId);
            return(View(contrat));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,nom")] Projet projet)
        {
            if (id != projet.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(projet);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProjetExists(projet.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(projet));
        }