示例#1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <tdps.Model.DM_HYDL> DataTableToList(DataTable dt)
        {
            List <tdps.Model.DM_HYDL> modelList = new List <tdps.Model.DM_HYDL>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                tdps.Model.DM_HYDL model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model         = new tdps.Model.DM_HYDL();
                    model.hydl_dm = dt.Rows[n]["hydl_dm"].ToString();
                    model.hydl_mc = dt.Rows[n]["hydl_mc"].ToString();
                    model.hydl_jc = dt.Rows[n]["hydl_jc"].ToString();
                    model.hyml_dm = dt.Rows[n]["hyml_dm"].ToString();
                    model.xybz    = dt.Rows[n]["xybz"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(tdps.Model.DM_HYDL model)
 {
     dal.Update(model);
 }
示例#3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(tdps.Model.DM_HYDL model)
 {
     dal.Add(model);
 }