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