private void InsertDataRaw(FbTransaction trans, DataRawDataSet set, ValueStorageRaw storageRaw, Int64 rawUnitNo) { set.RecNo = context.DB.GetGenNo("GN_DATARAW"); set.DataRawUnitNo = rawUnitNo; set.RegTime = storageRaw.RegTime.ToString(Resource.csDateTimeFormat); set.ScanTime = context.Report.Method.ScanTime; set.DataRaw = ExtractDataRaw(storageRaw.RawValues, set.ScanTime); set.Insert(trans); }
private void InsertHalfFullDataRaw() { DataRaw raw = null; context.DB.Lock(); try { context.Report.Lock(); FbTransaction trans = context.DB.BeginTrans(); try { for (int i = 0; i < context.Report.DataRaw.Count; i++) { raw = context.Report.DataRaw.HalfFullDataRaw; if (raw == null) { break; } ValueStorageRaw storageRaw = raw.Row.Storage.HalfFullValues; if (raw.RecNo < 0) { InsertDataRawUnit(trans, context.DB.DataRawUnitSet, raw); } InsertDataRaw(trans, context.DB.DataRawSet, storageRaw, raw.RecNo); } context.DB.CommitTrans(); } catch (Exception e) { Resource.TLog.Log((int)ELogItem.Exception, e.ToString()); context.DB.RollbackTrans(); } finally { context.Report.Unlock(); } } finally { context.DB.Unlock(); } }