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

            if (rowsCount > 0)
            {
                lgk.Model.tb_wealth model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new lgk.Model.tb_wealth();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = long.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["WealthContent"] != null && dt.Rows[n]["WealthContent"].ToString() != "")
                    {
                        model.WealthContent = dt.Rows[n]["WealthContent"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(lgk.Model.tb_wealth model)
 {
     return(dal.Update(model));
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public long Add(lgk.Model.tb_wealth model)
 {
     return(dal.Add(model));
 }