Exemple #1
0
        public async Task <IActionResult> Edit(int id, [Bind("NomP,PrenomP,Genre,NumAS,DateNaiss,DateC,IdDocteur,Id")] Dossierpatient dossierpatient)
        {
            if (id != dossierpatient.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    CliniqueDbContext context = _contextFactory.CreateDbContext();
                    context.Update(dossierpatient);
                    await context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DossierpatientExists(dossierpatient.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
Exemple #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Subject,Description,Start,End,ThemeColor,IsFullDay,IdDocteur,IdDossierpatient,Id")] RendezVous rendezVous)
        {
            if (id != rendezVous.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    CliniqueDbContext context = _contextFactory.CreateDbContext();
                    context.Update(rendezVous);
                    await context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RendezVousExists(rendezVous.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Matricule,NomM,PrenomM,IdSpecialite,Ville,Adresse,Niveau,NbrPatients,Id")] Docteur docteur)
        {
            if (id != docteur.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    CliniqueDbContext context = _contextFactory.CreateDbContext();
                    context.Update(docteur);
                    await context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DocteurExists(docteur.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdSpecialite"] = new SelectList(_contextFactory.CreateDbContext().Specialites, "Id", "Titre", docteur.IdSpecialite);
            return(View(docteur));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Recommandations,TypeO,DateC,Id")] Ordonnance ordonnance)
        {
            if (id != ordonnance.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    CliniqueDbContext context = _contextFactory.CreateDbContext();
                    context.Update(ordonnance);
                    await context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrdonnanceExists(ordonnance.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(ordonnance));
        }
Exemple #5
0
        public async Task <IActionResult> Edit(int id, [Bind("IdDocteur,IdDossierpatient,DateC,Diagnostic,IdOrdonnance,Id")] Consultation consultation)
        {
            if (id != consultation.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    CliniqueDbContext context = _contextFactory.CreateDbContext();
                    context.Update(consultation);
                    await context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ConsultationExists(consultation.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(consultation));
        }
Exemple #6
0
        public async Task <IActionResult> Edit(int id, [Bind("NomMed,Prix,IdCategorie,Id")] Medicament medicament)
        {
            if (id != medicament.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    CliniqueDbContext context = _contextFactory.CreateDbContext();
                    context.Update(medicament);
                    await context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MedicamentExists(medicament.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCategorie"] = new SelectList(_contextFactory.CreateDbContext().Categories, "Id", "Id", medicament.IdCategorie);
            return(View(medicament));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Nom,Description,Id")] Categorie categorie)
        {
            if (id != categorie.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    CliniqueDbContext context = _contextFactory.CreateDbContext();
                    context.Update(categorie);
                    await context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CategorieExists(categorie.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(categorie));
        }
Exemple #8
0
        public async Task <IActionResult> Edit(int id, [Bind("Rang,NomChirurgie,IdOrdonnance,Id")] Ordonnancechirurgie ordonnancechirurgie)
        {
            if (id != ordonnancechirurgie.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    CliniqueDbContext context = _contextFactory.CreateDbContext();
                    context.Update(ordonnancechirurgie);
                    await context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrdonnancechirurgieExists(ordonnancechirurgie.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdOrdonnance"] = new SelectList(_contextFactory.CreateDbContext().Ordonnances, "Id", "Id", ordonnancechirurgie.IdOrdonnance);
            return(View(ordonnancechirurgie));
        }