示例#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));
        }
示例#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));
        }
示例#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);
            }
        }
示例#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));
            }
        }
示例#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());
 }
示例#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));
        }
示例#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));
        }
示例#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);
        }
示例#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));
        }
示例#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));
        }
示例#11
0
文件: Results.cs 项目: eric645/INCC6
        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));
        }
示例#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);
        }
示例#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));
        }
示例#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);
        }
示例#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));
        }
示例#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));
        }
示例#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));
        }
示例#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));
        }
示例#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));
        }
示例#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);
        }
示例#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);
        }
示例#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));
        }
示例#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);
        }
示例#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));
        }
示例#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));
        }
示例#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));
        }
示例#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);
        }
示例#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);
            }
        }
示例#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);
            }
        }
示例#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);
            }
        }