void IntfDalLicence.insertToGridLicenceProprietaire(GridView gridView, string param, string paramLike, string valueLike, string numProprietaire) { #region declaration IntfDalLicence serviceLicence = new ImplDalLicence(); #endregion #region implementation this.strCommande = "SELECT licence.numLicence, licence.numerosLicence, licence.zone, licence.numCooperative,"; this.strCommande += " licence.numVehicule, licence.datePremiereMiseCiculation, licence.datePremiereExploitation,"; this.strCommande += " licence.valideAu, licence.valideDu, licence.nombrePlacePayante, licence.isProvisoire,"; this.strCommande += " vehicule.numVehicule, vehicule.numParamVehicule, vehicule.sourceEnergie,"; this.strCommande += " vehicule.numProprietaire, vehicule.matriculeVehicule, vehicule.marqueVehicule,"; this.strCommande += " vehicule.typeVehicule, vehicule.numSerieVehicule, vehicule.numMoteurVehicule,"; this.strCommande += " vehicule.puissanceVehicule, vehicule.couleurVehicule, vehicule.placesAssiseVehicule,"; this.strCommande += " vehicule.nombreColoneVehicule, vehicule.poidsTotalVehicule, vehicule.poidsVideVehicule,"; this.strCommande += " vehicule.imageVehicule FROM licence"; this.strCommande += " Inner Join vehicule ON vehicule.numVehicule = licence.numVehicule"; this.strCommande += " WHERE vehicule.numProprietaire = '" + numProprietaire + "' AND"; this.strCommande += " (" + paramLike + " LIKE '%" + valueLike + "%')"; this.strCommande += " ORDER BY " + param + " ASC"; gridView.DataSource = serviceLicence.getDataTableLicenceProprietaire(this.strCommande); gridView.DataBind(); #endregion }
void IntfDalLicence.insertToGridLicenceUSAvecPropriete(GridView gridView, string param, string paramLike, string valueLike) { #region declaration IntfDalLicence serviceLicence = new ImplDalLicence(); #endregion #region implementation this.strCommande = "SELECT licence.numerosLicence, licence.numLicence, cooperative.nomCooperative,"; this.strCommande += " vehicule.matriculeVehicule, vehicule.marqueVehicule, vehicule.couleurVehicule, Individu.adresse As adresseInd,"; this.strCommande += " Individu.nomIndividu, Individu.prenomIndividu, organisme.nomResponsable AS nomRespOrg,"; this.strCommande += " Individu.telephoneFixeIndividu, Individu.telephoneMobileIndividu, organisme.adresseOrganisme,"; this.strCommande += " organisme.telephoneFixeOrganisme, organisme.telephoneMobileOrganisme,"; this.strCommande += " organisme.telephoneFixeResponsable, organisme.telephoneMobileResponsable,"; this.strCommande += " societe.adresseSociete, societe.telephoneFixeSociete, societe.telephoneMobileSociete,"; this.strCommande += " societe.telephoneFixeResponsable, societe.telephoneMobileResponsable,"; this.strCommande += " organisme.prenomResponsable AS prenomRespOrg, organisme.nomOrganisme, societe.nomSociete,"; this.strCommande += " societe.nomResponsable As nomRespSoc, societe.prenomResponsable As prenomRespSoc FROM licence"; this.strCommande += " Left Join cooperative ON cooperative.numCooperative = licence.numCooperative"; this.strCommande += " Inner Join vehicule ON vehicule.numVehicule = licence.numVehicule"; this.strCommande += " Inner Join proprietaire ON proprietaire.numProprietaire = vehicule.numProprietaire"; this.strCommande += " Left Join Individu ON Individu.numIndividu = proprietaire.numIndividu"; this.strCommande += " Left Join organisme ON organisme.numOrganisme = proprietaire.numOrganisme"; this.strCommande += " Left Join societe ON societe.numSociete = proprietaire.numSociete"; this.strCommande += " WHERE (" + paramLike + " LIKE '%" + valueLike + "%') AND"; this.strCommande += " (licence.zone = 'Urbaine' OR licence.zone = 'Suburbaine')"; this.strCommande += " ORDER BY " + param + " ASC"; gridView.DataSource = serviceLicence.getDataTableLicenceUSAvecPropriete(this.strCommande); gridView.DataBind(); #endregion }
void IntfDalLicence.insertToGridLicenceUS(GridView gridView, string param, string paramLike, string valueLike) { #region declaration IntfDalLicence serviceLicence = new ImplDalLicence(); #endregion #region implementation this.strCommande = "SELECT vehicule.numVehicule, vehicule.numParamVehicule,"; this.strCommande += " vehicule.sourceEnergie, vehicule.numProprietaire, vehicule.matriculeVehicule,"; this.strCommande += " vehicule.marqueVehicule, vehicule.typeVehicule, vehicule.numSerieVehicule,"; this.strCommande += " vehicule.numMoteurVehicule, vehicule.puissanceVehicule,"; this.strCommande += " vehicule.couleurVehicule, vehicule.placesAssiseVehicule,"; this.strCommande += " vehicule.nombreColoneVehicule, vehicule.poidsTotalVehicule,"; this.strCommande += " vehicule.poidsVideVehicule, vehicule.imageVehicule, licence.numLicence,"; this.strCommande += " licence.numerosLicence, licence.zone FROM licence"; this.strCommande += " Inner Join vehicule ON vehicule.numVehicule = licence.numVehicule"; this.strCommande += " WHERE (" + paramLike + " LIKE '%" + valueLike + "%') AND"; this.strCommande += " (licence.zone = 'Urbaine' OR licence.zone = 'Suburbaine')"; this.strCommande += " ORDER BY " + param + " ASC"; gridView.DataSource = serviceLicence.getDataTableLicenceUS(this.strCommande); gridView.DataBind(); #endregion }
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); }
crlVerification IntfDalVerification.selectVerification(string idVerification) { #region declaration IntfDalLicence serviceLicence = new ImplDalLicence(); IntfDalAgent serviceAgent = new ImplDalAgent(); IntfDalChauffeur serviceChauffeur = new ImplDalChauffeur(); IntfDalItineraire serviceItineraire = new ImplDalItineraire(); crlVerification verification = null; #endregion #region implementation if (idVerification != "") { this.strCommande = "SELECT * FROM `verification` WHERE (`idVerification`='" + idVerification + "')"; this.serviceConnectBase.openConnection(); reader = this.serviceConnectBase.select(this.strCommande); if (reader != null) { if (reader.HasRows) { if (reader.Read()) { verification = new crlVerification(); verification.AVoireVP = reader["aVoireVP"].ToString(); verification.AVoireVT = reader["aVoireVT"].ToString(); verification.IdItineraire = reader["idItineraire"].ToString(); try { verification.DateVerification = Convert.ToDateTime(reader["dateVerification"].ToString()); } catch (Exception) { } verification.IdChauffeur = reader["idChauffeur"].ToString(); verification.IdVerification = reader["idVerification"].ToString(); verification.MatriculeAgent = reader["matriculeAgent"].ToString(); verification.NumLicence = reader["numLicence"].ToString(); verification.ObservationProfessionnelle = reader["observationProfessionnelle"].ToString(); verification.VerificationPapier = int.Parse(reader["verificationPapier"].ToString()); verification.VerificationTechnique = int.Parse(reader["verificationTechnique"].ToString()); verification.PlanDepart = int.Parse(reader["planDepart"].ToString()); } } reader.Dispose(); } this.serviceConnectBase.closeConnection(); if (verification != null) { verification.Licence = serviceLicence.selectLicence(verification.NumLicence); verification.Agent = serviceAgent.selectAgent(verification.MatriculeAgent); verification.Chauffeur = serviceChauffeur.selectChauffeur(verification.IdChauffeur); verification.Itineraire = serviceItineraire.selectItineraire(verification.IdItineraire); } } #endregion return(verification); }
DataTable IntfDalLicence.getDataTableLicenceUSAvecPropriete(string strRqst) { #region declaration DataTable dataTable = new DataTable(); IntfDalVille serviceVille = new ImplDalVille(); IntfDalLicence serviceLicence = new ImplDalLicence(); crlLicence licence = null; #endregion #region implementation #region initialisation du dataTable dataTable = new DataTable(); dataTable.Columns.Add("numLicence", typeof(string)); dataTable.Columns.Add("vehicule", typeof(string)); dataTable.Columns.Add("cooperative", typeof(string)); dataTable.Columns.Add("individu", typeof(string)); dataTable.Columns.Add("adresseIndividu", typeof(string)); dataTable.Columns.Add("contactIndividu", typeof(string)); dataTable.Columns.Add("responsable", typeof(string)); dataTable.Columns.Add("contactResponsable", typeof(string)); DataRow dr; #endregion this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(strRqst); if (this.reader != null) { if (this.reader.HasRows) { while (this.reader.Read()) { dr = dataTable.NewRow(); dr["numLicence"] = reader["numLicence"].ToString(); dr["vehicule"] = reader["matriculeVehicule"].ToString() + " " + this.reader["couleurVehicule"].ToString() + " " + this.reader["marqueVehicule"].ToString(); dr["cooperative"] = this.reader["nomCooperative"].ToString(); dr["individu"] = reader["nomIndividu"].ToString() + " " + reader["prenomIndividu"].ToString() + reader["nomSociete"].ToString() + reader["nomOrganisme"].ToString(); dr["adresseIndividu"] = reader["adresseInd"].ToString(); dr["contactIndividu"] = reader["telephoneFixeIndividu"].ToString() + " " + reader["telephoneMobileIndividu"].ToString() + reader["telephoneFixeSociete"].ToString() + " " + reader["telephoneMobileSociete"].ToString() + reader["telephoneFixeOrganisme"].ToString() + " " + reader["telephoneMobileOrganisme"].ToString(); dr["responsable"] = reader["nomRespSoc"].ToString() + " " + reader["prenomRespSoc"].ToString() + reader["nomRespOrg"].ToString() + " " + reader["prenomRespOrg"].ToString(); dr["contactResponsable"] = reader["telephoneFixeResponsable"].ToString() + " " + reader["telephoneMobileResponsable"].ToString() + reader["telephoneFixeResponsable"].ToString() + " " + reader["telephoneMobileResponsable"].ToString(); dataTable.Rows.Add(dr); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); #endregion return(dataTable); }
crlVoiture IntfDalVoiture.selectVoiture(string numVehicule) { #region declaration IntfDalLicence serviceLicence = new ImplDalLicence(); crlVoiture voiture = null; #endregion #region implementation if (numVehicule != "") { this.strCommande = "SELECT * FROM `voiture` WHERE (`numVehicule`='" + numVehicule + "')"; this.serviceConnectBase.openConnection(); reader = this.serviceConnectBase.select(this.strCommande); if (reader != null) { if (reader.HasRows) { if (reader.Read()) { voiture = new crlVoiture(); voiture.Couleur = reader["couleur"].ToString(); voiture.Marque = reader["marque"].ToString(); voiture.NumImmatricule = reader["numImmatricule"].ToString(); voiture.NumLicence = reader["numLicence"].ToString(); voiture.NumVehicule = reader["numVehicule"].ToString(); try { voiture.Colone = int.Parse(reader["colone"].ToString()); voiture.NombrePlace = int.Parse(reader["nombrePlace"].ToString()); } catch (Exception) { } voiture.Type = reader["type"].ToString(); } } reader.Dispose(); } this.serviceConnectBase.closeConnection(); if (voiture != null) { if (voiture.NumLicence != "") { voiture.Licence = serviceLicence.selectLicence(voiture.NumLicence); } } } #endregion return(voiture); }
DataTable IntfDalLicence.getDataTableLicenceUS(string strRqst) { #region declaration DataTable dataTable = new DataTable(); IntfDalVille serviceVille = new ImplDalVille(); IntfDalLicence serviceLicence = new ImplDalLicence(); crlLicence licence = null; #endregion #region implementation #region initialisation du dataTable dataTable = new DataTable(); dataTable.Columns.Add("numLicence", typeof(string)); dataTable.Columns.Add("vehicule", typeof(string)); dataTable.Columns.Add("zone", typeof(string)); dataTable.Columns.Add("nbPlace", typeof(string)); dataTable.Columns.Add("numerosLicence", typeof(string)); DataRow dr; #endregion this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(strRqst); if (this.reader != null) { if (this.reader.HasRows) { while (this.reader.Read()) { dr = dataTable.NewRow(); dr["numLicence"] = reader["numLicence"].ToString(); dr["vehicule"] = reader["matriculeVehicule"].ToString() + " " + this.reader["couleurVehicule"].ToString() + " " + this.reader["marqueVehicule"].ToString(); dr["zone"] = this.reader["zone"].ToString(); dr["nbPlace"] = reader["placesAssiseVehicule"].ToString(); dr["numerosLicence"] = reader["numerosLicence"].ToString(); dataTable.Rows.Add(dr); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); #endregion return(dataTable); }
void IntfDalLicence.insertToGridLicence(GridView gridView, string param, string paramLike, string valueLike) { #region declaration IntfDalLicence serviceLicence = new ImplDalLicence(); #endregion #region implementation this.strCommande = "SELECT licence.zone, licence.numerosLicence, licence.valideAu, vehicule.matriculeVehicule,"; this.strCommande += " licence.numLicence, licence.nombrePlacePayante FROM licence"; this.strCommande += " Inner Join vehicule ON vehicule.numVehicule = licence.numVehicule"; this.strCommande += " WHERE (" + paramLike + " LIKE '%" + valueLike + "%')"; this.strCommande += " ORDER BY " + param + " ASC"; gridView.DataSource = serviceLicence.getDataTableLicence(this.strCommande); gridView.DataBind(); #endregion }
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); }
DataTable IntfDalLicence.getDataTableLicence(string strRqst) { #region declaration DataTable dataTable = new DataTable(); IntfDalVille serviceVille = new ImplDalVille(); IntfDalLicence serviceLicence = new ImplDalLicence(); crlLicence licence = null; #endregion #region implementation #region initialisation du dataTable dataTable = new DataTable(); dataTable.Columns.Add("numLicence", typeof(string)); dataTable.Columns.Add("matriculeVehicule", typeof(string)); dataTable.Columns.Add("zone", typeof(string)); dataTable.Columns.Add("valideAu", typeof(DateTime)); dataTable.Columns.Add("nombrePlacePayante", typeof(string)); dataTable.Columns.Add("itineraire1", typeof(string)); dataTable.Columns.Add("itineraire2", typeof(string)); DataRow dr; #endregion this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(strRqst); if (this.reader != null) { if (this.reader.HasRows) { while (this.reader.Read()) { dr = dataTable.NewRow(); licence = serviceLicence.selectLicence(reader["numLicence"].ToString()); dr["numLicence"] = reader["numLicence"].ToString(); dr["matriculeVehicule"] = reader["matriculeVehicule"].ToString(); dr["zone"] = reader["zone"].ToString(); try { dr["valideAu"] = Convert.ToDateTime(reader["valideAu"].ToString()); } catch (Exception) { } dr["nombrePlacePayante"] = reader["nombrePlacePayante"].ToString(); if (licence != null) { if (licence.itineraires != null) { if (licence.itineraires.Count > 0) { if (licence.itineraires != null) { dr["itineraire1"] = licence.itineraires[0].villeD.NomVille + "-" + licence.itineraires[0].villeF.NomVille; } else { dr["itineraire1"] = ""; } } else { dr["itineraire1"] = ""; } if (licence.itineraires.Count > 1) { if (licence.itineraires != null) { dr["itineraire2"] = licence.itineraires[1].villeD.NomVille + "-" + licence.itineraires[1].villeF.NomVille; } else { dr["itineraire2"] = ""; } } else { dr["itineraire2"] = ""; } } else { dr["itineraire1"] = ""; dr["itineraire2"] = ""; } } dataTable.Rows.Add(dr); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); #endregion return(dataTable); }
crlLicence IntfDalLicence.selectLicence(string numLicence) { #region declaration IntfDalLicence serviceLicence = new ImplDalLicence(); List <crlItineraire> Itineraires = null; crlLicence Licence = null; IntfDalCooperative serviceCooperative = new ImplDalCooperative(); IntfDalZone serviceZone = new ImplDalZone(); IntfDalVehicule serviceVehicule = new ImplDalVehicule(); #endregion #region implementation if (numLicence != "") { Itineraires = serviceLicence.selectItineraire(numLicence); this.strCommande = "SELECT * FROM licence WHERE (licence.numLicence = '" + numLicence + "')"; this.serviceConnectBase.openConnection(); reader = this.serviceConnectBase.select(this.strCommande); if (reader != null) { if (reader.HasRows) { if (reader.Read()) { Licence = new crlLicence(); Licence.NumLicence = reader["numLicence"].ToString(); Licence.NumerosLicence = reader["numerosLicence"].ToString(); Licence.Zone = reader["zone"].ToString(); Licence.NumCooperative = reader["numCooperative"].ToString(); Licence.NumVehicule = reader["numVehicule"].ToString(); try { Licence.DatePremiereMiseCiculation = Convert.ToDateTime(reader["datePremiereMiseCiculation"].ToString()); } catch (Exception) { } try { Licence.DatePremiereExploitation = Convert.ToDateTime(reader["datePremiereExploitation"].ToString()); } catch (Exception) { } try { Licence.ValideAu = Convert.ToDateTime(reader["valideAu"].ToString()); } catch (Exception) { } try { Licence.ValideDu = Convert.ToDateTime(reader["valideDu"].ToString()); } catch (Exception) { } try { Licence.NombrePlacePayante = int.Parse(reader["nombrePlacePayante"].ToString()); } catch (Exception) { } try { Licence.IsProvisoire = int.Parse(reader["isProvisoire"].ToString()); } catch (Exception) { } } } reader.Dispose(); } this.serviceConnectBase.closeConnection(); if (Licence != null) { if (Licence.Zone != "") { Licence.zoneObj = serviceZone.selectZone(Licence.Zone); } if (Licence.NumCooperative != "") { Licence.cooperative = serviceCooperative.selectCooperative(Licence.NumCooperative); } if (Licence.NumVehicule != "") { Licence.vehicule = serviceVehicule.selectVehicule(Licence.NumVehicule); } Licence.itineraires = serviceLicence.selectItineraire(Licence.NumLicence); } } #endregion return(Licence); }