public bool Update(DateTimeOffset measDatetime, string measDetId, string itemId, ElementList sParams) { db.SetConnection(); string wh = " where item_type = " + SQLSpecific.Value(itemId, true) + " AND meas_detector_id = " + SQLSpecific.Value(measDetId, true); string sSQL1 = "UPDATE acquire_parms_rec SET "; string sSQL = sSQL1 + sParams.ColumnEqValueList + wh; return(db.Execute(sSQL)); }
// NEXT: figure out difference between use of meas_detector_id and detector_id public bool Has(DateTimeOffset measDatetime, string measDetId, string item_type) { db.SetConnection(); string sSQL = "select * from acquire_parms_rec where meas_detector_id=" + SQLSpecific.Value(measDetId, true) + " and item_type=" + SQLSpecific.Value(item_type, true); DataTable dt = db.DT(sSQL); return(dt.Rows.Count > 0); }
public DataTable Get(string measDetId, string itemId) { db.SetConnection(); string sSQL = "select * from acquire_parms_rec left join LMAcquireParams on (acquire_parms_rec.MeasDate=LMAcquireParams.MeasDate) " + "where (meas_detector_id=" + SQLSpecific.Value(measDetId, true) + " and acquire_parms_rec.item_type=" + SQLSpecific.Value(itemId, true) + ")" + " order by acquire_parms_rec.MeasDate DESC"; DataTable dt = db.DT(sSQL); return(dt); }
public DataTable Get(string measDetId) // todo: this join results in duplicate entries, so gotta do something about that. joins the matching LM if found { db.SetConnection(); string sSQL = "select * from acquire_parms_rec left join LMAcquireParams on (acquire_parms_rec.MeasDate=LMAcquireParams.MeasDate) " + "where (acquire_parms_rec.meas_detector_id=" + SQLSpecific.Value(measDetId, true) + /*" and detector_id=" + l.ToString() +*/ ")" + " order by acquire_parms_rec.MeasDate DESC"; DataTable dt = db.DT(sSQL); return(dt); }
public bool Update(string measDetId, string item_type, ElementList sParams) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL1 = "UPDATE LMAcquireParams SET "; string sSQL1i = String.Empty; string wh = " where " + "item_type = " + SQLSpecific.Value(item_type, true) + " AND detector_id = " + l.ToString(); string sSQL = sSQL1 + sParams.ColumnEqValueList + wh; return(db.Execute(sSQL)); }
public DataTable Get(string measDetId) // joins the matching LM if found { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "select * from acquire_parms_rec left join LMAcquireParams on (LMAcquireParams.detector_id=" + l.ToString() + ") " + "where (acquire_parms_rec.meas_detector_id=" + SQLSpecific.Value(measDetId, true) + ")" + " order by acquire_parms_rec.MeasDate DESC"; DataTable dt = db.DT(sSQL); return(dt); }
public DataTable Get(string measDetId, string item_type) { db.SetConnection(); Detectors dets = new Detectors(db); long l = dets.PrimaryKey(measDetId); string sSQL = "Select * FROM LMAcquireParams"; sSQL += " where detector_id = " + l.ToString() + " AND item_type=" + SQLSpecific.Value(item_type, true); sSQL += " ORDER BY MeasDate DESC"; DataTable dt = db.DT(sSQL); return(dt); }
private string ResolvedKey(string val, IDB _db) { Detectors dets = new Detectors(_db); if (Id) { long l = dets.PrimaryKey(val); return(Field + "=" + l.ToString()); } else { return(Field + "=" + SQLSpecific.Value(val, true)); } }
// fix this later public static string Value(string s, string t) { return(SQLSpecific.Value(s, !String.IsNullOrEmpty(t))); }