Beispiel #1
0
        private CUnit ReadRecord(DataTable dtTable)
        {
            CUnitS cRowS = null;

            foreach (DataRow dtRow in dtTable.Rows)
            {
                CUnit cRow = new CUnit();
                //cRow.ProcessKey = (ushort)dtRow[0];
                //cRow.AlarmTagKey = (string)dtRow[1];
                //cRow.ErrorStartTime = (DateTime)dtRow[2];
                //cRow.ErrorEndTime = (DateTime)dtRow[3];
                //cRow.Description = (string)dtRow[4];

                cRowS.Add(cRow);
            }

            if (cRowS.Count != 0)
            {
                return((CUnit)cRowS[0]);
            }

            else
            {
                return(null);
            }
        }
Beispiel #2
0
        public object Clone()
        {
            CUnitS cUnitLogS = new CUnitS();

            for (int i = 0; i < this.Count; i++)
            {
                cUnitLogS.Add((CUnit)this[i].Clone());
            }

            return(cUnitLogS);
        }
Beispiel #3
0
        public CUnitS Select(string sQuery)
        {
            CUnitS cLogS = null;

            DataTable dtTable = m_cConnector.ExecuteForDataTable(sQuery);

            if (dtTable != null)
            {
                cLogS = ReadTable(dtTable);
                dtTable.Dispose();
                dtTable = null;
            }
            return(cLogS);
        }
Beispiel #4
0
        private CUnitS ReadTable(DataTable dtTable)
        {
            CUnitS cRowS = new CUnitS();

            foreach (DataRow dtRow in dtTable.Rows)
            {
                CUnit cRow = new CUnit();
                //cRow.ProcessKey = (ushort)dtRow[0];
                //cRow.AlarmTagKey = (string)dtRow[1];
                //cRow.ErrorStartTime = (DateTime)dtRow[2];
                //cRow.ErrorEndTime = (DateTime)dtRow[3];
                //cRow.Description = (string)dtRow[4];

                cRowS.Add(cRow);
            }

            return(cRowS);
        }