/// <summary> /// 获取任务记录 /// </summary> public List <TaskRecord> SelectTaskRecordBySql(string sql) { List <TaskRecord> taskRecordList = new List <TaskRecord>(); try { lock (lockDB) { dataReader = execQuery(sql); while (dataReader.Read()) { TaskRecord taskRecord = new TaskRecord(); taskRecord.taskRecordID = int.Parse(dataReader["taskRecordID"] + ""); taskRecord.taskRecordStat = (TASKSTAT_T)int.Parse(dataReader["taskRecordStat"] + ""); taskRecord.taskLevel = int.Parse(dataReader["taskLevel"] + ""); try { if (!String.IsNullOrEmpty(dataReader["forklift"].ToString())) { taskRecord.forkLiftWrapper = AGVCacheData.getForkLiftByID(int.Parse(dataReader["forklift"] + "")); } } catch (FormatException fx) { Console.WriteLine("message = " + fx.Message); } taskRecord.singleTask = SingleTaskDao.getDao().getSingleTaskByID(int.Parse(dataReader["singleTask"] + "")); taskRecord.taskRecordName = taskRecord.singleTask.taskName; taskRecord.updateTime = (DateTime)(dataReader["taskRecordUpdateTime"]); taskRecordList.Add(taskRecord); } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(taskRecordList); }
public SingleTask getSingleTaskByTaskName(string taskName) { SingleTask singleTask = null; foreach (SingleTask st in AGVCacheData.getSingleTaskList()) { if (st.taskName.StartsWith(taskName)) { singleTask = st; } } return(singleTask); }
public SingleTask getSingleTaskByID(int singleTaskID) { SingleTask singleTask = null; foreach (SingleTask st in AGVCacheData.getSingleTaskList()) { if (st.taskID == singleTaskID) { singleTask = st; } } return(singleTask); }