Ejemplo n.º 1
0
        private static int[] UniteTables(DataTable totable, DataTable table, bool cover)
        {
            int nInsert = 0;
            int nModify = 0;

            foreach (DataRow row in table.Rows)
            {
                object[] keys = TableHelper.GetKeyvalues(row);
                if (!ExistID(totable, keys))
                {
                    DataRow newrow = totable.NewRow();
                    foreach (DataColumn col in table.Columns)
                    {
                        string colname = col.ColumnName;
                        newrow[colname] = row[colname];
                    }
                    totable.Rows.Add(newrow);
                    nInsert++;
                }
                else if (cover)
                {
                    DataRow dr     = totable.Rows.Find(keys);
                    bool    bEqual = true;
                    foreach (DataColumn col in table.Columns)
                    {
                        string colname = col.ColumnName;
                        if (!dr[colname].Equals(row[colname]))
                        {
                            bEqual      = false;
                            dr[colname] = row[colname];
                        }
                        if (!bEqual)
                        {
                            nModify++;
                        }
                    }
                }
            }

            return(new int[] { nInsert, nModify });
        }
Ejemplo n.º 2
0
        public LogHelper(string clientkey)
        {
            mClientkey = clientkey;
            NetClient client = NetClientManager.GetNetClient(clientkey);

            if (client.Database != "monitor")
            {
                mTableUnitManager = TableHelper.GetTableUnitManager(clientkey);
                TableUnit unit = mTableUnitManager.GetTableUnit("sys_remote_log");
                mLogTable = unit.GetTable();
            }

            int length = Convert.ToInt32(LogType.END);

            mConsoleFlag = new bool[length];
            mFileFlag    = new bool[length];
            for (int i = 0; i < length; ++i)
            {
                mConsoleFlag[i] = true;
                mFileFlag[i]    = true;
            }
        }
Ejemplo n.º 3
0
 public static void Release()
 {
     TableHelper.Release();
 }