示例#1
0
        /// <summary> Execute a select at the TCL and return the active list.
        /// </summary>
        /// <param name="sentence">The AQL command to select key from file
        ///
        /// </param>
        public virtual D3SelectList select(System.String sentence)
        {
            D3Item list;

            System.String[] result;
            D3Buffer        buf = this.myconnection.doit(D3Constants._D3_SELECT_TCL + "\x0001" + sentence + "\x0001");

            if (buf.Status != D3Constants.D3_OK)
            {
                throw new D3Exception("Erreur d' excution de " + sentence);
            }

            // first data is number of key selected
            int nbelement = System.Int32.Parse((System.String)buf.Data[0]);

            result = new System.String[nbelement];
            if (nbelement > 0)
            {
                // second data is list of key separated by @AM
                // We use D3Item, which is more easy to use ;)
                list = new D3Item((System.String)buf.Data[1]);

                for (int i = 0; i <= (nbelement - 1); i++)
                {
                    result[i] = list.extract(i + 1);
                }
            }
            return(new D3SelectListTcl(result));
        }
示例#2
0
文件: D3FileTcp.cs 项目: FOSS4MV/JD3
 /// <summary> Ecrire un record
 /// </summary>
 /// <param name="key">la cl
 /// </param>
 /// <param name="PItem">le record
 /// </param>
 /// <returns>int rsultat de l'criture
 ///
 /// </returns>
 //UPGRADE_NOTE: Synchronized keyword was removed from method 'write'. Lock expression was added. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1027"'
 public virtual int write(System.String key, D3Item PItem)
 {
     lock (this)
     {
         //UPGRADE_TODO: The equivalent in .NET for method 'java.Object.toString' may return a different value. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1043"'
         D3Buffer buf = this.con.doit(D3Constants._D3_WRITE + "\x0001" + fd + "\x0001" + key + "\x0001" + PItem.ToString() + "\x0001");
         return(buf.Status);
     }
 }
示例#3
0
文件: D3FileTcp.cs 项目: FOSS4MV/JD3
        /// <summary> Get the name of the file
        /// </summary>
        /// <returns>The name of the file
        ///
        /// </returns>

        /// <summary> Get the name of the accoutn where is the file
        /// </summary>
        /// <returns>The name of the account where is the file
        ///
        /// </returns>

        /// <summary> Lecture d'un record
        /// </summary>
        /// <param name="key">la cl
        /// </param>
        /// <param name="PItem">le record  mettre  jour, doit tre cr avant l'appel (ventuellement vide)
        /// </param>
        /// <returns>rsultat de la lecture
        /// READ_FILENOTOPEN   Le fichier n'est pas ouvert, le record est mis  vide
        /// READ_RECORDEMPTY   le record n'existe pas pour la cl demande, il est mis  vide
        /// READ_RECORDLOCKED  le record est dj lock, dans ce cas le record contient
        /// en <1> : le numro de port qui lock
        /// en <2> : le code user qui lock (si il est connu)
        /// D3_OK              si tout va bien, le record est mis  jour avec les infos
        ///
        /// </returns>
        //UPGRADE_NOTE: Synchronized keyword was removed from method 'read'. Lock expression was added. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1027"'
        public virtual int read(System.String key, D3Item PItem)
        {
            lock (this)
            {
                D3Buffer buf = this.con.doit(D3Constants._D3_READ + "\x0001" + fd + "\x0001" + key + "\x0001");
                PItem.Record = (System.String)buf.Data[0];
                return(buf.Status);
            }
        }