void IntfDalCooperative.insertToGridCooperative(GridView gridView, string param, string paramLike, string valueLike) { #region declaration IntfDalCooperative serviceCooperative = new ImplDalCooperative(); #endregion #region implementation this.strCommande = "SELECT cooperative.numCooperative, cooperative.nomCooperative,"; this.strCommande += " cooperative.sigleCooperative,cooperative.adresseCooperative,"; this.strCommande += " cooperative.zone, cooperative.prenomResponsable,"; this.strCommande += " cooperative.nomResponsable FROM cooperative"; this.strCommande += " WHERE " + paramLike + " LIKE '%" + valueLike + "%'"; this.strCommande += " ORDER BY " + param; gridView.DataSource = serviceCooperative.getDataTableCooperative(this.strCommande); gridView.DataBind(); #endregion }
string IntfDalCooperative.insertCooperative(crlCooperative cooperative, string sigleAgence) { #region decalration string numCooperative = ""; int nombreInsert = 0; IntfDalCooperative serviceCooperative = new ImplDalCooperative(); #endregion #region implementation if (cooperative != null && sigleAgence != "") { cooperative.NumCooperative = serviceCooperative.getNumCooperative(sigleAgence); this.strCommande = "INSERT INTO `cooperative` (`numCooperative`, `nomCooperative`,"; this.strCommande += " `sigleCooperative`,`adresseCooperative`, `zone`,`telephoneFixeCooperative`,"; this.strCommande += " `telephoneMobileCooperative`,`numVille`,`nomResponsable`,`prenomResponsable`,"; this.strCommande += " `cinResponsable`,`adressseResponsable`,`telephoneFixeResponsable`,"; this.strCommande += " `telephoneMobileResponsable`) VALUES"; this.strCommande += " ('" + cooperative.NumCooperative + "','" + cooperative.NomCooperative + "',"; this.strCommande += " '" + cooperative.SigleCooperative + "','" + cooperative.AdresseCooperative + "',"; this.strCommande += " '" + cooperative.Zone + "','" + cooperative.TelephoneFixeCooperative + "',"; this.strCommande += " '" + cooperative.TelephoneMobileCooperative + "','" + cooperative.NumVille + "',"; this.strCommande += " '" + cooperative.NomResponsable + "','" + cooperative.PrenomResponsable + "',"; this.strCommande += " '" + cooperative.CinResponsable + "','" + cooperative.AdressseResponsable + "',"; this.strCommande += " '" + cooperative.TelephoneFixeResponsable + "','" + cooperative.TelephoneMobileResponsable + "')"; this.serviceConnection.openConnection(); nombreInsert = this.serviceConnection.requete(this.strCommande); if (nombreInsert == 1) { numCooperative = cooperative.NumCooperative; } this.serviceConnection.closeConnection(); } #endregion return(numCooperative); }
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); }