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

            if (rowsCount > 0)
            {
                NoName.NetShop.Model.OrderItemModel model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new NoName.NetShop.Model.OrderItemModel();
                    if (ds.Tables[0].Rows[n]["OrderId"].ToString() != "")
                    {
                        model.OrderId = int.Parse(ds.Tables[0].Rows[n]["OrderId"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["OrderItem"].ToString() != "")
                    {
                        model.OrderItem = int.Parse(ds.Tables[0].Rows[n]["OrderItem"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["ProductId"].ToString() != "")
                    {
                        model.ProductId = int.Parse(ds.Tables[0].Rows[n]["ProductId"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["ProductFee"].ToString() != "")
                    {
                        model.ProductFee = decimal.Parse(ds.Tables[0].Rows[n]["ProductFee"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Quantity"].ToString() != "")
                    {
                        model.Quantity = int.Parse(ds.Tables[0].Rows[n]["Quantity"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["DerateFee"].ToString() != "")
                    {
                        model.DerateFee = decimal.Parse(ds.Tables[0].Rows[n]["DerateFee"].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]["TotalFee"].ToString() != "")
                    {
                        model.TotalFee = decimal.Parse(ds.Tables[0].Rows[n]["TotalFee"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<NoName.NetShop.Model.OrderItemModel> GetModelList(string strWhere)
 {
     DataSet ds = dal.GetList(strWhere);
     List<NoName.NetShop.Model.OrderItemModel> modelList = new List<NoName.NetShop.Model.OrderItemModel>();
     int rowsCount = ds.Tables[0].Rows.Count;
     if (rowsCount > 0)
     {
         NoName.NetShop.Model.OrderItemModel model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new NoName.NetShop.Model.OrderItemModel();
             if(ds.Tables[0].Rows[n]["OrderId"].ToString()!="")
             {
                 model.OrderId=int.Parse(ds.Tables[0].Rows[n]["OrderId"].ToString());
             }
             if(ds.Tables[0].Rows[n]["OrderItem"].ToString()!="")
             {
                 model.OrderItem=int.Parse(ds.Tables[0].Rows[n]["OrderItem"].ToString());
             }
             if(ds.Tables[0].Rows[n]["ProductId"].ToString()!="")
             {
                 model.ProductId=int.Parse(ds.Tables[0].Rows[n]["ProductId"].ToString());
             }
             if(ds.Tables[0].Rows[n]["ProductFee"].ToString()!="")
             {
                 model.ProductFee=decimal.Parse(ds.Tables[0].Rows[n]["ProductFee"].ToString());
             }
             if(ds.Tables[0].Rows[n]["Quantity"].ToString()!="")
             {
                 model.Quantity=int.Parse(ds.Tables[0].Rows[n]["Quantity"].ToString());
             }
             if(ds.Tables[0].Rows[n]["DerateFee"].ToString()!="")
             {
                 model.DerateFee=decimal.Parse(ds.Tables[0].Rows[n]["DerateFee"].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]["TotalFee"].ToString()!="")
             {
                 model.TotalFee=decimal.Parse(ds.Tables[0].Rows[n]["TotalFee"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
示例#3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(NoName.NetShop.Model.OrderItemModel model)
 {
     dal.Update(model);
 }
示例#4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(NoName.NetShop.Model.OrderItemModel model)
 {
     dal.Add(model);
 }