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

            if (rowsCount > 0)
            {
                lgk.Model.tb_goods_property model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new lgk.Model.tb_goods_property();
                    if (dt.Rows[n]["PropertyID"].ToString() != "")
                    {
                        model.PropertyID = int.Parse(dt.Rows[n]["PropertyID"].ToString());
                    }
                    if (dt.Rows[n]["goodsID"].ToString() != "")
                    {
                        model.goodsID = int.Parse(dt.Rows[n]["goodsID"].ToString());
                    }
                    model.ColorID = dt.Rows[n]["ColorID"].ToString();
                    if (dt.Rows[n]["Qry"].ToString() != "")
                    {
                        model.Qry = int.Parse(dt.Rows[n]["Qry"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(lgk.Model.tb_goods_property model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(lgk.Model.tb_goods_property model)
 {
     return(dal.Add(model));
 }