public FormLister(gsbEntities p_bd, List <prescrire> resultat) { InitializeComponent(); resultats = resultat; BD = p_bd; CreateHeadersAndFillListView(); PaintListView(resultat); }
public FormPrescrire(gsbEntities p_bd) { InitializeComponent(); BD = p_bd; initCbs(); btValider.Location = new Point(140, 245); btValider.Text = "Ajouter"; btAnnuler.Location = new Point(225, 245); }
public FormPrescrire(gsbEntities p_bd, List <prescrire> resultats) { InitializeComponent(); BD = p_bd; initCbs(); retourRes = resultats; btValider.Location = new Point(98, 245); btValider.Text = "Ajouter"; btAnnuler.Location = new Point(268, 245); }
public FormPrescrire(gsbEntities p_bd, prescrire v) { InitializeComponent(); BD = p_bd; initCbs(); prescription = v; btValider.Location = new Point(98, 245); btSupp.Location = new Point(183, 245); btSupp.Visible = true; btAnnuler.Location = new Point(268, 245); remplirForm(v); }
private void btValiderConnexion_Click(object sender, EventArgs e) { string login = tbLogin.Text; string mdp = tbMdp.Text; bool verif = false; bool logVerif = false; using (gsbEntities BD = new gsbEntities()) { var req = from praticien in BD.praticien where praticien.nom_praticien == login select praticien; if (req.LongCount() == 0) { lbErreurConnexion.Text = "Login inconnu !"; } else { logVerif = true; foreach (praticien unPracticien in req) { if (unPracticien.id_praticien.ToString() == mdp) { verif = true; this.Close(); LeFormMenu.connecte(unPracticien.nom_praticien); } lbErreurConnexion.Text = "Mot de passe incorrect !"; } } if (!verif) { if (logVerif) { tbMdp.Text = ""; tbMdp.Select(); } else { tbLogin.Text = ""; tbLogin.Select(); tbMdp.PasswordChar = '\0'; tbMdp.Text = "Entrer mot de passe"; } lbErreurConnexion.Visible = true; btValiderConnexion.Enabled = false; } } }
public FormPrescrire(gsbEntities p_bd, prescrire v, List <prescrire> resultats) { InitializeComponent(); BD = p_bd; initCbs(); retourRes = resultats; prescription = v; btValider.Location = new Point(55, 245); btSupp.Location = new Point(140, 245); btSupp.Visible = true; btAnnuler.Location = new Point(310, 245); remplirForm(v); }
public FormRechercher(gsbEntities p_bd) { InitializeComponent(); BD = p_bd; resultat = new List <prescrire>(); //auto(); var reqMedoc = from medicament in BD.medicament select medicament; cbMedicament.DisplayMember = "NomMedicament"; cbMedicament.ValueMember = "IdMedicament"; cbMedicament.Items.Add(new unMedicament() { NomMedicament = "Sélectionner un Medicament", IdMedicament = 0 }); cbMedicament.SelectedIndex = 0; foreach (medicament medoc in reqMedoc) { cbMedicament.Items.Add(new unMedicament() { NomMedicament = medoc.nom_commercial, IdMedicament = medoc.id_medicament }); } var reqType = from type_individu in BD.type_individu select type_individu; cbType_individu.DisplayMember = "LibType"; cbType_individu.ValueMember = "IdType"; cbType_individu.Items.Add(new unType() { LibType = "Sélectionner un type d'individu ", IdType = 0 }); cbType_individu.SelectedIndex = 0; foreach (type_individu typeInd in reqType) { cbType_individu.Items.Add(new unType() { LibType = typeInd.lib_type_individu, IdType = typeInd.id_type_individu }); } var reqDosage = from dosage in BD.dosage select dosage; cbDosage.DisplayMember = "UniteDosage"; cbDosage.ValueMember = "IdDosage"; cbDosage.Items.Add(new unDosage() { LibDosage = "Sélectionner un Dosage ", IdDosage = 0 }); cbDosage.SelectedIndex = 0; foreach (dosage dose in reqDosage) { cbDosage.Items.Add(new unDosage() { LibDosage = dose.unite_dosage + dose.qte_dosage, IdDosage = dose.id_dosage }); } }
private void modifPrescrire() { using (gsbEntities bdd = new gsbEntities()) { prescrire visi = (from prescrire in bdd.prescrire where prescrire.id_medicament == prescription.id_medicament where prescrire.id_type_individu == prescription.id_type_individu where prescrire.id_dosage == prescription.id_dosage select prescrire).FirstOrDefault(); if (visi.type_individu.lib_type_individu != tbTypeIndividu.Text) { if (tbTypeIndividu.Text == "") { visi.id_type_individu = 0; } else { visi.id_type_individu = prescription.id_type_individu + 1; } } if (visi.posologie != tbPosologie.Text) { if (tbPosologie.Text == "") { visi.posologie = null; } else { visi.posologie = tbPosologie.Text; } } if (visi.id_medicament != cbMedicament.SelectedIndex) { if (cbMedicament.SelectedIndex == 0) { visi.id_medicament = 0; } else { visi.id_medicament = cbMedicament.SelectedIndex; } } if (visi.id_dosage != cbDosage.SelectedIndex) { if (cbDosage.SelectedIndex == 0) { visi.id_dosage = 0; } else { visi.id_dosage = cbDosage.SelectedIndex; } } prescription = visi; if (retourRes != null && retourRes.LongCount() > 0) { int index = 0; bool verif = false; foreach (prescrire unVisi in retourRes) { if (unVisi.id_medicament == visi.id_medicament && unVisi.id_type_individu == visi.id_type_individu && unVisi.id_dosage == visi.id_dosage) { verif = true; break; } index++; } if (verif) { retourRes.RemoveAt(index); retourRes.Add(visi); retourRes.Sort(delegate(prescrire vis1, prescrire vis2) { return(string.Compare(vis1.posologie, vis2.posologie)); }); } } bool flag = false; try { bdd.SaveChanges(); } catch { MessageBox.Show("La modification n'a pas pu être enregistrée !", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Warning); flag = true; } if (!flag) { if (retourRes != null && retourRes.LongCount() > 0) { MessageBox.Show("La prescription a bien été modifié !", "Confirmation de modification", MessageBoxButtons.OK, MessageBoxIcon.Information); System.Threading.Thread monthread = new System.Threading.Thread(new System.Threading.ThreadStart(nouveauFormModifList)); monthread.Start(); this.Close(); } else { MessageBox.Show("La prescription a bien été modifié !", "Confirmation de modification", MessageBoxButtons.OK, MessageBoxIcon.Information); System.Threading.Thread monthread = new System.Threading.Thread(new System.Threading.ThreadStart(nouveauFormModif)); monthread.Start(); this.Close(); } } } }
public Menu() { InitializeComponent(); BD = new gsbEntities(); }