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

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