Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        // 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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
Arquivo: acq.cs Projeto: radtek/INCC6
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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));
            }
        }
Exemplo n.º 9
0
 // fix this later
 public static string Value(string s, string t)
 {
     return(SQLSpecific.Value(s, !String.IsNullOrEmpty(t)));
 }