Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <tdps.Model.DM_BZ> DataTableToList(DataTable dt)
        {
            List <tdps.Model.DM_BZ> modelList = new List <tdps.Model.DM_BZ>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                tdps.Model.DM_BZ model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model       = new tdps.Model.DM_BZ();
                    model.bz_dm = dt.Rows[n]["bz_dm"].ToString();
                    model.bz_mc = dt.Rows[n]["bz_mc"].ToString();
                    if (dt.Rows[n]["bz_dw"].ToString() != "")
                    {
                        model.bz_dw = decimal.Parse(dt.Rows[n]["bz_dw"].ToString());
                    }
                    if (dt.Rows[n]["bz_hl"].ToString() != "")
                    {
                        model.bz_hl = decimal.Parse(dt.Rows[n]["bz_hl"].ToString());
                    }
                    model.xybz = dt.Rows[n]["xybz"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(tdps.Model.DM_BZ model)
 {
     dal.Update(model);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(tdps.Model.DM_BZ model)
 {
     dal.Add(model);
 }