Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Recommandations,TypeO,DateC,Id")] Ordonnance ordonnance)
        {
            if (ModelState.IsValid)
            {
                CliniqueDbContext context = _contextFactory.CreateDbContext();
                context.Add(ordonnance);
                await context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ordonnance));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("IdDocteur,IdDossierpatient,DateC,Diagnostic,IdOrdonnance,Id")] Consultation consultation)
        {
            if (ModelState.IsValid)
            {
                CliniqueDbContext context = _contextFactory.CreateDbContext();
                context.Add(consultation);
                await context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(consultation));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("Nom,Description,Id")] Categorie categorie)
        {
            if (ModelState.IsValid)
            {
                CliniqueDbContext context = _contextFactory.CreateDbContext();
                context.Add(categorie);
                await context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(categorie));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("Matricule,NomM,PrenomM,IdSpecialite,Ville,Adresse,Niveau,NbrPatients,Id")] Docteur docteur)
        {
            if (ModelState.IsValid)
            {
                CliniqueDbContext context = _contextFactory.CreateDbContext();
                context.Add(docteur);
                await context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdSpecialite"] = new SelectList(_contextFactory.CreateDbContext().Specialites, "Id", "Titre", docteur.IdSpecialite);
            return(View(docteur));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("NomMed,Prix,IdCategorie,Id")] Medicament medicament)
        {
            if (ModelState.IsValid)
            {
                CliniqueDbContext context = _contextFactory.CreateDbContext();
                context.Add(medicament);
                await context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCategorie"] = new SelectList(_contextFactory.CreateDbContext().Categories, "Id", "Nom", medicament.IdCategorie);
            return(View(medicament));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> Create([Bind("Rang,NomChirurgie,IdOrdonnance,Id")] Ordonnancechirurgie ordonnancechirurgie)
        {
            if (ModelState.IsValid)
            {
                CliniqueDbContext context = _contextFactory.CreateDbContext();
                context.Add(ordonnancechirurgie);
                await context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdOrdonnance"] = new SelectList(_contextFactory.CreateDbContext().Ordonnances, "Id", "Id", ordonnancechirurgie.IdOrdonnance);
            return(View(ordonnancechirurgie));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> Create([Bind("NomP,PrenomP,Genre,NumAS,DateNaiss,DateC,IdDocteur,Id")] Dossierpatient dossierpatient)
        {
            if (ModelState.IsValid)
            {
                CliniqueDbContext context = _contextFactory.CreateDbContext();
                context.Add(dossierpatient);
                await context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Genre"]     = new SelectList(Enum.GetNames(typeof(Genre)));
            ViewData["IdDocteur"] = new SelectList(_contextFactory.CreateDbContext().Docteurs, "Id", "NomM", dossierpatient.IdDocteur);
            return(View(dossierpatient));
        }
Exemplo n.º 8
0
        public async Task <IActionResult> Create([Bind("NbBoites,IdOrdonnance,IdMedicament,Id")] Ordonnancemedicament ordonnancemedicament)
        {
            if (ModelState.IsValid)
            {
                CliniqueDbContext context = _contextFactory.CreateDbContext();
                context.Add(ordonnancemedicament);
                await context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdMedicament"] = new SelectList(_contextFactory.CreateDbContext().Medicaments, "Id", "NomMed", ordonnancemedicament.IdMedicament);
            ViewData["IdOrdonnance"] = new SelectList(_contextFactory.CreateDbContext().Ordonnances, "Id", "Id", ordonnancemedicament.IdOrdonnance);
            return(View(ordonnancemedicament));
        }
Exemplo n.º 9
0
        public async Task <IActionResult> Create([Bind("Subject,Description,Start,End,ThemeColor,IdDocteur,IdDossierpatient,Id")] RendezVous rendezVous)
        {
            if (ModelState.IsValid)
            {
                CliniqueDbContext context = _contextFactory.CreateDbContext();
                context.Add(rendezVous);
                await context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Couleurs"]  = Couleur.CreerSelectList();
            ViewData["IdDocteur"] = new SelectList(_contextFactory.CreateDbContext().Docteurs, "Id", "NomComplet", rendezVous.IdDocteur);
            ViewData["IdDossier"] = new SelectList(_contextFactory.CreateDbContext().Dossierpatients, "Id", "NomComplet", rendezVous.IdDossierpatient);
            return(View(rendezVous));
        }