示例#1
0
        public List <RunInfoTable> GetAllRunInfos()
        {
            RunInfoTable runInfoTable = new RunInfoTable(null, null, null);
            var          founddata    = DataBase.Select(runInfoTable); // this is the actual database operation

            return(founddata);
        }
示例#2
0
        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);
        }
示例#3
0
        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());
        }
示例#4
0
        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);
        }
示例#5
0
        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);
            }
        }