public async Task <IActionResult> Create([Bind("ID,Label")] TypeConge typeConge) { if (ModelState.IsValid) { _context.Add(typeConge); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(typeConge)); }
public async Task <IActionResult> Create([Bind("ID,nom")] Projet projet) { if (ModelState.IsValid) { _context.Add(projet); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(projet)); }
public async Task <IActionResult> Create([Bind("ID,DateDepense,NomClient,VilleClient,MotifDepense,NombreKms,LocationVoiture,TaxiBus,AvionTrain,ParkingPeage,Restaurant,Hotel,Divers,TauxDevise,Commentaire,CommentaireRefus,TypeDepenseId")] Depense depense) { if (ModelState.IsValid) { _context.Add(depense); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TypeDepenseId"] = new SelectList(_context.TypeDepense, "ID", "ID", depense.TypeDepenseId); return(View(depense)); }
public async Task <IActionResult> Create([Bind("ID,DateDebut,DateFin,PeriodeDebut,PeriodeFin,Commentaire,DateDemande,NomResponsable,PrenomResponsable,Decision,TypeCongeId,CollaborateurId")] Conge conge) { if (ModelState.IsValid) { _context.Add(conge); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(conge)); }
public async Task <IActionResult> Create([Bind("ID,Nom,Prenom,Genre,Nationalite,DateNaissance,DateEmbauche,Addresse,Ville,CodePostal,NumeroFixe,NumeroPortable,Email,NoSecu,ServiceId")] Collaborateur collaborateur) { if (ModelState.IsValid) { _context.Add(collaborateur); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ServiceId"] = new SelectList(_context.Service, "ID", "ID", collaborateur.ServiceId); return(View(collaborateur)); }
public async Task <IActionResult> Create([Bind("ID,DateDebut,DateFin,TypeContratId,CollaborateurId")] Contrat contrat) { if (ModelState.IsValid) { _context.Add(contrat); await _context.SaveChangesAsync(); 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)); }
public async Task Add(Employee employee) { await _ctx.Employees.AddAsync(employee); await _ctx.SaveChangesAsync(); }