예제 #1
0
        public object[] AddRow(Session session, Row row, object[] data, SqlType[] types, int[] columnMap)
        {
            long id     = row.GetId();
            int  lookup = this._list.GetLookup(id, (int)id);

            if (lookup == -1)
            {
                this._list.Put(id, row, data);
                this._list.SetThirdValueByIndex(base.Size, columnMap);
                base.Size++;
                return(data);
            }
            object[] rowData            = this._list.GetFirstByLookup(lookup).RowData;
            object[] secondValueByIndex = this._list.GetSecondValueByIndex(lookup);
            if (secondValueByIndex == null)
            {
                throw Error.GetError(0xf3c);
            }
            for (int i = 0; i < columnMap.Length; i++)
            {
                int     index     = columnMap[i];
                SqlType otherType = types[index];
                if (otherType.Compare(session, data[index], secondValueByIndex[index], otherType, true) != 0)
                {
                    if (otherType.Compare(session, rowData[index], secondValueByIndex[index], otherType, true) != 0)
                    {
                        throw Error.GetError(0xf3c);
                    }
                    secondValueByIndex[index] = data[index];
                }
            }
            int[] numArray = ArrayUtil.Union(this._list.GetThirdValueByIndex(lookup), columnMap);
            this._list.SetThirdValueByIndex(lookup, numArray);
            return(secondValueByIndex);
        }