public async Task <IActionResult> Create(CreateParentViewModel createParentViewModel) { if (ModelState.IsValid) { Personne personne = new Personne { Nom = createParentViewModel.Nom, Prenom = createParentViewModel.Prenom, Sexe = createParentViewModel.Sexe, DateNaissance = createParentViewModel.DateNaissance, NumSecu = createParentViewModel.NumSecu, Discriminator = "Parent" }; _context.Add(personne); await _context.SaveChangesAsync(); Parent parent = new Parent { ParentId = personne.PersonneId, Personne = personne, Telephone = createParentViewModel.Telephone }; _context.Add(parent); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(createParentViewModel)); }
public async Task <IActionResult> Create(CreateEmployeViewModel createEmployeViewModel) { if (ModelState.IsValid) { Personne personne = new Personne { Nom = createEmployeViewModel.Nom, Prenom = createEmployeViewModel.Prenom, Sexe = createEmployeViewModel.Sexe, DateNaissance = createEmployeViewModel.DateNaissance, NumSecu = createEmployeViewModel.NumSecu, Discriminator = "Employe" }; _context.Add(personne); await _context.SaveChangesAsync(); string telephone = phoneRegex.Replace(createEmployeViewModel.Telephone, "($1) $2-$3"); Employe employe = new Employe { EmployeId = personne.PersonneId, Personne = personne, Externe = createEmployeViewModel.Externe, Poste = createEmployeViewModel.Poste, Telephone = telephone }; _context.Add(employe); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(createEmployeViewModel)); }
public async Task <IActionResult> Create([Bind("InventaireId,Visible")] InventaireEnfant inventaireEnfant) { if (ModelState.IsValid) { _context.Add(inventaireEnfant); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(inventaireEnfant)); }
public async Task <IActionResult> Create([Bind("StatutFactureId,Libelle")] StatutFacture statutFacture) { if (ModelState.IsValid) { _context.Add(statutFacture); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(statutFacture)); }
public async Task <IActionResult> Create([Bind("CategorieId,Nom,Visible")] CategorieArticle categorieArticle) { if (ModelState.IsValid) { _context.Add(categorieArticle); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(categorieArticle)); }
public async Task <IActionResult> Create([Bind("Tvaid,Nom,Valeur,Visible")] Tva tva) { if (ModelState.IsValid) { _context.Add(tva); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tva)); }
public async Task <IActionResult> Create([Bind("PersonneId,Nom,Prenom,Sexe,DateNaissance,NumSecu,Visible,Discriminator")] Personne personne) { if (ModelState.IsValid) { _context.Add(personne); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(personne)); }
public async Task <IActionResult> Create([Bind("ContactId,Telephone")] ContactUrgence contactUrgence) { if (ModelState.IsValid) { _context.Add(contactUrgence); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(contactUrgence)); }
public async Task <IActionResult> Create([Bind("ActiviteId,Nom,Description,NbEnfantsMax,Lieu,Visible")] Activite activite) { if (ModelState.IsValid) { _context.Add(activite); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(activite)); }
public async Task <IActionResult> Create([Bind("SalleId,Libelle,Occupe,Visible")] Lieu lieu) { if (ModelState.IsValid) { _context.Add(lieu); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(lieu)); }
public async Task <IActionResult> Create([Bind("MaladieId,Nom,Descriptif,Visible")] Maladie maladie) { if (ModelState.IsValid) { _context.Add(maladie); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(maladie)); }
public async Task <IActionResult> Create([Bind("id,conducteur,ville_depart,ville_arrivee,date_heure,nb_passagers")] Trajet trajet) { if (ModelState.IsValid) { _context.Add(trajet); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(trajet)); }
public async Task <IActionResult> Create([Bind("TypeGroupeId,Libelle")] TypeGroupe typesGroupe) { if (ModelState.IsValid) { _context.Add(typesGroupe); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(typesGroupe)); }
public async Task <IActionResult> Create([Bind("AdresseId,Ligne1,Ligne2,Ligne3,Ville,CodePostal,Pays,Visible")] Adresse adresse) { if (ModelState.IsValid) { _context.Add(adresse); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(adresse)); }
public async Task <IActionResult> Create([Bind("FactureId,DateEmission,DatePaiement,MontantTtc,Visible,StatutFactureId")] Facture facture) { if (ModelState.IsValid) { _context.Add(facture); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StatutFactureId"] = new SelectList(_context.StatutsFacture, "StatutFactureId", "Libelle", facture.StatutFactureId); return(View(facture)); }
public async Task <IActionResult> Create([Bind("RapportId,Date,Present,Resume,Visible,DossierInscriptionId")] RapportJournalier rapportJournalier) { if (ModelState.IsValid) { _context.Add(rapportJournalier); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DossierInscriptionId"] = new SelectList(_context.DossiersInscription, "DossierId", "DossierId", rapportJournalier.DossierInscriptionId); return(View(rapportJournalier)); }
public async Task <IActionResult> Create([Bind("LigneId,TotalHt,TotalTtc,Quantite,FactureId,ObjetFacturableId,Visible")] LigneFacture ligneFacture) { if (ModelState.IsValid) { _context.Add(ligneFacture); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ObjetFacturableId"] = new SelectList(_context.ObjetsFacturables, "ObjetFacturableId", "ObjetFacturableId", ligneFacture.ObjetFacturableId); return(View(ligneFacture)); }
public async Task <IActionResult> Create([Bind("HoraireId,Date,HeureDebut,HeureFin,CalendrierId,Visible,EmployeId")] Horaire horaire) { if (ModelState.IsValid) { _context.Add(horaire); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CalendrierId"] = new SelectList(_context.Calendriers, "CalendrierId", "CalendrierId", horaire.CalendrierId); return(View(horaire)); }
public async Task <IActionResult> Create([Bind("FichePayeId,SalaireBrut,NbHeuresPrevu,NbHeuresReel,DossierEmployeId,Visible")] FichePaye fichePaye) { if (ModelState.IsValid) { _context.Add(fichePaye); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DossierEmployeId"] = new SelectList(_context.DossiersEmploye, "DossierId", "DossierId", fichePaye.DossierEmployeId); return(View(fichePaye)); }
public async Task <IActionResult> Create([Bind("DocumentId,Nom,Url,DossierId,Visible")] DocumentOfficiel documentOfficiel) { if (ModelState.IsValid) { _context.Add(documentOfficiel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DossierId"] = new SelectList(_context.DossiersInscription, "DossierId", "DossierId", documentOfficiel.DossierId); return(View(documentOfficiel)); }
public async Task <IActionResult> Create([Bind("DossierId,DateInscription,NbDemiJourneesInscrit,NbDemiJourneesAbsent,MedecinTraitant,EnfantId,Visible")] DossierInscription dossierInscription) { if (ModelState.IsValid) { _context.Add(dossierInscription); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EnfantId"] = new SelectList(_context.Enfants, "EnfantId", "EnfantId", dossierInscription.EnfantId); return(View(dossierInscription)); }
public async Task <IActionResult> Create([Bind("InventaireId,StockMax,StockActuel,EmployeId,Visible")] Inventaire inventaire) { if (ModelState.IsValid) { _context.Add(inventaire); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmployeId"] = new SelectList(_context.Employes, "EmployeId", "EmployeId", inventaire.EmployeId); return(View(inventaire)); }
public async Task <IActionResult> Create([Bind("FactureId,ParentId,Visible")] ParentFacture parentFacture) { if (ModelState.IsValid) { _context.Add(parentFacture); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["FactureId"] = new SelectList(_context.Factures, "FactureId", "FactureId", parentFacture.FactureId); ViewData["ParentId"] = new SelectList(_context.Parents, "ParentId", "ParentId", parentFacture.ParentId); return(View(parentFacture)); }
public async Task <IActionResult> Create([Bind("MaladieId,EnfantId,NomMedicament,Specification,Type,Quantite,Frequence,Visible")] Traitement traitement) { if (ModelState.IsValid) { _context.Add(traitement); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EnfantId"] = new SelectList(_context.Enfants, "EnfantId", "EnfantId", traitement.EnfantId); ViewData["MaladieId"] = new SelectList(_context.Maladies, "MaladieId", "MaladieId", traitement.MaladieId); return(View(traitement)); }
public async Task <IActionResult> Create([Bind("GroupeId,EmployeId")] EmployeGroupe employeGroupe) { if (ModelState.IsValid) { _context.Add(employeGroupe); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmployeId"] = new SelectList(_context.Employes, "EmployeId", "EmployeId", employeGroupe.EmployeId); ViewData["GroupeId"] = new SelectList(_context.Groupes, "GroupeId", "GroupeId", employeGroupe.GroupeId); return(View(employeGroupe)); }
public async Task <IActionResult> Create([Bind("AdresseId,PersonneId,Domicile,Facturation,Visible")] PersonneAdresse personneAdresse) { if (ModelState.IsValid) { _context.Add(personneAdresse); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AdresseId"] = new SelectList(_context.Adresses, "AdresseId", "AdresseId", personneAdresse.AdresseId); ViewData["PersonneId"] = new SelectList(_context.Personnes, "PersonneId", "PersonneId", personneAdresse.PersonneId); return(View(personneAdresse)); }
public async Task <IActionResult> Create([Bind("ObjetFacturableId,PrixHt,Nom,Tvaid,ActiviteId,Visible")] ObjetFacturable objetFacturable) { if (ModelState.IsValid) { _context.Add(objetFacturable); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ActiviteId"] = new SelectList(_context.Activites, "ActiviteId", "ActiviteId", objetFacturable.ActiviteId); ViewData["Tvaid"] = new SelectList(_context.Tvas, "Tvaid", "Tvaid", objetFacturable.Tvaid); return(View(objetFacturable)); }
public async Task <IActionResult> Create([Bind("DossierId,DateEntree,NbMoisAnciennete,TauxHoraireBrut,Visible,TypeContratId,EmployeId")] DossierEmploye dossierEmploye) { if (ModelState.IsValid) { _context.Add(dossierEmploye); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmployeId"] = new SelectList(_context.Employes, "EmployeId", "EmployeId", dossierEmploye.EmployeId); ViewData["TypeContratId"] = new SelectList(_context.TypesContrat, "TypeContratId", "TypeContratId", dossierEmploye.TypeContratId); return(View(dossierEmploye)); }
public async Task <IActionResult> Create([Bind("ParentId,EnfantId,LienParente,Visible")] Filiation filiation) { if (ModelState.IsValid) { _context.Add(filiation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EnfantId"] = new SelectList(_context.Enfants, "EnfantId", "EnfantId", filiation.EnfantId); ViewData["ParentId"] = new SelectList(_context.Parents, "ParentId", "ParentId", filiation.ParentId); return(View(filiation)); }
public async Task <IActionResult> Create([Bind("CongeId,Debut,Duree,TypeCongeId,Visible,DossierEmployeId")] Conge conge) { if (ModelState.IsValid) { _context.Add(conge); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DossierEmployeId"] = new SelectList(_context.DossiersEmploye, "DossierId", "DossierId", conge.DossierEmployeId); ViewData["TypeCongeId"] = new SelectList(_context.TypesConges, "TypeCongeId", "TypeCongeId", conge.TypeCongeId); return(View(conge)); }