コード例 #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
        void IntfDalUSPoint.insertToGridPointVoyage(GridView gridView, string param, string paramLike, string valueLike, string numVoyage)
        {
            #region declaration
            IntfDalUSPoint serviceUSPoint = new ImplDalUSPoint();
            #endregion

            #region implementation

            this.strCommande  = "SELECT uspoint.numPoint, uspoint.matriculeAgent, uspoint.dateHeurePoint,";
            this.strCommande += " uspoint.numVoyage, uspoint.commentaire, uspoint.numArret,";
            this.strCommande += " usarret.nomArret, uslieu.nomLieu FROM uspoint";
            this.strCommande += " Inner Join usarret ON usarret.numArret = uspoint.numArret";
            this.strCommande += " Inner Join uslieu ON uslieu.numLieu = usarret.numLieu";
            this.strCommande += " WHERE uspoint.numVoyage = '" + numVoyage + "' AND";
            this.strCommande += " " + paramLike + " LIKE  '%" + valueLike + "%'";
            this.strCommande += " ORDER BY " + param;


            gridView.DataSource = serviceUSPoint.getDataTablePointVoyage(this.strCommande);
            gridView.DataBind();
            #endregion
        }