Esempio n. 1
0
        string IntfDalUSAppareil.insertUSAppareil(crlUSAppareil appareil, string sigleAgence)
        {
            #region declaration
            string            numAppareil       = "";
            IntfDalUSAppareil serviceUSAppareil = new ImplDalUSAppareil();
            int nbInsert = 0;
            #endregion

            #region implementation
            if (appareil != null && sigleAgence != "")
            {
                appareil.NumAppareil = serviceUSAppareil.getNumUSAppareil(sigleAgence);
                this.strCommande     = "INSERT INTO `usappareil` (`numAppareil`,`typeAppareil`,";
                this.strCommande    += " `numSerie`) VALUES";
                this.strCommande    += " ('" + appareil.NumAppareil + "','" + appareil.TypeAppareil + "',";
                this.strCommande    += " '" + appareil.NumSerie + "')";

                this.serviceConnectBase.openConnection();
                nbInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nbInsert == 1)
                {
                    numAppareil = appareil.NumAppareil;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numAppareil);
        }
Esempio n. 2
0
        void IntfDalUSAppareil.insertToGridAppareil(GridView gridView, string param, string paramLike, string valueLike, string typeAppareil)
        {
            #region declaration
            IntfDalUSAppareil serviceUSAppareil = new ImplDalUSAppareil();
            #endregion

            #region implementation

            this.strCommande  = "SELECT usappareil.numAppareil, usappareil.typeAppareil,";
            this.strCommande += " usappareil.numSerie FROM usappareil";
            this.strCommande += " WHERE usappareil.typeAppareil LIKE '%" + typeAppareil + "%' AND";
            this.strCommande += " " + paramLike + " LIKE  '%" + valueLike + "%'";
            this.strCommande += " ORDER BY " + param;


            gridView.DataSource = serviceUSAppareil.getDataTableAppareil(this.strCommande);
            gridView.DataBind();
            #endregion
        }