private void afficheVehicule(string numVehicule) { #region declaration crlVehicule vehicule = null; #endregion #region implementation if (numVehicule != "") { vehicule = serviceVehicule.selectVehicule(numVehicule); if (vehicule != null) { LabelCouleur.Text = vehicule.CouleurVehicule; LabelMarque.Text = vehicule.MarqueVehicule; LabelMatricule.Text = vehicule.MatriculeVehicule; LabelSerie.Text = vehicule.NumSerieVehicule; LabelSouceEnergie.Text = vehicule.SourceEnergie; LabelType.Text = vehicule.TypeVehicule; hfNumVehicule.Value = vehicule.NumVehicule; Image_Vehicule.ImageUrl = ConfigurationManager.AppSettings["urlImageVehicule"] + vehicule.ImageVehicule; LabelVehiculeObservation.Text = vehicule.MatriculeVehicule + " " + vehicule.MarqueVehicule + " " + vehicule.CouleurVehicule; this.initialiseGridObservationVehicule(); this.initialiseFormulaireObs(); } } #endregion }
string IntfDalVehicule.isVehicule(crlVehicule vehicule) { #region declaration string numVehicule = ""; #endregion #region implementation if (vehicule != null) { this.strCommande = "SELECT * FROM `vehicule` WHERE"; this.strCommande += " `matriculeVehicule`='" + vehicule.MatriculeVehicule + "' AND"; this.strCommande += " `numVehicule`<>'" + vehicule.NumVehicule + "'"; this.serviceConnection.openConnection(); this.reader = this.serviceConnection.select(this.strCommande); if (this.reader != null) { if (this.reader.HasRows) { if (this.reader.Read()) { numVehicule = this.reader["numVehicule"].ToString(); } } this.reader.Dispose(); } this.serviceConnection.closeConnection(); } #endregion return(numVehicule); }
protected void btnModifier_Click(object sender, EventArgs e) { #region declaration crlObservationVehicule observationVehicule = null; crlVehicule vehicule = null; string strIndicationText = ""; #endregion #region implementation if (hfObservationVehicule.Value != "") { observationVehicule = serviceObservationVehicule.selectObservationVehicule(hfObservationVehicule.Value); if (observationVehicule != null) { if (hfNumVehicule.Value != "") { this.insertToObjObservationVehicule(observationVehicule); if (serviceObservationVehicule.updateObservationVehicule(observationVehicule)) { this.initialiseGridObservationVehicule(); this.initialiseGridListeNoireVehicule(); this.initialiseFormulaireObs(); vehicule = serviceVehicule.selectVehicule(observationVehicule.NumVehicule); strIndicationText = "Observation bien modifier!"; if (vehicule != null) { strIndicationText += " VĂ©hicule: " + vehicule.MatriculeVehicule + " " + vehicule.MarqueVehicule + " " + vehicule.CouleurVehicule; } this.divIndicationText(strIndicationText, "Black"); } else { strIndicationText = "Une erreur ce produit durant la modification!"; this.divIndicationText(strIndicationText, "Red"); } } else { // } } else { // } } else { // } #endregion }
string IntfDalVehicule.insertVehicule(crlVehicule vehicule, string sigleAgence) { #region declaration string numVehicule = ""; string numParamVehicule = "NULL"; IntfDalVehicule serviceVehicule = new ImplDalVehicule(); int nombreInsert = 0; #endregion #region implementation if (vehicule != null) { if (vehicule.NumParamVehicule != "") { numParamVehicule = "'" + vehicule.NumParamVehicule + "'"; } if (sigleAgence != "") { vehicule.NumVehicule = serviceVehicule.getNumVehicule(sigleAgence); this.strCommande = "INSERT INTO `vehicule` (`numVehicule`,`numParamVehicule`,`sourceEnergie`,"; this.strCommande += " `numProprietaire`,`matriculeVehicule`,`marqueVehicule`,`typeVehicule`,"; this.strCommande += " `numSerieVehicule`,`numMoteurVehicule`,`puissanceVehicule`,`couleurVehicule`,"; this.strCommande += " `placesAssiseVehicule`,`nombreColoneVehicule`,`poidsTotalVehicule`,`poidsVideVehicule`,"; this.strCommande += " `imageVehicule`) VALUES ('" + vehicule.NumVehicule + "', " + numParamVehicule + ","; this.strCommande += " '" + vehicule.SourceEnergie + "','" + vehicule.NumProprietaire + "',"; this.strCommande += " '" + vehicule.MatriculeVehicule.ToUpper() + "','" + vehicule.MarqueVehicule + "','" + vehicule.TypeVehicule + "',"; this.strCommande += " '" + vehicule.NumSerieVehicule + "','" + vehicule.NumMoteurVehicule + "',"; this.strCommande += " '" + vehicule.PuissanceVehicule + "','" + vehicule.CouleurVehicule + "','" + vehicule.PlacesAssiseVehicule + "',"; this.strCommande += " '" + vehicule.NombreColoneVehicule + "','" + vehicule.PoidsTotalVehicule + "',"; this.strCommande += " '" + vehicule.PoidsVideVehicule + "','" + vehicule.ImageVehicule + "')"; this.serviceConnection.openConnection(); nombreInsert = this.serviceConnection.requete(this.strCommande); if (nombreInsert == 1) { numVehicule = vehicule.NumVehicule; } this.serviceConnection.closeConnection(); } } #endregion return(numVehicule); }
private void afficheObservation(string numObservation) { #region declaration crlObservationVehicule observation = null; crlVehicule vehicule = null; string strConfirm = ""; #endregion #region implementation if (numObservation != "") { observation = serviceObservationVehicule.selectObservationVehicule(numObservation); if (observation != null) { this.afficheVehicule(observation.NumVehicule); TextObservation.Text = observation.TextObesvationVehicule; rbAvertissement.SelectedValue = observation.IsListeNoire.ToString(); hfObservationVehicule.Value = observation.NumObservationVehicule; vehicule = serviceVehicule.selectVehicule(observation.NumVehicule); btnModifier.Enabled = true; btnValider.Enabled = false; strConfirm = "Voulez vous vraiment modifier l'observation?\n"; if (vehicule != null) { strConfirm += "VĂ©hicule: " + vehicule.MatriculeVehicule + " " + vehicule.MarqueVehicule + " " + vehicule.CouleurVehicule + "\n"; strConfirm += "Date: " + observation.DateObservation.ToString("dd MMMM yyyy"); } ConfirmButtonExtender_btnModifier.ConfirmText = strConfirm; } } #endregion }
bool IntfDalVehicule.upDateVehicule(crlVehicule vehicule) { #region declaration bool isUpdate = false; string numParamVehicule = "NULL"; int nombreUpdate = 0; #endregion #region implementation if (vehicule != null) { if (vehicule.NumParamVehicule != "") { numParamVehicule = "'" + vehicule.NumParamVehicule + "'"; } this.strCommande = "UPDATE `vehicule` SET `couleurVehicule`='" + vehicule.CouleurVehicule + "',"; this.strCommande += " `imageVehicule`='" + vehicule.ImageVehicule + "', `marqueVehicule`='" + vehicule.MarqueVehicule + "',"; this.strCommande += " `matriculeVehicule`='" + vehicule.MatriculeVehicule + "',`nombreColoneVehicule`='" + vehicule.NombreColoneVehicule + "',"; this.strCommande += " `numMoteurVehicule`='" + vehicule.NumMoteurVehicule + "',`numParamVehicule`=" + numParamVehicule + ","; this.strCommande += " `numProprietaire`='" + vehicule.NumProprietaire + "',`numSerieVehicule`='" + vehicule.NumSerieVehicule + "',"; this.strCommande += " `placesAssiseVehicule`='" + vehicule.PlacesAssiseVehicule + "',`poidsTotalVehicule`='" + vehicule.PoidsTotalVehicule + "',"; this.strCommande += " `poidsVideVehicule`='" + vehicule.PoidsVideVehicule + "',`puissanceVehicule`='" + vehicule.PuissanceVehicule + "',"; this.strCommande += " `sourceEnergie`='" + vehicule.SourceEnergie + "',`typeVehicule`='" + vehicule.TypeVehicule + "'"; this.strCommande += " WHERE `numVehicule`='" + vehicule.NumVehicule + "'"; this.serviceConnection.openConnection(); nombreUpdate = this.serviceConnection.requete(this.strCommande); if (nombreUpdate == 1) { isUpdate = true; } this.serviceConnection.closeConnection(); } #endregion return(isUpdate); }
private void afficheVehicule(string numVehicule) { #region declaration crlVehicule vehicule = null; convertisseuse = new Convertisseuse(); #endregion #region implementation if (numVehicule != "") { vehicule = serviceVehicule.selectVehicule(numVehicule); if (vehicule != null) { LabelMatricule.Text = vehicule.MatriculeVehicule; LabelMarque.Text = vehicule.MarqueVehicule; LabelCouleur.Text = vehicule.CouleurVehicule; hfNumVehicule.Value = vehicule.NumVehicule; if (vehicule.proprietaire != null) { if (vehicule.proprietaire.Individu != null) { LabelNomIndividu.Text = vehicule.proprietaire.Individu.NomIndividu; LabelPrenomIndividu.Text = vehicule.proprietaire.Individu.PrenomIndividu; LabelCINIndividu.Text = vehicule.proprietaire.Individu.CinIndividu; LabelFixeIndividu.Text = vehicule.proprietaire.Individu.TelephoneFixeIndividu; LabelMobileIndividu.Text = vehicule.proprietaire.Individu.TelephoneMobileIndividu; Panel_Individu.Visible = true; } else { Panel_Individu.Visible = false; } if (vehicule.proprietaire.societe != null) { LabelSociete.Text = vehicule.proprietaire.societe.NomSociete; LabelFixeSociete.Text = vehicule.proprietaire.societe.TelephoneFixeSociete; LabelMobileSociete.Text = vehicule.proprietaire.societe.TelephoneMobileSociete; if (vehicule.proprietaire.societe.individuResponsable != null) { LabelNomRespSociete.Text = vehicule.proprietaire.societe.individuResponsable.NomIndividu; LabelPrenomRespSociete.Text = vehicule.proprietaire.societe.individuResponsable.PrenomIndividu; LabelFixeRespSociete.Text = vehicule.proprietaire.societe.individuResponsable.TelephoneFixeIndividu; LabelMobileRespSociete.Text = vehicule.proprietaire.societe.individuResponsable.TelephoneMobileIndividu; } Panel_Societe.Visible = true; } else { Panel_Societe.Visible = false; } if (vehicule.proprietaire.organisme != null) { LabelOrganisme.Text = vehicule.proprietaire.organisme.NomOrganisme; LabelFixeOrganisme.Text = vehicule.proprietaire.organisme.TelephoneFixeOrganisme; LabelMobileOrganisme.Text = vehicule.proprietaire.organisme.TelephoneMobileOrganisme; if (vehicule.proprietaire.organisme.individuResponsable != null) { LabelNomRespOrganisme.Text = vehicule.proprietaire.organisme.individuResponsable.NomIndividu; LabelPrenomRespOrganisme.Text = vehicule.proprietaire.organisme.individuResponsable.PrenomIndividu; LabelFixeRespOrganisme.Text = vehicule.proprietaire.organisme.individuResponsable.TelephoneFixeIndividu; LabelMobileRespOrganisme.Text = vehicule.proprietaire.organisme.individuResponsable.TelephoneMobileIndividu; } Panel_Organisme.Visible = true; } else { Panel_Organisme.Visible = false; } this.initialiseGridListeVoyage(); this.initialiseGridListeRecu(); LabTotalRecettes.Text = serviceGeneral.separateurDesMilles(serviceVehicule.getTotalRecette(vehicule.NumVehicule).ToString("0")) + "Ar"; LabTotalReste.Text = serviceGeneral.separateurDesMilles(serviceVehicule.getTotalReste(vehicule.NumVehicule).ToString("0")) + "Ar"; LabTotalMontantRecu.Text = serviceGeneral.separateurDesMilles(serviceVehicule.getTotalRecu(vehicule.NumVehicule).ToString("0")) + "Ar"; LabMontantTotalFacture.Text = serviceGeneral.separateurDesMilles(serviceVehicule.getTotalReste(vehicule.NumVehicule).ToString("0")) + "Ar"; LabMontantTotalFactutreLettre.Text = convertisseuse.convertion(serviceVehicule.getTotalReste(vehicule.NumVehicule).ToString("0")) + " Ariary"; } } } #endregion }
crlVehicule IntfDalVehicule.selectVehicule(string numVehicule) { #region declaration crlVehicule vehicule = null; IntfDalProprietaire serviceProprietaire = new ImplDalProprietaire(); IntfDalSourceEnergie serviceSourceEnergie = new ImplDalSourceEnergie(); IntfDalParamVehicule serviceParamVehicule = new ImplDalParamVehicule(); #endregion #region implementation if (numVehicule != "") { this.strCommande = "SELECT * FROM `vehicule` WHERE (`numVehicule`='" + numVehicule + "')"; this.serviceConnection.openConnection(); if (this.serviceConnection.IsConnection) { this.reader = this.serviceConnection.select(this.strCommande); if (this.reader != null) { if (this.reader.HasRows) { if (this.reader.Read()) { vehicule = new crlVehicule(); vehicule.MarqueVehicule = this.reader["marqueVehicule"].ToString(); vehicule.NumParamVehicule = this.reader["numParamVehicule"].ToString(); vehicule.MatriculeVehicule = this.reader["matriculeVehicule"].ToString(); try { vehicule.NombreColoneVehicule = int.Parse(this.reader["nombreColoneVehicule"].ToString()); } catch (Exception) { } vehicule.NumMoteurVehicule = this.reader["numMoteurVehicule"].ToString(); vehicule.NumProprietaire = this.reader["numProprietaire"].ToString(); vehicule.NumSerieVehicule = this.reader["numSerieVehicule"].ToString(); vehicule.NumVehicule = this.reader["numVehicule"].ToString(); vehicule.CouleurVehicule = this.reader["couleurVehicule"].ToString(); try { vehicule.PlacesAssiseVehicule = int.Parse(this.reader["placesAssiseVehicule"].ToString()); } catch (Exception) { } try { vehicule.PoidsTotalVehicule = double.Parse(this.reader["poidsTotalVehicule"].ToString()); } catch (Exception) { } try { vehicule.PoidsVideVehicule = double.Parse(this.reader["poidsVideVehicule"].ToString()); } catch (Exception) { } vehicule.PuissanceVehicule = this.reader["puissanceVehicule"].ToString(); vehicule.SourceEnergie = this.reader["sourceEnergie"].ToString(); vehicule.TypeVehicule = this.reader["typeVehicule"].ToString(); vehicule.ImageVehicule = this.reader["imageVehicule"].ToString(); } } this.reader.Dispose(); } while (this.serviceConnection.IsConnection) { this.serviceConnection.closeConnection(); } } if (vehicule != null) { if (vehicule.SourceEnergie != "") { vehicule.sourceEnergieObj = serviceSourceEnergie.selectSourceEnergie(vehicule.SourceEnergie); } if (vehicule.NumProprietaire != "") { vehicule.proprietaire = serviceProprietaire.selectProprietaire(vehicule.NumProprietaire); } if (vehicule.NumParamVehicule != "") { vehicule.paramVehicule = serviceParamVehicule.selectParamVehicule(vehicule.NumParamVehicule); } } } #endregion return(vehicule); }