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

            if (rowsCount > 0)
            {
                DTcms.Model.GoodsAttributeValues model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.GoodsAttributeValues();
                    if (dt.Rows[n]["GoodsId"].ToString() != "")
                    {
                        model.GoodsId = int.Parse(dt.Rows[n]["GoodsId"].ToString());
                    }
                    model.AttributeName  = dt.Rows[n]["AttributeName"].ToString();
                    model.AttributeValue = dt.Rows[n]["AttributeValue"].ToString();
                    model.Remark         = dt.Rows[n]["Remark"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<DTcms.Model.GoodsAttributeValues> DataTableToList(DataTable dt)
        {
            List<DTcms.Model.GoodsAttributeValues> modelList = new List<DTcms.Model.GoodsAttributeValues>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                DTcms.Model.GoodsAttributeValues model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.GoodsAttributeValues();
                                                    if(dt.Rows[n]["GoodsId"].ToString()!="")
                {
                    model.GoodsId=int.Parse(dt.Rows[n]["GoodsId"].ToString());
                }
                                                                                                                                                model.AttributeName= dt.Rows[n]["AttributeName"].ToString();
                                                                                                                                model.AttributeValue= dt.Rows[n]["AttributeValue"].ToString();
                                                                                                                                model.Remark= dt.Rows[n]["Remark"].ToString();

                    modelList.Add(model);
                }
            }
            return modelList;
        }
Exemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DTcms.Model.GoodsAttributeValues model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(DTcms.Model.GoodsAttributeValues model)
 {
     dal.Add(model);
 }
Exemplo n.º 5
0
 public void AddAttributeValues(GoodsAttributeValues attributeValue)
 {
     _attributeValues.Add(attributeValue);
 }
Exemplo n.º 6
0
Arquivo: Goods.cs Projeto: uwitec/MWMS
 public void AddAttributeValues(GoodsAttributeValues attributeValue)
 {
     _attributeValues.Add(attributeValue);
 }