bool IntfAutorisationVoyage.deleteAutorisationVoyage(crlAutorisationVoyage AutorisationVoyage) { #region declaration bool isDelete = false; int nombreDelete = 0; #endregion #region implementation if (AutorisationVoyage != null) { if (AutorisationVoyage.NumerosAV != "") { this.strCommande = "DELETE FROM `autorisationvoyage` WHERE (`numerosAV` = '" + AutorisationVoyage.NumerosAV + "')"; this.serviceConnectBase.openConnection(); nombreDelete = this.serviceConnectBase.requete(this.strCommande); if (nombreDelete == 1) { isDelete = true; } this.serviceConnectBase.closeConnection(); } } #endregion return(isDelete); }
string IntfAutorisationVoyage.insertAutorisationVoyage(crlAutorisationVoyage AutorisationVoyage) { #region declaration int nombreInsertion = 0; string numerosAV = ""; IntfAutorisationVoyage serviceAutorisationVoyage = new ImplAutorisationVoyage(); #endregion #region implementation if (AutorisationVoyage != null) { AutorisationVoyage.NumerosAV = serviceAutorisationVoyage.getNumerosAV(AutorisationVoyage.Agent.agence.SigleAgence); this.strCommande = "INSERT INTO `autorisationvoyage` (`numerosAV`,`idVerification`,"; this.strCommande += " `matriculeAgent`,`datePrevueDepart`) "; this.strCommande += " VALUES ('" + AutorisationVoyage.NumerosAV + "','" + AutorisationVoyage.IdVerification + "'"; this.strCommande += " ,'" + AutorisationVoyage.MatriculeAgent + "','" + AutorisationVoyage.DatePrevueDepart.ToString("yyyy-MM-dd") + "')"; this.serviceConnectBase.openConnection(); nombreInsertion = this.serviceConnectBase.requete(this.strCommande); if (nombreInsertion == 1) { numerosAV = AutorisationVoyage.NumerosAV; } this.serviceConnectBase.closeConnection(); } #endregion return(numerosAV); }
bool IntfAutorisationVoyage.updateAutorisationVoyage(crlAutorisationVoyage AutorisationVoyage) { #region declaration bool isUpdate = false; int nombreUpdate = 0; #endregion #region implementation if (AutorisationVoyage != null) { if (AutorisationVoyage.NumerosAV != "") { this.strCommande = "UPDATE `autorisationvoyage` SET "; this.strCommande += " `idVerification`='" + AutorisationVoyage.IdVerification + "',"; this.strCommande += " `matriculeAgent`='" + AutorisationVoyage.MatriculeAgent + "',"; this.strCommande += " `datePrevueDepart`='" + AutorisationVoyage.DatePrevueDepart.ToString("yyyy-MM-dd") + "'"; this.strCommande += " WHERE (`numerosAV`='" + AutorisationVoyage.NumerosAV + "')"; this.serviceConnectBase.openConnection(); nombreUpdate = this.serviceConnectBase.requete(this.strCommande); if (nombreUpdate == 1) { isUpdate = true; } this.serviceConnectBase.closeConnection(); } } #endregion return(isUpdate); }
private void afficheAutorisationVoyage(string numerosAV) { #region implementation autorisationVoyage = serviceAutorisationVoyage.selectAutorisationVoyage(numerosAV); if (autorisationVoyage != null) { hfNumerosAV.Value = autorisationVoyage.NumerosAV; TextNomAgentTechnique.Text = autorisationVoyage.Agent.nomAgent; TextPrenomAT.Text = autorisationVoyage.Agent.prenomAgent; TextNomAgentVerificateur.Text = autorisationVoyage.Verification.Agent.nomAgent; TextPrenomAV.Text = autorisationVoyage.Verification.Agent.prenomAgent; TextNomChauffeur.Text = autorisationVoyage.Verification.Chauffeur.nomChauffeur; TextPrenomChauffeur.Text = autorisationVoyage.Verification.Chauffeur.prenomChauffeur; TextMatriculVoiture.Text = autorisationVoyage.Verification.Licence.vehicule.MatriculeVehicule; TextItineraire.Text = autorisationVoyage.Verification.Itineraire.villeD.NomVille + "-" + autorisationVoyage.Verification.Itineraire.villeF.NomVille; TextDatePrevueDepart.Text = autorisationVoyage.DatePrevueDepart.ToString("dd MMMM yyyy"); Image_Vehicule.ImageUrl = ConfigurationManager.AppSettings["urlImageVehicule"] + autorisationVoyage.Verification.Licence.vehicule.ImageVehicule; } else { this.divIndicationText(ReRealiseFB.affichageAutorisationNonOk, "red"); } #endregion }
crlAutorisationVoyage IntfAutorisationVoyage.selectAutorisationVoyage(string numerosAV) { #region declaration IntfDalAgent serviceAgent = new ImplDalAgent(); IntfDalVerification serviceVerification = new ImplDalVerification(); crlAutorisationVoyage AutorisationVoyage = null; #endregion #region implementation if (numerosAV != "") { this.strCommande = "SELECT * FROM `autorisationvoyage` WHERE (`numerosAV`='" + numerosAV + "')"; this.serviceConnectBase.openConnection(); reader = this.serviceConnectBase.select(this.strCommande); if (reader != null) { if (reader.HasRows) { if (reader.Read()) { AutorisationVoyage = new crlAutorisationVoyage(); AutorisationVoyage.NumerosAV = reader["numerosAV"].ToString(); AutorisationVoyage.MatriculeAgent = reader["matriculeAgent"].ToString(); AutorisationVoyage.IdVerification = reader["idVerification"].ToString(); AutorisationVoyage.DatePrevueDepart = Convert.ToDateTime(reader["datePrevueDepart"].ToString()); } } reader.Dispose(); } this.serviceConnectBase.closeConnection(); if (AutorisationVoyage != null) { AutorisationVoyage.Verification = serviceVerification.selectVerification(AutorisationVoyage.IdVerification); AutorisationVoyage.Agent = serviceAgent.selectAgent(AutorisationVoyage.MatriculeAgent); } } #endregion return(AutorisationVoyage); }
int IntfAutorisationVoyage.isAutorisationVoyage(crlAutorisationVoyage AutorisationVoyage) { throw new NotImplementedException(); }