Exemple #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <NoName.NetShop.Model.SuitProductModel> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List <NoName.NetShop.Model.SuitProductModel> modelList = new List <NoName.NetShop.Model.SuitProductModel>();
            int rowsCount = ds.Tables[0].Rows.Count;

            if (rowsCount > 0)
            {
                NoName.NetShop.Model.SuitProductModel model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new NoName.NetShop.Model.SuitProductModel();
                    if (ds.Tables[0].Rows[n]["SuitProductId"].ToString() != "")
                    {
                        model.SuitProductId = int.Parse(ds.Tables[0].Rows[n]["SuitProductId"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["ProductId"].ToString() != "")
                    {
                        model.ProductId = int.Parse(ds.Tables[0].Rows[n]["ProductId"].ToString());
                    }
                    model.SuitName = ds.Tables[0].Rows[n]["SuitName"].ToString();
                    if (ds.Tables[0].Rows[n]["MerchantPrice"].ToString() != "")
                    {
                        model.MerchantPrice = decimal.Parse(ds.Tables[0].Rows[n]["MerchantPrice"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["TradePrice"].ToString() != "")
                    {
                        model.TradePrice = decimal.Parse(ds.Tables[0].Rows[n]["TradePrice"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Status"].ToString() != "")
                    {
                        model.Status = int.Parse(ds.Tables[0].Rows[n]["Status"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(NoName.NetShop.Model.SuitProductModel model)
 {
     dal.Update(model);
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(NoName.NetShop.Model.SuitProductModel model)
 {
     dal.Add(model);
 }
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<NoName.NetShop.Model.SuitProductModel> GetModelList(string strWhere)
 {
     DataSet ds = dal.GetList(strWhere);
     List<NoName.NetShop.Model.SuitProductModel> modelList = new List<NoName.NetShop.Model.SuitProductModel>();
     int rowsCount = ds.Tables[0].Rows.Count;
     if (rowsCount > 0)
     {
         NoName.NetShop.Model.SuitProductModel model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new NoName.NetShop.Model.SuitProductModel();
             if(ds.Tables[0].Rows[n]["SuitProductId"].ToString()!="")
             {
                 model.SuitProductId=int.Parse(ds.Tables[0].Rows[n]["SuitProductId"].ToString());
             }
             if(ds.Tables[0].Rows[n]["ProductId"].ToString()!="")
             {
                 model.ProductId=int.Parse(ds.Tables[0].Rows[n]["ProductId"].ToString());
             }
             model.SuitName=ds.Tables[0].Rows[n]["SuitName"].ToString();
             if(ds.Tables[0].Rows[n]["MerchantPrice"].ToString()!="")
             {
                 model.MerchantPrice=decimal.Parse(ds.Tables[0].Rows[n]["MerchantPrice"].ToString());
             }
             if(ds.Tables[0].Rows[n]["TradePrice"].ToString()!="")
             {
                 model.TradePrice=decimal.Parse(ds.Tables[0].Rows[n]["TradePrice"].ToString());
             }
             if(ds.Tables[0].Rows[n]["Status"].ToString()!="")
             {
                 model.Status=int.Parse(ds.Tables[0].Rows[n]["Status"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }