Beispiel #1
0
        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);
        }
Beispiel #2
0
        void IntfDalChauffeur.insertToGridChauffeurAll(GridView gridView, string param, string paramLike, string valueLike)
        {
            #region declaration
            IntfDalChauffeur serviceChauffeur = new ImplDalChauffeur();
            #endregion

            #region implementation
            this.strCommande  = "SELECT chauffeur.idChauffeur, chauffeur.nomChauffeur, chauffeur.prenomChauffeur,";
            this.strCommande += " chauffeur.cinChauffeur, chauffeur.adresseChauffeur, chauffeur.telephoneChauffeur,";
            this.strCommande += " chauffeur.telephoneMobileChauffeur FROM chauffeur";
            this.strCommande += " WHERE " + paramLike + " LIKE '%" + valueLike + "%'";
            this.strCommande += " ORDER BY " + param + " DESC";

            gridView.DataSource = serviceChauffeur.getDataTableChauffeurAll(this.strCommande);
            gridView.DataBind();
            #endregion
        }
Beispiel #3
0
        string IntfDalChauffeur.insertChauffeur(crlChauffeur Chauffeur, string sigleAgence)
        {
            #region declaration
            IntfDalChauffeur serviceChauffeur = new ImplDalChauffeur();
            string           idChauffeur      = "";
            int    nombreInsert   = 0;
            string numCooperative = "NULL";
            #endregion

            #region implementation
            if (Chauffeur != null)
            {
                if (Chauffeur.NumCooperative != "")
                {
                    numCooperative = "'" + Chauffeur.NumCooperative + "'";
                }
                Chauffeur.idChauffeur = serviceChauffeur.getIdChauffeur(sigleAgence);
                this.strCommande      = "INSERT INTO `chauffeur` (`idChauffeur`, `nomChauffeur`, `prenomChauffeur`, `cinChauffeur`, ";
                this.strCommande     += "`adresseChauffeur`, `telephoneChauffeur`, `telephoneMobileChauffeur`,`imageChauffeur`,`numCooperative`, ";
                this.strCommande     += "`situationFamilialeChauffeur`,`dateNaissanceChauffeur`,`lieuNaissanceChauffeur`)";
                this.strCommande     += "VALUES ('" + Chauffeur.idChauffeur + "', '" + Chauffeur.nomChauffeur + "', '" + Chauffeur.prenomChauffeur + "', ";
                this.strCommande     += "'" + Chauffeur.cinChauffeur + "', '" + Chauffeur.adresseChauffeur + "', '" + Chauffeur.telephoneChauffeur + "', ";
                this.strCommande     += "'" + Chauffeur.telephoneMobileChauffeur + "','" + Chauffeur.ImageChauffeur + "'," + numCooperative + ", ";
                this.strCommande     += "'" + Chauffeur.SituationFamilialeChauffeur + "','" + Chauffeur.DateNaissanceChauffeur.ToString("yyyy-MM-dd") + "', ";
                this.strCommande     += "'" + Chauffeur.LieuNaissanceChauffeur + "')";

                this.serviceConnectBase.openConnection();
                nombreInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nombreInsert == 1)
                {
                    idChauffeur = Chauffeur.idChauffeur;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(idChauffeur);
        }