Пример #1
0
        string IntfDalUSPoint.insertUSPoint(crlUSPoint point, string sigleAgence)
        {
            #region declaration
            string         numPoint       = "";
            int            nbInsert       = 0;
            IntfDalUSPoint serviceUSPoint = new ImplDalUSPoint();
            #endregion

            #region implementation
            if (point != null)
            {
                point.NumPoint = serviceUSPoint.getNumUSPoint(sigleAgence);

                this.strCommande  = "INSERT INTO `uspoint` (`numPoint`,`matriculeAgent`,`dateHeurePoint`,";
                this.strCommande += " `numVoyage`,`commentaire`,`numArret`) VALUES ('" + point.NumPoint + "',";
                this.strCommande += " '" + point.MatriculeAgent + "','" + point.DateHeurePoint.ToString("yyyy-MM-dd HH:mm:ss") + "',";
                this.strCommande += " '" + point.NumVoyage + "','" + point.Commentaire + "','" + point.NumArret + "')";

                this.serviceConnectBase.openConnection();
                nbInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nbInsert == 1)
                {
                    numPoint = point.NumPoint;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numPoint);
        }
Пример #2
0
        bool IntfDalUSPoint.updateUSPoint(crlUSPoint point)
        {
            #region declaration
            bool isUpdate = false;
            int  nbUpdate = 0;
            #endregion

            #region implementation
            if (point != null)
            {
                this.strCommande  = "UPDATE `uspoint` SET `matriculeAgent`='" + point.MatriculeAgent + "',";
                this.strCommande += " `dateHeurePoint`='" + point.DateHeurePoint.ToString("yyyy-MM-dd") + "',";
                this.strCommande += " `numVoyage`='" + point.NumVoyage + "',`commentaire`='" + point.Commentaire + "',";
                this.strCommande += " `numArret`='" + point.NumArret + "'";
                this.strCommande += " WHERE `numPoint`='" + point.NumPoint + "'";

                this.serviceConnectBase.openConnection();
                nbUpdate = this.serviceConnectBase.requete(this.strCommande);
                if (nbUpdate == 1)
                {
                    isUpdate = true;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(isUpdate);
        }
Пример #3
0
        crlUSPoint IntfDalUSPoint.selectUSPoint(string numPoint)
        {
            #region declaration
            crlUSPoint point = null;
            #endregion

            #region implementation
            if (numPoint != "")
            {
                this.strCommande = "SELECT * FROM `uspoint` WHERE `numPoint`='" + numPoint + "'";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            point             = new crlUSPoint();
                            point.Commentaire = this.reader["commentaire"].ToString();
                            try
                            {
                                point.DateHeurePoint = Convert.ToDateTime(this.reader["dateHeurePoint"].ToString());
                            }
                            catch (Exception) { }
                            point.MatriculeAgent = this.reader["matriculeAgent"].ToString();
                            point.NumPoint       = this.reader["numPoint"].ToString();
                            point.NumVoyage      = this.reader["numVoyage"].ToString();
                            point.NumArret       = this.reader["numArret"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(point);
        }