/// <summary> /// /// </summary> /// <param name="xgdevice"></param> /// <param name="dt"></param> /// <param name="cardSn"></param> /// <returns></returns> private static DateTime SaveToDBAndUpdateLast(XGDevice xgdevice, DateTime dt, string cardSn) { XGData data = new XGData(dt, cardSn); xgdevice.DeviceDataManager.Last = data; DBI.Instance.InsertXGData(xgdevice, data); return(dt); }
/// <summary> /// /// </summary> /// <param name="xgData"></param> public void InsertXGData(XGDevice xgdevice, XGData xgData) { int tmCardID = GetTMCardID(xgData.CardSN); int deviceID = GuidHelper.ConvertToInt32(xgdevice.Guid); string s = string.Format( "insert into tblTMData( DeviceID, TMID, TMDataDT) values ({0}, {1}, '{2}')", deviceID, tmCardID, xgData.DT); ExecuteScalar(s); }
/// <summary> /// /// </summary> /// <param name="xgData"></param> public void InsertXGData(XGDevice xgdevice, XGData xgData) { int tmCardID = GetTMCardID (xgData.CardSN); int deviceID = GuidHelper.ConvertToInt32(xgdevice.Guid); string s = string.Format( "insert into tblTMData( DeviceID, TMID, TMDataDT) values ({0}, {1}, '{2}')", deviceID, tmCardID, xgData.DT); ExecuteScalar(s); }
/// <summary> /// /// </summary> /// <param name="xgdevice"></param> /// <param name="dt"></param> /// <param name="cardSn"></param> /// <returns></returns> private static DateTime SaveToDBAndUpdateLast(XGDevice xgdevice, DateTime dt, string cardSn) { XGData data = new XGData(dt, cardSn); xgdevice.DeviceDataManager.Last = data; DBI.Instance.InsertXGData(xgdevice, data); return dt; }