private void ExecuteClientProCommandeCourante(UnClientPROVM obj) { DetailCommandeClientPro = new List <UnClientPROVM>(); if (obj.clt.type == 1) { List <Commande> listeCommandeClientPro = (List <Commande>)CommandeDAO.selectCommandesByClient(obj.clt.id, true, true, true); foreach (Commande com in listeCommandeClientPro) { prixApayer = 0; foreach (Article ar in com.listArticles) { prixApayer = (float)((decimal)prixApayer + (decimal)ar.TTC); } foreach (Payement pa in com.listPayements) { prixApayer = (float)((decimal)prixApayer - (decimal)pa.montant); } DetailCommandeClientPro.Add(new UnClientPROVM() { commande = com, Label_Detail_NombresArt = com.listArticles.Count, Label_Detail_prixAPayer = prixApayer }); } } }
//private void testPrint() //{ // Client c = new Client(1, "TRAORE", "Mami", "", "", null, DateTime.Now, "", DateTime.Now, 10, false, false, 0); // Commande comTest = new Commande(2, DateTime.Now, false, 0, c); // Departement dep = new Departement(1, "Classique"); // TypeArticle t = new TypeArticle(1, "jupe", 1, 20, 5, dep); // TypeArticle t2 = new TypeArticle(2, "robe", 1, 20, 50, dep); // TypeArticle t3 = new TypeArticle(3, "habit", 1, 20, 25, dep); // Article a1 = new Article(1, "", "", false, 20, 5, t, null, 2); // Article a2 = new Article(2, "", "", false, 20, 50, t2, null, 2); // Article a3 = new Article(3, "", "", false, 20, 25, t3, null, 2); // comTest.addArticle(a1); // comTest.addArticle(a2); // comTest.addArticle(a3); // //RecuPaiement rp = new RecuPaiement(comTest); // //rp.printRecu(); // // MessageBox.Show( + ""); // TicketVetement tv = new TicketVetement(comTest); // tv.printTicketVetement(a1, comTest.id, c); // //String s=null; // //for (int i = 0; i < PrinterSettings.InstalledPrinters.Count; i++) // //{ // // s += PrinterSettings.InstalledPrinters[i] + "\n"; // //} // //MessageBox.Show(s); //} private void ExecuteCommandeClientPro(UnClientPROVM obj) { try { ClasseGlobale._renduCommandeClientPro = obj.commande; ClasseGlobale.Client = obj.commande.client; Label_CommandeSelectionner = "Client PRO: " + ClasseGlobale.Client.nom + ", N° Commande : " + ClasseGlobale._renduCommandeClientPro.id + " TOTAL : " + obj.Label_Detail_prixAPayer; Label_ClientProUC_TotalAPayer = obj.Label_Detail_prixAPayer; } catch (Exception ex) { MessageBox.Show("Error: " + ex); } }