public static void removeClient(int id, DB_ENTITIES _db) { Clients selectedClient = _db.Clients.Find(id); var rdv = _db.RendezVous; foreach (RendezVous myRdv in rdv) { if (myRdv.Clients_idClients == selectedClient.idClients) { Utils.removeRdv(myRdv.idRendezVous, _db); } } var animals = _db.Animaux; foreach (Animaux animal in animals) { if (animal.Clients_idClients == selectedClient.idClients) { Utils.removeAnimal(animal.idAnimaux, _db); } } var ordonnances = _db.Ordonnance; foreach (Ordonnance ordonnance in ordonnances) { if (ordonnance.Clients_idClients == selectedClient.idClients) { Utils.removeOrdonnance(ordonnance.idOrdonnance, _db); } } _db.Clients.Remove(selectedClient); _db.SaveChanges(); }
public static void removeAnimal(int id, DB_ENTITIES _db) { Animaux myAnimal = _db.Animaux.Find(id); var rappels = _db.Rappel; foreach (Rappel rappel in rappels) { if (rappel.Animaux_idAnimaux == myAnimal.idAnimaux) { Utils.removeRappel(rappel.idRappel, _db); } } var ordonnances = _db.Ordonnance; foreach (Ordonnance ordonnance in ordonnances) { if (ordonnance.Animaux_idAnimaux == myAnimal.idAnimaux) { Utils.removeOrdonnance(ordonnance.idOrdonnance, _db); } } myAnimal.Soins = null; myAnimal.Race = null; _db.Animaux.Remove(myAnimal); _db.SaveChanges(); }
public RendezVousForm() { _db = new DB_ENTITIES(); InitializeComponent(); populateClientList(); displayRdv(datePicker.Value); }
public Planning() { InitializeComponent(); _db = new DB_ENTITIES(); SetupDataGrid(); PopulateDataGrid(datePicker.Value); }
public Rappels_Form(Animaux animal) { _db = new DB_ENTITIES(); InitializeComponent(); datePicker.MinDate = DateTime.Now; this.animal = animal; }
public Authentication() { InitializeComponent(); time = new Timer(); startTime(); _db = new DB_ENTITIES(); }
public ProduitsSheet(Produits p) { InitializeComponent(); this.p = p; this._db = new DB_ENTITIES(); intialiseText(); }
public ClientSheet(Clients client) { _db = new DB_ENTITIES(); InitializeComponent(); this.client = client; allAnimalsClient.FullRowSelect = true; InitializeIntels(); }
public ClientList() { _db = new DB_ENTITIES(); InitializeComponent(); allClientList.FullRowSelect = true; searchName = ""; selectedLine = ""; InitializeClientList(""); }
public Maladies_Form(Animaux animal) { InitializeComponent(); this.animal = animal; dateTimePicker1.MaxDate = DateTime.Now; _db = new DB_ENTITIES(); date = DateTime.Now; completeMaladie(); animal = _db.Animaux.Find(1); }
public RendezVousSelector(List <RendezVous> rendezVous) { rdvs = rendezVous; _db = new DB_ENTITIES(); InitializeComponent(); foreach (RendezVous rdv in rendezVous) { listRdv.Items.Add(rdv.Date.ToShortTimeString() + " " + rdv.Clients.Prenom + " " + rdv.Clients.Nom); } }
public RendezVousForm(RendezVous rendezVous) { _db = new DB_ENTITIES(); InitializeComponent(); populateClientList(); if (rendezVous != null) { setRdvValues(rendezVous); } displayRdv(datePicker.Value); }
public FicheAnimalInterface(Animaux animal) { _db = new DB_ENTITIES(); InitializeComponent(); this.animal = animal; InitializeIntels(); listOfDiseases.FullRowSelect = true; listReminders.FullRowSelect = true; completeMaladieList(); completeRemindersList(); }
public static void removeSoin(int id, DB_ENTITIES _db) { var factures = _db.Factures; foreach (Factures facture in factures) { Utils.removefacture(facture.idFactures, _db); } _db.Soins.Remove(_db.Soins.Find(id)); _db.SaveChanges(); }
public NewProduct(Stock s, DB_ENTITIES _db, Produits p) { InitializeComponent(); this.s = s; this._db = _db; this.p = p; if (p != null) { fillInfos(); this.qtt.Hide(); this.label3.Hide(); } }
public AnimauxInterface() { _db = new DB_ENTITIES(); InitializeComponent(); searchName = ""; searchEspece = ""; searchRace = ""; searchNameProprietaire = ""; selectedLine = ""; this.allAnimauxList.View = View.List; animaux = new List <string>(); InitializeAnimauxInterface(""); init(); }
public Globalinterface(String id) { InitializeComponent(); _db = new DB_ENTITIES(); time = new Timer(); this.id = id; startTime(); this.logsListView.View = View.List; this.rappelListView.View = View.List; this.todaysAppointmentListView.View = View.List; fillLog(); fillRecall(); fillTodaysApp(); }
public ProductSell(Produits produit, Stock stock) { InitializeComponent(); this.produit = produit; this.label1.Text = "0"; this.quantité = int.Parse(this.label1.Text); _db = new DB_ENTITIES(); findStock(); fillList(); this.pro.Text = produit.Nom; this.client.Text = ""; this.s = stock; this.textBox1.Enabled = false; }
public RendezVousForm(Clients client) { _db = new DB_ENTITIES(); InitializeComponent(); populateClientList(); for (int i = 0; i < clientList.Items.Count; i++) { var c = clientList.Items[i]; if (int.Parse(((String)c).Substring(0, ((String)c).IndexOf('.'))) == client.idClients) { clientList.SelectedItem = client; } } displayRdv(datePicker.Value); }
public Stock() { InitializeComponent(); products = new List <string>(); this.listView1.View = View.List; _db = new DB_ENTITIES(); initialiseProduits(""); //Position Point p = new Point(110, 145); this.Location = p; this.FormBorderStyle = FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; }
public static void removeRdv(int id, DB_ENTITIES _db) { RendezVous myRdv = _db.RendezVous.Find(id); var factures = _db.Factures; foreach (Factures facture in factures) { if (facture.RendezVousId == myRdv.idRendezVous) { Utils.removefacture(facture.RendezVousId, _db); } } _db.RendezVous.Remove(_db.RendezVous.Find(id)); _db.SaveChanges(); }
public Prescription(int idClient, int idAnimal) { idClientSelected = idClient; idAnimalSelected = idAnimal; _db = new DB_ENTITIES(); InitializeComponent(); InitializeClientList(""); InitializeProduct(); if (idAnimal != 0 && idClient != 0) { secondPagePanel.Visible = true; } listClient.FullRowSelect = true; ClientsAnimal.FullRowSelect = true; }
public ClientForm(Clients clientSelected, DB_ENTITIES _db, ClientList clientList) { InitializeComponent(); isModification = false; this.clientList = clientList; client = clientSelected; this._db = _db; isMan = true; naissanceDatePicker.MaxDate = DateTime.Now; SelectedDate = DateTime.Now; if (client != null) { initializeInput(); isModification = true; } }
public InscriptionAnimalInterface(Animaux animalSelected, AnimauxInterface animalInterface, Clients client) { InitializeComponent(); isModification = false; this.client = client; dateTimePicker1.MaxDate = DateTime.Now; this.animalList = animalInterface; animal = animalSelected; this._db = new DB_ENTITIES(); isMan = true; dateNais = DateTime.Now; idAnimal = 0; if (animal != null) { idAnimal = animal.idAnimaux; initializeInput(); isModification = true; } init(); }
public static void removeOrdonnance(int id, DB_ENTITIES _db) { _db.Ordonnance.Remove(_db.Ordonnance.Find(id)); _db.SaveChanges(); }
public static void removeRappel(int id, DB_ENTITIES _db) { _db.Rappel.Remove(_db.Rappel.Find(id)); _db.SaveChanges(); }
private static void removefacture(int idFactures, DB_ENTITIES _db) { _db.Factures.Remove(_db.Factures.Find(idFactures)); _db.SaveChanges(); }