public void ModifierRendezVous() { ListeDg.IsReadOnly = false; // Console.WriteLine(x); // Rendez.PatientSet.Find(RendezVousSelect.RendezVousID); try { Rendez.SaveChanges(); } catch (Exception e) { MessageBox.Show("Une erreur s'est produite au cours de la modification"); } ListeRendezVous2 = ListeRendezVous; //Rendez.PatientSet.SqlQuery("UPDATE dbo.PatientSet SET nom_colonne_1 = 'nouvelle valeur'WHERE condition"); RendezVous = Rendez.RendezVousSet.ToList(); ListeRendezVous.Clear(); /* foreach (var item in RendezVous) * { * ListeRendezVous2.Add(item); * }*/ ListeRendezVous = ListeRendezVous2; }
public void AjouterRendezVous() { ListeDg.IsReadOnly = false; Console.WriteLine(datebox); //Datebox = DateTime.Now; // DateTime enteredDate = DateTime.Parse(datebox); try { Rendez.RendezVousSet.Add(new RendezVous { DateRendezVous = datebox, Statut = "Valide", Patient = patient, PatientID = patient.PatientID }); Rendez.SaveChanges(); } catch (Exception e) { MessageBox.Show("Veillez verifiez vos informations"); } ListeRendezVous.Clear(); RendezVous = Rendez.RendezVousSet.ToList(); foreach (var item in RendezVous) { ListeRendezVous2.Add(item); } ListeRendezVous = ListeRendezVous2; }
public void Create(RendezModel p) { Rendez pm = new Rendez(); pm.Id = p.Id; pm.Date = p.Date; pm.Comment = p.Comment; pm.Patient_Id = p.Patient_Id; pm.Patient = p.Patient; rendezvousService.AddRendezvous(pm); }
public RendezModel Get(int id) { Rendez p = rendezvousService.GetRendezvous(id); RendezModel pm = new RendezModel(); pm.Id = p.Id; pm.Date = p.Date; pm.Comment = p.Comment; pm.Patient_Id = p.Patient_Id; pm.Patient = p.Patient; return(pm); }
public void SuprimerRendezVous() { //=RendezVousSelect; try { if (RendezVousSelect.PatientID != 0) { Rendez.RendezVousSet.Remove(RendezVousSelect); } Rendez.SaveChanges(); } catch (Exception e) { MessageBox.Show("Une erreur s'est produite au cours de la supression"); } RendezVous = Rendez.RendezVousSet.ToList(); ListeRendezVous.Clear(); foreach (var item in RendezVous) { ListeRendezVous2.Add(item); } ListeRendezVous = ListeRendezVous2; }
public void UpdateRendezvous(Rendez Rendezvous) { RendezRepos.update(Rendezvous); }
public void AddRendezvous(Rendez Rendezvous) { RendezRepos.Insert(Rendezvous); }