string IntfDalLicence.insertLicence(crlLicence Licence, string sigleAgence) { #region declaration int nombreInsertion = 0; string numLicence = ""; IntfDalLicence serviceLicence = new ImplDalLicence(); #endregion #region implementation if (Licence != null) { Licence.NumLicence = serviceLicence.getNumLicence(sigleAgence); this.strCommande = "INSERT INTO `licence` (`numLicence`,`numerosLicence`,`zone`,`numCooperative`,"; this.strCommande += " `numVehicule`,`datePremiereMiseCiculation`,`datePremiereExploitation`,"; this.strCommande += " `valideAu`,`valideDu`,`nombrePlacePayante`,`isProvisoire`)"; this.strCommande += " VALUES ('" + Licence.NumLicence + "','" + Licence.NumerosLicence + "'"; this.strCommande += " ,'" + Licence.Zone + "','" + Licence.NumCooperative + "'"; this.strCommande += " ,'" + Licence.NumVehicule + "', '" + Licence.DatePremiereMiseCiculation.ToString("yyyy-MM-dd") + "'"; this.strCommande += " ,'" + Licence.DatePremiereExploitation.ToString("yyyy-MM-dd") + "','" + Licence.ValideAu.ToString("yyyy-MM-dd") + "'"; this.strCommande += " ,'" + Licence.ValideDu.ToString("yyyy-MM-dd") + "','" + Licence.NombrePlacePayante + "'"; this.strCommande += " ,'" + Licence.IsProvisoire + "')"; this.serviceConnectBase.openConnection(); nombreInsertion = this.serviceConnectBase.requete(this.strCommande); if (nombreInsertion == 1) { numLicence = Licence.NumLicence; } this.serviceConnectBase.closeConnection(); } #endregion return(numLicence); }
string IntfDalLicence.insertLicenceUS(crlLicence Licence, string sigleAgence) { #region declaration int nombreInsertion = 0; string numLicence = ""; string numCooperative = "NULL"; IntfDalLicence serviceLicence = new ImplDalLicence(); #endregion #region implementation if (Licence != null) { if (Licence.NumCooperative != "") { numCooperative = "'" + Licence.NumCooperative + "'"; } Licence.NumLicence = serviceLicence.getNumLicence(sigleAgence); this.strCommande = "INSERT INTO `licence` (`numLicence`,`numerosLicence`,`zone`,`numCooperative`,"; this.strCommande += " `numVehicule`,`nombrePlacePayante`)"; this.strCommande += " VALUES ('" + Licence.NumLicence + "','" + Licence.NumerosLicence + "'"; this.strCommande += " ,'" + Licence.Zone + "'," + numCooperative; this.strCommande += " ,'" + Licence.NumVehicule + "','" + Licence.NombrePlacePayante + "')"; this.serviceConnectBase.openConnection(); nombreInsertion = this.serviceConnectBase.requete(this.strCommande); if (nombreInsertion == 1) { numLicence = Licence.NumLicence; } this.serviceConnectBase.closeConnection(); } #endregion return(numLicence); }