-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCLmapCommande.cpp
72 lines (69 loc) · 3.93 KB
/
CLmapCommande.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "CLmapCommande.h"
System::String^ NS_Comp_Mappage::CLmapCommande::SelectCommande(void)
{
return "SELECT C.Commande_Id, C.Prevision_Livraison, C.Emission_Livraison, C.Reception_Livraison, C.Total_Article, F.Facture_Id, F.Montant_HT, F.Montant_TVA, F.Montant_TTC, P.Paiement_Id, P.Execution_Paiement, P.Moyen_Paiement FROM Commande C INNER JOIN Facture F ON C.Facture_Id = F.Facture_Id LEFT JOIN Paiement P ON C.Commande_Id = P.Commande_Id;";
}
System::String^ NS_Comp_Mappage::CLmapCommande::InsertCommande(void)
{
return "DECLARE @commandeId VARCHAR(255); DECLARE @factureId INT; INSERT INTO Facture (Montant_HT, Montant_TVA, Montant_TTC, Facture_Emission, Societe_Id) VALUES ('" + this->HT + "', '" + this->TVA + "', '" + this->TTC + "', '" + this->dateemissionfacture + "', '" + this->societeID + "'); SET @factureId = SCOPE_IDENTITY(); INSERT INTO Commande (Commande_Id, Prevision_Livraison, Emission_Livraison, Reception_Livraison, Total_Article, Personnel_Id, Facture_Id) VALUES ('" + this->commandeID + "', '" + this->dateprevision + "', '" + this->dateemission + "', '" + this->datereception + "', '" + this->totalarticle + "', '" + this->personnelID + "', @factureId); SET @commandeId = '" + this->commandeID + "'; INSERT INTO Paiement (Execution_Paiement, Moyen_Paiement, Commande_Id) VALUES ('" + this->executionpaiement + "', '" + this->moyenpaiement + "', @commandeId); ";
}
System::String^ NS_Comp_Mappage::CLmapCommande::DeleteCommande(System::String^ CommandeID)
{
return "DELETE FROM [BDD_Projet_POO].[dbo].[Commande] WHERE [Commande_Id] = " + commandeID + " ;";
}
System::String^ NS_Comp_Mappage::CLmapCommande::UpdateCommande(void)
{
return "DECLARE @commandeId VARCHAR(255); UPDATE Facture SET Montant_HT = '" + this->HT + "', Montant_TVA = '" + this->TVA + "', Montant_TTC = '" + this->TTC + "', Facture_Emission = '" + this->dateemissionfacture + "' WHERE Facture.Facture_Id = (SELECT Commande.Facture_Id FROM Commande WHERE Commande.Commande_Id = '" + this->commandeID + "'); UPDATE Commande SET Prevision_Livraison = '" + this->dateprevision + "', Emission_Livraison = '" + this->dateemission + "', Reception_Livraison = '" + this->datereception + "', Total_Article = '" + this->totalarticle + "', Personnel_Id = '" + this->personnelID + "' WHERE Commande.Commande_Id = '" + this->commandeID + "'; SET @commandeId = '" + this->commandeID + "'; UPDATE Paiement SET Execution_Paiement = '" + this->executionpaiement + "', Moyen_Paiement = '" + this->moyenpaiement + "' WHERE Paiement.Commande_Id = @commandeId; ";
}
void NS_Comp_Mappage::CLmapCommande::setCommandeID(System::String^ commandeID)
{
this->commandeID = commandeID;
}
void NS_Comp_Mappage::CLmapCommande::setDatePrevision(System::String^ prevision)
{
this->dateprevision = prevision;
}
void NS_Comp_Mappage::CLmapCommande::setDateEmission(System::String^ emission)
{
this->dateemission = emission;
}
void NS_Comp_Mappage::CLmapCommande::setDateReception(System::String^ reception)
{
this->datereception = reception;
}
void NS_Comp_Mappage::CLmapCommande::setTotalArticle(int totalarticle)
{
this->totalarticle = totalarticle;
}
void NS_Comp_Mappage::CLmapCommande::setPersonnelID(int personnelID)
{
this->personnelID = personnelID;
}
void NS_Comp_Mappage::CLmapCommande::setHT(System::String^ HT)
{
this->HT = HT;
}
void NS_Comp_Mappage::CLmapCommande::setTVA(System::String^ TVA)
{
this->TVA = TVA;
}
void NS_Comp_Mappage::CLmapCommande::setTTC(System::String^ TTC)
{
this->TTC = TTC;
}
void NS_Comp_Mappage::CLmapCommande::setDateEmissionFacture(System::String^ dateemissionfacture)
{
this->dateemissionfacture = dateemissionfacture;
}
void NS_Comp_Mappage::CLmapCommande::setSocieteID(int societeID)
{
this->societeID = societeID;
}
void NS_Comp_Mappage::CLmapCommande::setMoyenPaiement(System::String^ moyenpaiement)
{
this->moyenpaiement = moyenpaiement;
}
void NS_Comp_Mappage::CLmapCommande::setExecutionPaiement(System::String^ dateemissionfacture)
{
this->dateemissionfacture = dateemissionfacture;
}