Exemple #1
0
 void ISDETableEditor.CreateUpdateCache(int oid, int rowHandle)
 {
     GDataRow newRow = new GDataRow(rowHandle);
     newRow.OID_VALUE = oid;
     newRow.ROW_HANDLE = rowHandle;
     _lstCacheUpdateData.Add(newRow);
 }
Exemple #2
0
 void ISDETableEditor.CreateNewRowCache(string oid, int rowHandle)
 {
     GDataRow newRow = new GDataRow(rowHandle);
     newRow.OID_VALUE=oid;
     newRow.ROW_HANDLE=rowHandle;
     _lstCacheNewData.Add(newRow);
 }
Exemple #3
0
 void ISDETableEditor.CreateNewRowCache(int rowHandle)
 {
     GDataRow newRow = new GDataRow(rowHandle);
     newRow.ROW_HANDLE = rowHandle;
     _lstCacheNewData.Add(newRow);
     _newRowsCached.Add(rowHandle);
 }
Exemple #4
0
        void ISDETableEditor.CacheData(object oidValue, int rowHandle, List<object[,]> pair_ColVal,EnumTypeOfEdit type)
        {
            GDataRow newRow = new GDataRow(rowHandle);
            int i = -1;
            int len = pair_ColVal.Count;
            switch (type)
            {
                case EnumTypeOfEdit.NEW: //create new
                    i = -1;
                    foreach (GDataRow r in _lstCacheNewData)
                    {
                        if (r.ROW_HANDLE == rowHandle)
                        {

                            i = _lstCacheNewData.IndexOf(r);

                            break;
                        }
                    }
                    if (_lstCacheNewData.Count != 0 && i!=-1)
                    {
                        _lstCacheNewData.RemoveAt(i);
                    }
                    newRow.OID_VALUE = oidValue;
                    newRow.ROW_HANDLE = rowHandle;
                    //newRow.PAIR_OF_COL_VAL = pair_ColVal; <--- ko duoc su dung: gan reference

                    for (int k = 0; k < len; k++)
                    {

                        newRow.PAIR_OF_COL_VAL.Add( pair_ColVal[k]);
                    }
                    _lstCacheNewData.Add(newRow);

                    break;
                case EnumTypeOfEdit.UPDATE: //update
                    i = -1;
                    //MessageBox.Show(oidValue.ToString());
                    foreach (GDataRow r in _lstCacheUpdateData)
                    {
                        if (r.OID_VALUE == oidValue)
                        {
                            //MessageBox.Show("truoc: "+_lstCacheUpdateData.Count.ToString());
                            i = _lstCacheUpdateData.IndexOf(r);
                            //MessageBox.Show("sau: "+_lstCacheUpdateData.Count.ToString()+"--"+i.ToString());
                            break;
                        }
                    }
                    if (_lstCacheUpdateData.Count != 0 && i!=-1)
                    {
                        //MessageBox.Show("truoc remove");
                        _lstCacheUpdateData.RemoveAt(i);
                        //MessageBox.Show("sau remove");
                    }
                    newRow.OID_VALUE = oidValue;
                    newRow.ROW_HANDLE = rowHandle;
                    for (int k = 0; k < len; k++)
                    {
                        newRow.PAIR_OF_COL_VAL.Add(pair_ColVal[k]);
                    }
                    _lstCacheUpdateData.Add(newRow);

                    break;
                case EnumTypeOfEdit.DELETE: //delete
                    i = -1;
                    foreach (GDataRow r in _lstCacheDelData)
                    {
                        if (r.OID_VALUE == oidValue)
                        {
                            i = _lstCacheDelData.IndexOf(r);
                            break;
                        }
                    }
                    if (_lstCacheDelData.Count != 0 && i!=-1)
                    {

                        _lstCacheDelData.RemoveAt(i);
                        //MessageBox.Show("hang new:" + _lstCacheNewData.Count.ToString());
                    }
                    newRow.OID_VALUE = oidValue;
                    //newRow.ROW_HANDLE = rowHandle;

                    //for (int k = 0; k < len; k++)
                    //{
                    //    newRow.PAIR_OF_COL_VAL.Add(pair_ColVal[k]);
                    //}
                    _lstCacheDelData.Add(newRow);
                    break;
                default: break;
            }
        }