/// <summary> /// 获得数据列表 /// </summary> public List <CLDC_Dispatcher.Model.DSPTCH_TASKS> DataTableToList(DataTable dt) { List <CLDC_Dispatcher.Model.DSPTCH_TASKS> modelList = new List <CLDC_Dispatcher.Model.DSPTCH_TASKS>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { CLDC_Dispatcher.Model.DSPTCH_TASKS model; for (int n = 0; n < rowsCount; n++) { model = new CLDC_Dispatcher.Model.DSPTCH_TASKS(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } model.TASK_NO = dt.Rows[n]["TASK_NO"].ToString(); model.AVR_DEVICE_ID = dt.Rows[n]["AVR_DEVICE_ID"].ToString(); model.AVR_END_FLAG = dt.Rows[n]["AVR_END_FLAG"].ToString(); model.AVR_START_TIME = dt.Rows[n]["AVR_START_TIME"].ToString(); model.AVR_END_TIME = dt.Rows[n]["AVR_END_TIME"].ToString(); model.AVR_HANDLE_FLAG = dt.Rows[n]["AVR_HANDLE_FLAG"].ToString(); model.AVR_SCHEME_ID = dt.Rows[n]["AVR_SCHEME_ID"].ToString(); model.AVR_WRITE_TIME = dt.Rows[n]["AVR_WRITE_TIME"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(CLDC_Dispatcher.Model.DSPTCH_TASKS model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(CLDC_Dispatcher.Model.DSPTCH_TASKS model) { return(dal.Add(model)); }