Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <tdps.Model.DM_YPXH> DataTableToList(DataTable dt)
        {
            List <tdps.Model.DM_YPXH> modelList = new List <tdps.Model.DM_YPXH>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                tdps.Model.DM_YPXH model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model         = new tdps.Model.DM_YPXH();
                    model.ypxh_dm = dt.Rows[n]["ypxh_dm"].ToString();
                    model.ypxh_mc = dt.Rows[n]["ypxh_mc"].ToString();
                    model.bz      = dt.Rows[n]["bz"].ToString();
                    model.xybz    = dt.Rows[n]["xybz"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(tdps.Model.DM_YPXH model)
 {
     dal.Update(model);
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(tdps.Model.DM_YPXH model)
 {
     dal.Add(model);
 }