示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#5
0
        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));
        }
示例#6
0
        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));
        }
示例#7
0
        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));
        }
示例#9
0
        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));
        }
示例#10
0
        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));
        }
示例#11
0
        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));
        }
示例#12
0
        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));
        }
示例#13
0
        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));
        }
示例#14
0
        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));
        }
示例#15
0
        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));
        }
示例#17
0
        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));
        }
示例#18
0
        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));
        }
示例#19
0
        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));
        }
示例#20
0
        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));
        }
示例#21
0
        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));
        }
示例#22
0
        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));
        }
示例#23
0
        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));
        }
示例#24
0
        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));
        }
示例#25
0
        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));
        }
示例#26
0
        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));
        }
示例#27
0
        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));
        }
示例#28
0
        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));
        }
示例#29
0
        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));
        }
示例#30
0
        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));
        }