예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <CLDC_Dispatcher.Model.DSPTCH_LOG> DataTableToList(DataTable dt)
        {
            List <CLDC_Dispatcher.Model.DSPTCH_LOG> modelList = new List <CLDC_Dispatcher.Model.DSPTCH_LOG>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                CLDC_Dispatcher.Model.DSPTCH_LOG model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new CLDC_Dispatcher.Model.DSPTCH_LOG();
                    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_TYPE       = dt.Rows[n]["AVR_TYPE"].ToString();
                    model.AVR_LOG        = dt.Rows[n]["AVR_LOG"].ToString();
                    model.AVR_WRITE_TIME = dt.Rows[n]["AVR_WRITE_TIME"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(CLDC_Dispatcher.Model.DSPTCH_LOG model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(CLDC_Dispatcher.Model.DSPTCH_LOG model)
 {
     return(dal.Add(model));
 }