//ajouter un bilan static public void AddBilanVisite(string praticien, string visiteur, string date, string motif, string impact) { date = Convert.ToDateTime(date).ToShortDateString(); date = date.Replace('/', '-'); date = date[6].ToString() + date[7].ToString() + date[8].ToString() + date[9].ToString() + date[2].ToString() + date[3].ToString() + date[4].ToString() + date[2].ToString() + date[0].ToString() + date[1].ToString(); praticien = praticien.Replace("'", " "); praticien = praticien.Replace('"', ' '); visiteur = visiteur.Replace("'", " "); visiteur = visiteur.Replace('"', ' '); motif = motif.Replace("'", " "); motif = motif.Replace('"', ' '); impact = impact.Replace("'", " "); impact = impact.Replace('"', ' '); int id = Convert.ToInt16(Manager.SelectMaxIdBilan()[0][0]); int unId = id + 1; string sql = "INSERT INTO rapport (id, date, motif, bilan, idMedecin, idVisiteur) VALUES (" + unId + ",'" + date + "', '" + motif + "', '" + impact + "', '" + praticien + "', '" + visiteur + "')"; Passerelle.InsertUpdateDel(Manager.conenct(), sql); }
private void button1_Click(object sender, EventArgs e) { int index = comboBoxInventoristes.SelectedIndex; int lIdInventosite = Passerelle.getLesInventoristes()[index].getIdInventoriste(); string nomInventoriste = textBoxNom.Text; string prenomInventoriste = textBoxPrenom.Text; string adresseInventoriste = textBoxAdresse.Text; string complementInventoriste = textBoxComplement.Text; string numTelInventoriste = textBoxNumTel.Text; string numFixeInventoriste = textBoxNumFix.Text; string mailInventoriste = textBoxMail.Text; int IdVille = 1; linventoriste = new Inventoriste(lIdInventosite, nomInventoriste, prenomInventoriste, adresseInventoriste, complementInventoriste, numTelInventoriste, numFixeInventoriste, mailInventoriste, IdVille); DialogResult reponse = MessageBox.Show(this, "Êtes-vous sûr de vouloir enregistrer cet inventoriste ?", "Enregistrer Inventoriste", MessageBoxButtons.OKCancel); if (reponse == DialogResult.OK) { //création de la commande dans la BDD Passerelle.majInfosInventoriste(linventoriste); MessageBox.Show("L'inventoriste a été enregistrée avec succès !"); comboBoxInventoristes.Text = ""; textBoxNom.Text = ""; textBoxPrenom.Text = ""; textBoxAdresse.Text = ""; textBoxComplement.Text = ""; textBoxNumTel.Text = ""; textBoxNumFix.Text = ""; textBoxMail.Text = ""; } else { MessageBox.Show(" Souci sur l'insertion de l'invetoriste"); } }
private void menuPrincipal_Load_1(object sender, EventArgs e) { if (Passerelle.connectBase() == false) { MessageBox.Show("Souci connexion BDD"); } }
private void button3_Click(object sender, EventArgs e) { txtMessageI.ForeColor = System.Drawing.Color.Green; txtMessageI.Text = "Choisir le produit concerné"; txtMessageI.Visible = true; choixInventaire = comboBoxInventaire.SelectedIndex; panelChoixProduit.Visible = true; if (lesProduits != null) { foreach (Produit unProd in lesProduits) { int i = 0; comboBoxProduit.Items.RemoveAt(i); i += 1; } comboBoxProduit.ResetText(); } lesProduits = Passerelle.getLesProduitsParInventaire(choixInventaire); foreach (Produit unProduit in lesProduits) { reference = unProduit.getReference(); comboBoxProduit.Items.Add(unProduit.getLibelleProduit()); } }
public void testOccupantsHopitalParMois() { int attendu = 59; int actuel = Passerelle.getOccupantsHopitalParMois(1); Assert.AreEqual(attendu, actuel); }
public void seDeconnecterTestSansco() { bool testDeconnexion = Passerelle.seDeconnecter(); bool expected = false; Assert.AreEqual(expected, testDeconnexion, "erreur avec la fermeture de connexion"); }
// validation du numéro de produit private void textBoxReference_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { // vérif saisie produit if (textBoxReference.Text != "") { // remplissage des informations produit textBoxReference.Text = boiteOutil.enMajuscule(textBoxReference.Text.ToString()); leProduit = Passerelle.getProduit(textBoxReference.Text.Trim()); if (leProduit != null) { textBoxNomProduit.Text = leProduit.getLibelleProduit(); textBoxPUHT.Text = leProduit.getPrixUHTProduit().ToString(); textBoxCouleur.Text = leProduit.getCouleurProduit(); textBoxTaille.Text = leProduit.getTailleProduit(); textBoxQuantite.Focus(); txtMessageP.Text = "Entrez une quantité et appuyez sur entrée"; } else { MessageBox.Show("Erreur référence produit inexistante"); textBoxReference.Clear(); } } else { MessageBox.Show("Il faut remplir le numéro de produit"); textBoxReference.Clear(); } } }
private void comboNumCmd_SelectedIndexChanged(object sender, EventArgs e) { dataGridCmd.Rows.Clear(); int i = comboNumCmd.SelectedIndex; Commande laCommande = cmdAttentes[i]; Client leClient = laCommande.getLeClient(); //Association des label avec le client de la commande labelNum.Text = leClient.getNumClient().ToString(); labelNom.Text = leClient.getNomClient().ToString(); labelEmail.Text = leClient.getEmailClient().ToString(); labelPrenom.Text = leClient.getPrenomClient().ToString(); labelTel.Text = leClient.getTelClient().ToString(); labelAdresse.Text = leClient.getAdresseClient().ToString(); //Remplir le Datagrid List <LigneCommandeClient> lesLignes = Passerelle.getLignesCmd(laCommande); foreach (LigneCommandeClient ligne in lesLignes) { Produit prod = ligne.getLeProduit(); dataGridCmd.Rows.Add(ligne.getLeProduit().getReference(), ligne.getLaQuantité(), prod.getPrixUHTProduit(), prod.getPrixUHTProduit() * ligne.getLaQuantité(), prod.getPoids()); } //Choix de l'expediteur double poidsCommande = laCommande.getPoids(); labelPoids.Text = poidsCommande.ToString() + " Kg"; Facturer laFacture = Passerelle.getBestExpediteur(poidsCommande); labelTransp.Text = laFacture.getExpediteur().getLibelleExp(); labelPrix.Text = laFacture.getPrix().ToString() + " €"; }
//modification utilisateur static public void UpdateVisteur(string unNom, string unPrenom, string uneAdresse, string uneDate, string unIdVille, string unCp, int id) { unPrenom = unPrenom.Replace("'", " "); unPrenom = unPrenom.Replace('"', ' '); unNom = unNom.Replace("'", " "); unNom = unNom.Replace('"', ' '); uneAdresse = uneAdresse.Replace("'", " "); uneAdresse = uneAdresse.Replace('"', ' '); unIdVille = unIdVille.Replace("'", " "); unIdVille = unIdVille.Replace('"', ' '); unCp = unCp.Replace("'", " "); unCp = unCp.Replace('"', ' '); uneDate = uneDate.Replace('/', '-'); uneDate = uneDate[6].ToString() + uneDate[7].ToString() + uneDate[8].ToString() + uneDate[9].ToString() + uneDate[2].ToString() + uneDate[3].ToString() + uneDate[4].ToString() + uneDate[2].ToString() + uneDate[0].ToString() + uneDate[1].ToString(); uneDate = uneDate.Replace("'", " "); uneDate = uneDate.Replace('"', ' '); string sql = "UPDATE visiteur SET nom = '" + unNom + "', prenom ='" + unPrenom + "', adresse ='" + uneAdresse + "', dateEmbauche = '" + uneDate + "', idVille = '" + unIdVille + "', cdp ='" + unCp + "' WHERE id =" + id; Passerelle.InsertUpdateDel(Manager.conenct(), sql); }
private void SelectionRapport(object sender, SelectionChangedEventArgs e) { if (ListRapports.SelectedItem == null) { return; } ListViewMedics.Items.Clear(); int idRapport = (int)ListRapports.SelectedItem; Rapport rapport = Manager.GetRapport(idRapport); Visiteur visiteur = Passerelle.GetVisiteur(rapport.IdVisiteur); Medecin medecin = Passerelle.GetMedecin(rapport.IdMedecin); NomVisiteur.Text = visiteur.Nom; PrenomVisiteur.Text = visiteur.Prenom; MotifVisite.Text = rapport.Motif; DateVisite.SelectedDate = rapport.Date; BilanVisite.Text = rapport.Bilan; NomMedecin.Text = medecin.Nom; AdresseMedecin.Text = medecin.Adresse; PrenomMedecin.Text = medecin.Prenom; List <EchantillonOffert> lesEchantillonOffert = Manager.GetLesEchantillonsOfferts(rapport.Id); foreach (EchantillonOffert eo in lesEchantillonOffert) { var tab1 = new { Medicament = eo.LeMedicament.NomCommercial, Quantite = eo.Quantite }; ListViewMedics.Items.Add(tab1); } }
// validation de la quantité private void textBoxQuantite_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { // vérifie que la quantité est remplie et entière if (Passerelle.convertNum(textBoxQuantite.Text) == true) { qte = Int32.Parse(textBoxQuantite.Text); if (qte != 0) { //test quantité suffisante if (qte <= leProduit.getStockTemp()) { textBoxEtat.Text = "disponible"; } else { textBoxEtat.Text = "sous " + leProduit.getDelaiReapro() + " semaines"; } txtMessageP.Text = " Cliquez sur Valider ou RAZ"; buttonValiderProduit.Focus(); } } else { MessageBox.Show("la quantité est incorrecte"); } } }
public Commande(Client unClient) { dateCommande = Passerelle.DateNowToInt(); statutCommande = "A"; montantCommandeHT = 0; leClient = unClient; lesLignes = new List <LigneCommandeClient>(); }
public void TestrecupCapaMax() { int attendu = 50; int service = 1; int actuel = Passerelle.recupCapacitéMax(service); Assert.AreEqual(attendu, actuel); }
public void seConnecterTest() { bool testConnexion = Passerelle.seConnecter(); bool expected = true; Assert.AreEqual(expected, testConnexion, "erreur avec l'ouverture de la connexion"); Passerelle.seDeconnecter(); }
public void seDeconnecterTestAvecCo() { Passerelle.seConnecter(); bool testDeconnexion = Passerelle.seDeconnecter(); bool expected = true; Assert.AreEqual(expected, testDeconnexion, "erreur avec la fermeture de connexion"); }
static public List <string[]> SelectRapports(int idMedecin) { string sql = "SELECT rapport.id, date, motif, bilan " + "FROM rapport INNER JOIN medecin ON medecin.id = rapport.idMedecin " + "WHERE rapport.idMedecin = '" + idMedecin + "'"; return(Passerelle.Query(Manager.conenct(), sql)); }
public void verifFauxUtilisateurTest() { String login = "******"; String mdp = "faux"; bool testVerifUtilisateur = Passerelle.verifUtilisateur(login, mdp); bool expected = false; Assert.AreEqual(expected, testVerifUtilisateur, "erreur avec la verification d'un utilisateur inexistant"); }
public void verifVraiUtilisateurTest() { String login = "******"; String mdp = "mdp"; bool testVerifUtilisateur = Passerelle.verifUtilisateur(login, mdp); bool expected = true; Assert.AreEqual(expected, testVerifUtilisateur, "erreur avec la verification d'un utilisateur existant"); }
//Suppression des rapports et des échantillions en fonction d'un praticiens static public void DeleteRapports(int unId) { string sql = "DELETE FROM offrir WHERE offrir.idRapport = '" + unId + "'"; Passerelle.InsertUpdateDel(Manager.conenct(), sql); string supp = "DELETE FROM rapport WHERE rapport.id = '" + unId + "'"; Passerelle.InsertUpdateDel(Manager.conenct(), supp); }
private void ModifierInformationsInventoriste_Load(object sender, EventArgs e) { List <Inventoriste> lesInventoriste; lesInventoriste = Passerelle.getLesInventoristes(); foreach (Inventoriste unInv in lesInventoriste) { comboBoxInventoristes.Items.Add(unInv.getNomInventoriste()); } }
private void SupprimerUnInventoriste_Load(object sender, EventArgs e) { List <Inventoriste> lesInventoriste; lesInventoriste = Passerelle.getLesInventoristes(); foreach (Inventoriste unInv in lesInventoriste) { comboBoxSuppInventoriste.Items.Add(unInv.getNomInventoriste()); } }
//suppression d'un visiteur static public void DeleteVisiteur(int unId, string unNom, string unPrenom) { //pour supprimer un visiteur, il faut d'abord supprime les rapports où le visiteur était en charge string req = "DELETE FROM rapport WHERE idVisiteur = " + unId; Passerelle.InsertUpdateDel(Manager.conenct(), req); string sql = "DELETE FROM visiteur WHERE nom ='" + unNom + "' AND prenom ='" + unPrenom + "'"; Passerelle.InsertUpdateDel(Manager.conenct(), sql); }
private void EnregistrementLivraison_Load(object sender, EventArgs e) { //Ajoute les numéros de commandes au ComboBox cmdAttentes = Passerelle.getCommandeAttentes(); foreach (Commande cmd in cmdAttentes) { comboNumCmd.Items.Add(cmd.getNumCommande()); } }
private void GestionCommande_Load(object sender, EventArgs e) { panel2.Visible = true; panel1.Visible = false; panel3.Visible = false; TxtMessage.ForeColor = System.Drawing.Color.Green; txtMessageP.ForeColor = System.Drawing.Color.Green; TxtMessage.Text = "Entrez un numéro et appuyez sur entrée"; TxtMessage.Visible = true; maxNum = Passerelle.getMaxNumCde(); }
public void testTauxOccupationMoisService() { int attendu = 60; int mois = 1; int service = 1; Double tauxRecup = Passerelle.tauxOccuMoisService(mois, service); Assert.AreEqual(attendu, tauxRecup); }
//affichage de la liste des medecins static public List <string[]> SelectMedecins() { string sql = "SELECT medecin.nom as nom, medecin.prenom as prenom, " + "specialiste.libelle as specialite , villes_france_free.ville_nom_reel as ville, " + "villes_france_free.ville_code_postal, medecin.adresse, medecin.telephone," + " medecin.id FROM medecin INNER JOIN specialiste " + "ON medecin.idSpecialiste = specialiste.id " + "LEFT JOIN villes_france_free ON medecin.idVille = villes_france_free.ville_id ORDER BY medecin.nom"; return(Passerelle.Query(Manager.conenct(), sql)); }
public void calculPoidsCommande() { double pds = 0; lesLignes = Passerelle.getLignesCmd(this); foreach (LigneCommandeClient ligne in lesLignes) { pds = pds + ligne.getLeProduit().getPoids(); } poids = pds; }
//Modification d'un rapport static public void UpdateRapport(int id, string uneDate, string unMotif, string unBilan) { uneDate = Convert.ToDateTime(uneDate).ToShortDateString(); uneDate = uneDate.Replace('/', '-'); uneDate = uneDate[6].ToString() + uneDate[7].ToString() + uneDate[8].ToString() + uneDate[9].ToString() + uneDate[2].ToString() + uneDate[3].ToString() + uneDate[4].ToString() + uneDate[2].ToString() + uneDate[0].ToString() + uneDate[1].ToString(); uneDate = uneDate.Replace("'", " "); uneDate = uneDate.Replace('"', ' '); string sql = "UPDATE rapport SET rapport.motif = '" + unMotif + "' , rapport.bilan = '" + unBilan + "', rapport.date = '" + uneDate + "' WHERE rapport.id = " + id; Passerelle.InsertUpdateDel(Manager.conenct(), sql); }
private void PrimeInventoriste_Load(object sender, EventArgs e) { lesInventoristes = Passerelle.getLesInventoristesPrimes(); foreach (Inventoriste ligneInventoriste in lesInventoristes) { int id = ligneInventoriste.getIdVille(); laVille = Passerelle.getLaVille(id); string[] lignesInventoristes = { ligneInventoriste.getIdInventoriste().ToString(), ligneInventoriste.getNomInventoriste(), ligneInventoriste.getPrenomInventoriste(), laVille.getNomVille(), laVille.getPrimeVille().ToString() }; dataGridView1.Rows.Add(lignesInventoristes); } }
private void comboBoxSuppInventoriste_SelectedIndexChanged(object sender, EventArgs e) { int index = comboBoxSuppInventoriste.SelectedIndex; textBoxNom.Text = Passerelle.getLesInventoristes()[index].getNomInventoriste(); textBoxPrenom.Text = Passerelle.getLesInventoristes()[index].getPrenomInventoriste(); textBoxAdresse.Text = Passerelle.getLesInventoristes()[index].getAdresseInventoriste(); textBoxComplement.Text = Passerelle.getLesInventoristes()[index].getComplementAdresseInventoriste(); textBoxNumTel.Text = Passerelle.getLesInventoristes()[index].getNumTelInventoriste(); textBoxNumFix.Text = Passerelle.getLesInventoristes()[index].getNumFixeInventoriste(); textBoxMail.Text = Passerelle.getLesInventoristes()[index].getMailInventoriste(); }