예제 #1
0
 /// <summary>
 /// 移除数据
 /// </summary>
 /// <param name="pk">主键</param>
 public virtual void remove(double pk)
 {
     try {
         int index = getRowIndex(pk);
         m_keys.remove_at(index);
         FCDataRow row = m_rows.get(index);
         row.clear();
         m_rows.remove_at(index);
     }
     catch { }
 }
예제 #2
0
        /// <summary>
        /// 移除列
        /// </summary>
        /// <param name="colName">列名</param>
        public virtual void removeColumn(int colName)
        {
            int colIndex = getColumnIndex(colName);

            if (colIndex != -1)
            {
                int colSize     = m_columns.size();
                int removeIndex = -1;
                for (int i = 0; i < colSize; i++)
                {
                    int[] col   = m_columns.get(i);
                    int   name  = col[0];
                    int   index = col[1];
                    if (col[0] == colName)
                    {
                        removeIndex = i;
                    }
                    else
                    {
                        if (index > colIndex)
                        {
                            m_columns.set(i, new int[] { name, index - 1 });
                        }
                    }
                }
                m_columns.remove_at(removeIndex);
                for (int i = 0; i < m_rows.size(); i++)
                {
                    m_rows.get(i).remove(colIndex);
                    m_rows.get(i).fillEmpty(m_columns.size());
                }
            }
        }
예제 #3
0
 /// <summary>
 /// 移除
 /// </summary>
 /// <param name="index">索引</param>
 public void remove(int index)
 {
     if (index != -1 && m_values != null)
     {
         m_values.remove_at(index);
     }
 }