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); } }
public object Clone() { CUnitS cUnitLogS = new CUnitS(); for (int i = 0; i < this.Count; i++) { cUnitLogS.Add((CUnit)this[i].Clone()); } return(cUnitLogS); }
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); }
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); }