public List <RunInfoTable> GetAllRunInfos() { RunInfoTable runInfoTable = new RunInfoTable(null, null, null); var founddata = DataBase.Select(runInfoTable); // this is the actual database operation return(founddata); }
public RunInfoTable GetRunInfo(string projectName, DateTime dateTime, SpecifyDateTimeDegree degree) { RunInfoTable runInfoTable = new RunInfoTable(projectName, dateTime, null); var founddata = DataBase.Select(runInfoTable); // this is the actual database operation return(founddata.Count > 0? founddata.First() :null); }
public void Delete(RunInfoTable runInfo) { RunInfoTable runInfoTable = new RunInfoTable(runInfo.CreateDateTime, null, null, null); var founddata = DataBase.Select(runInfoTable); // this is the actual database operation if (founddata.Count == 0) { return; } DataBase.Delete(founddata.First()); }
public bool Update(RunInfoTable runInfoTable, ref string errMsg) { RunInfoTable tmpRunInfoTable = new RunInfoTable(runInfoTable.ProjectName, runInfoTable.CreateDateTime, null); var founddata = DataBase.Select(runInfoTable); // this is the actual database operation if (founddata.Count == 0) { errMsg = "Cannot find userInfo"; return(false); } int val = DataBase.Update(runInfoTable, founddata.First()); return(val == 1); }
public bool Add(RunInfoTable runInfoTable, ref string errMsg) { runInfoTable.SampleCount = null; var founddata = DataBase.Select(runInfoTable); // this is the actual database operation if (founddata != null && founddata.Count != 0) { errMsg = "already exist!"; return(false); } else { int ret = DataBase.Insert(runInfoTable); return(ret == 1); } }