Esempio n. 1
0
        public virtual int InsertDB(object o)
        {
            cBaseItem d = (cBaseItem)o;

            if (d != null)
            {
                vlist.Reset();
                int i = 0;

                // if index -1 then, need to use seqance
                if (((int)d.data[0]) == -1)
                {
                    vlist.AddSeqNextValue(tbl_name);
                    i++;
                }

                for (; i < d.data.Count; i++)
                {
                    vlist.Add(d.data[i]);
                }

                return(Insert(tbl_name, vlist.SQL));
            }

            return(1);
        }
Esempio n. 2
0
        public virtual void WriteEntity(StreamWriter sw, int i)
        {
            cSqlValueList vlist = new cSqlValueList();
            cBaseItem     be    = null;

            be = (cBaseItem)dlist[i];
            if (be != null)
            {
                vlist.Reset();
                vlist.Mode = 1; // for file

                for (int j = 0; j < be.data.Count; ++j)
                {
                    vlist.Add(be.data[j]);
                }

                // write line to file
                sw.WriteLine(vlist.SQL);
            }
        }
Esempio n. 3
0
        public virtual void WriteEntity(StreamWriter sw, int i)
        {
            cSqlValueList vlist = new cSqlValueList();
            cBaseItem be = null;
            be = (cBaseItem)dlist[i];
            if (be != null)
            {
                vlist.Reset();
                vlist.Mode = 1; // for file

                for (int j = 0; j < be.data.Count; ++j)
                {
                    vlist.Add(be.data[j]);
                }

                // write line to file
                sw.WriteLine(vlist.SQL);
            }
        }