Exemplo n.º 1
0
        public bool Delete(String Id)
        {
            db.SetConnection();
            string s = "DELETE FROM collar_data_entry where item_name = " + SQLSpecific.QVal(Id);;

            return(db.Execute(s));
        }
Exemplo n.º 2
0
        public DataTable MeasurementsForInspection(string number)
        {
            db.SetConnection();
            string sSQL = "SELECT * FROM measurements where detector_id=" + SQLSpecific.QVal(number) + " ORDER BY DateTime DESC";

            return(db.DT(sSQL));
        }
Exemplo n.º 3
0
        public bool Delete(long DetectorId, string CounterType, ElementList sParams)
        {
            DataRow dr = null;

            string table = "CountingParams";

            if (CounterType.Equals("Multiplicity") || CounterType.Equals("Coincidence"))
            {
                table = "LMMultiplicity";
            }

            if (table.Equals("LMMultiplicity"))
            {
                dr = HasRow(DetectorId, CounterType, table, sParams, sParams[faidx].Value); // the FA parameter
            }
            else
            {
                dr = HasRow(DetectorId, CounterType, table, sParams);
            }
            if (dr != null)
            {
                string sSQL = "DELETE FROM " + table + " where counter_type=" + SQLSpecific.QVal(CounterType) + " AND detector_id=" + DetectorId.ToString();
                if (table.Equals("LMMultiplicity"))
                {
                    sSQL += " AND " + sParams[faidx].Name + "=" + sParams[faidx].Value;
                }
                return(db.Execute(sSQL));
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 4
0
        public long Update(string Id, ElementList sParams)
        {
            db.SetConnection();

            DataTable dt = GetRows(Id); // must be unknown or at least one with same name because unique did not fire

            if (dt != null)
            {
                string wh   = " where " + "isotopics_id = " + SQLSpecific.QVal(Id);
                string sSQL = "UPDATE isotopics SET ";
                sSQL += sParams.ColumnEqValueList + wh;
                if (db.Execute(sSQL))
                {
                    return(PrimaryKey(Id));
                }
                else
                {
                    return(-1);
                }
            }
            else  // totally new
            {
                ArrayList sqlList = new ArrayList();
                string    sSQL    = "Insert into isotopics ";
                sSQL += sParams.ColumnsValues;
                sqlList.Add(sSQL);
                sqlList.Add(SQLSpecific.getLastID("isotopics"));
                return(db.ExecuteTransactionID(sqlList));
            }
        }
Exemplo n.º 5
0
 public long getItemID(string item_name)
 {
     //Check item name against current entries
     db.CreateCommand("Select item_id from items where item_name=" + SQLSpecific.QVal(item_name));
     db.SetConnection();
     return(db.ScalarIntx());
 }
Exemplo n.º 6
0
        public bool Delete(string Id)
        {
            db.SetConnection();
            string s = "DELETE FROM composite_isotopics_rec where isotopics_id = " + SQLSpecific.QVal(Id);

            return(db.Execute(s));
        }
Exemplo n.º 7
0
        public DataTable HVPlateauResultsForDet(string name, bool includeRuns)
        {
            db.SetConnection();
            string sSQL = "SELECT * FROM HVResult where detector_id=" + SQLSpecific.QVal(name);

            return(db.DT(sSQL));
        }
Exemplo n.º 8
0
        public bool Update(string Name, string Description)
        {
            db.SetConnection();
            string sSQL    = "";
            bool   updated = false;

            if (Unique(Name, Description))
            {
                return(false);
            }

            DataTable dt = GetRows(Name);     // must be unknown or at least one with same name because unique did not fire

            if (dt != null)
            {
                DataRow[] dr = dt.Select("description = " + SQLSpecific.QVal(Description));
                if (dr.Length < 1)     // desc changed for an existing type
                {
                    sSQL = "UPDATE " + table + " SET "
                           + "[description] = " + SQLSpecific.QVal(Description)
                           + " WHERE " + SQLSpecific.QValCompare("name", Name, true);
                    updated = db.Execute(sSQL);
                }
            }
            else      // totally new type name
            {
                sSQL = "Insert into " + table + " ([name], [description]) "
                       + " Values (" + SQLSpecific.QVal(Name) + "," + SQLSpecific.QVal(Description) + ")";
                updated = db.Execute(sSQL);
            }
            return(updated);
        }
Exemplo n.º 9
0
        public bool UpdateNote(string notes, long Meas_ID)
        {
            db.SetConnection();
            string wh    = " where id = " + Meas_ID.ToString();
            string sSQL1 = "UPDATE measurements SET Notes = " + SQLSpecific.QVal(notes) + wh;

            return(db.Execute(sSQL1));
        }
Exemplo n.º 10
0
        public bool UpdateFileName(string fileName, long Meas_ID)
        {
            db.SetConnection();
            string wh    = " where id = " + Meas_ID.ToString();
            string sSQL1 = "UPDATE measurements SET FileName = " + SQLSpecific.QVal(fileName) + wh;

            return(db.Execute(sSQL1));
        }
Exemplo n.º 11
0
        public bool UpdateEndingComment(long mid, string ec)
        {
            db.SetConnection();
            string wh    = " where mid=" + mid.ToString();
            string sSQL1 = "UPDATE results_rec SET ending_comment=" + SQLSpecific.QVal(ec) + wh;

            return(db.Execute(sSQL1));
        }
Exemplo n.º 12
0
        // return the stratum
        public DataTable Get(string stratumId)
        {
            db.SetConnection();
            string    sSQL = "Select * FROM stratum_ids where name=" + SQLSpecific.QVal(stratumId);
            DataTable dt   = db.DT(sSQL);

            return(dt);
        }
Exemplo n.º 13
0
        public DataTable MeasurementsForDet(string name)
        {
            db.SetConnection();
            //Changed SQL to display measurements w/newest first hn 9.10.2015
            string sSQL = "SELECT * FROM measurements where detector_id=" + SQLSpecific.QVal(name) + " ORDER BY DateTime DESC";

            return(db.DT(sSQL));
        }
Exemplo n.º 14
0
        public bool DefinitionExists(string DetectorName)
        {
            db.SetConnection();
            string    sSQL = "Select * FROM detector Where detector_name = " + SQLSpecific.QVal(DetectorName);
            DataTable dt   = db.DT(sSQL);

            return(dt.Rows.Count > 0);
        }
Exemplo n.º 15
0
        public bool Update(long Id, string NewId)
        {
            db.SetConnection();
            string wh    = " where glovebox_id = " + Id.ToString();
            string sSQL1 = "UPDATE holdup_config_rec SET glovebox_id=" + SQLSpecific.QVal(NewId);
            string sSQL  = sSQL1 + wh;

            return(db.Execute(sSQL));
        }
Exemplo n.º 16
0
        public bool Update(long Id, string NewId)
        {
            db.SetConnection();
            string wh    = " where id = " + Id.ToString();
            string sSQL1 = "UPDATE poison_rod_type_rec SET poison_rod_type=" + SQLSpecific.QVal(NewId);
            string sSQL  = sSQL1 + wh;

            return(db.Execute(sSQL));
        }
Exemplo n.º 17
0
        public bool Update(long Id, string NewId)
        {
            db.SetConnection();
            string wh    = " where " + "item_id = " + Id.ToString();
            string sSQL1 = "UPDATE collar_data_entry SET item_name=" + SQLSpecific.QVal(NewId);
            string sSQL  = sSQL1 + wh;

            return(db.Execute(sSQL));
        }
Exemplo n.º 18
0
        public bool Update(long Id, string NewId)
        {
            db.SetConnection();
            string wh    = " where id = " + Id.ToString();
            string sSQL1 = "UPDATE isotopics SET isotopics_id=" + SQLSpecific.QVal(NewId);
            string sSQL  = sSQL1 + wh;

            return(db.Execute(sSQL));
        }
Exemplo n.º 19
0
        public bool Update(string name, DateTime dt, ElementList sParams)
        {
            db.SetConnection();
            string sSQL1 = "UPDATE HVResult SET ";
            string wh    = " where detector_id=" + SQLSpecific.QVal(name) + " AND HVPDateTime=" + SQLSpecific.getDate(dt);
            string sSQL  = sSQL1 + sParams.ColumnEqValueList + wh;

            return(db.Execute(sSQL));
        }
Exemplo n.º 20
0
        private DataTable BasicSelect(string ItemName)
        {
            db.SetConnection();
            string sSQL = "SELECT item_name "
                          + " FROM collar_data_entry"
                          + " Where item_name = " + SQLSpecific.QVal(ItemName);
            DataTable dt = db.DT(sSQL);

            return(dt);
        }
Exemplo n.º 21
0
        private DataTable BasicSelect(string IsoName)
        {
            db.SetConnection();
            string sSQL = "SELECT ci_isotopics_id "
                          + " FROM composite_isotopics_rec"
                          + " Where ci_isotopics_id = " + SQLSpecific.QVal(IsoName);
            DataTable dt = db.DT(sSQL);

            return(dt);
        }
Exemplo n.º 22
0
        public bool Delete(string Id)
        {
            if (string.IsNullOrEmpty(Id))
            {
                return(false);
            }
            db.SetConnection();
            string s = "DELETE FROM poison_rod_type_rec where poison_rod_type=" + SQLSpecific.QVal(Id);

            return(db.Execute(s));
        }
Exemplo n.º 23
0
        public bool Update(string DetectorName, ElementList els)
        {
            db.SetConnection();
            string wh     = " where detector_name = " + SQLSpecific.QVal(DetectorName);
            string sSQL1  = "UPDATE detectors SET ";
            string sSQL1i = String.Empty;
            string sSQL   = sSQL1 + els.ColumnEqValueList + wh; // NEXT: use exclusion for params in this case it's detector_name
            bool   b      = db.Execute(sSQL);

            return(b);
        }
Exemplo n.º 24
0
        public bool Delete(string Id)
        {
            if (string.IsNullOrEmpty(Id))
            {
                return(false);
            }
            db.SetConnection();
            string s = "DELETE FROM cm_pu_ratio_rec where cm_id=" + SQLSpecific.QVal(Id);

            return(db.Execute(s));
        }
Exemplo n.º 25
0
        public bool Delete(string Id)
        {
            if (string.IsNullOrEmpty(Id))
            {
                return(false);
            }
            db.SetConnection();
            string s = "DELETE FROM holdup_config_rec where glovebox_id = " + SQLSpecific.QVal(Id);

            return(db.Execute(s));
        }
Exemplo n.º 26
0
        public long Add(string name, DateTimeOffset date, string mtype, string filename, string notes)
        {
            db.SetConnection();
            ArrayList sqlList = new ArrayList();
            string    sSQL1   = "Insert into measurements (detector_id, DateTime, Notes, Type, FileName) VALUES (" + SQLSpecific.QVal(name)
                                + "," + SQLSpecific.getDate(date) + "," + SQLSpecific.QVal(notes) + "," + SQLSpecific.QVal(mtype) +
                                "," + SQLSpecific.QVal(filename) + ")";

            sqlList.Add(sSQL1);
            sqlList.Add(SQLSpecific.getLastID("measurements"));
            return(db.ExecuteTransactionID(sqlList));
        }
Exemplo n.º 27
0
        private DataTable BasicSelect(string DetectorName, Int32 DetectorType, string DetectorElectronics)
        {
            db.SetConnection();
            string sSQL = "SELECT detector_name "
                          + " FROM detectors"
                          + " Where detector_name = " + SQLSpecific.QVal(DetectorName);

            if (StrictDefinition)
            {
                sSQL += " AND detector_type_id = " + DetectorType.ToString() + " AND electronics_id = " + SQLSpecific.QVal(DetectorElectronics);
            }
            DataTable dt = db.DT(sSQL);

            return(dt);
        }
Exemplo n.º 28
0
        public DataTable GetRows(string Name)
        {
            string sSQL = "SELECT * "
                          + " FROM composite_isotopics_rec"
                          + " Where ci_isotopics_id = " + SQLSpecific.QVal(Name);
            DataTable dt = db.DT(sSQL);

            if (dt.Rows.Count > 0)
            {
                return(dt);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 29
0
        public DataTable GetRows(string Name)
        {
            string sSQL = "SELECT * "
                          + " FROM poison_rod_type_rec"
                          + " Where poison_rod_type = " + SQLSpecific.QVal(Name);
            DataTable dt = db.DT(sSQL);

            if (dt.Rows.Count > 0)
            {
                return(dt);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 30
0
        public DataTable GetRows(string Name)
        {
            string sSQL = "SELECT * "
                          + " FROM collar_data_entry"
                          + " Where item_name = " + SQLSpecific.QVal(Name);
            DataTable dt = db.DT(sSQL);

            if (dt.Rows.Count > 0)
            {
                return(dt);
            }
            else
            {
                return(null);
            }
        }