/// <summary> /// 获得数据列表 /// </summary> public List <NoName.NetShop.Model.ActionProductModel> GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); List <NoName.NetShop.Model.ActionProductModel> modelList = new List <NoName.NetShop.Model.ActionProductModel>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { NoName.NetShop.Model.ActionProductModel model; for (int n = 0; n < rowsCount; n++) { model = new NoName.NetShop.Model.ActionProductModel(); if (ds.Tables[0].Rows[n]["AuctionId"].ToString() != "") { model.AuctionId = int.Parse(ds.Tables[0].Rows[n]["AuctionId"].ToString()); } model.ProductName = ds.Tables[0].Rows[n]["ProductName"].ToString(); model.SmallIamge = ds.Tables[0].Rows[n]["SmallIamge"].ToString(); model.MediumImage = ds.Tables[0].Rows[n]["MediumImage"].ToString(); model.OutLinkUrl = ds.Tables[0].Rows[n]["OutLinkUrl"].ToString(); if (ds.Tables[0].Rows[n]["StartPrice"].ToString() != "") { model.StartPrice = decimal.Parse(ds.Tables[0].Rows[n]["StartPrice"].ToString()); } if (ds.Tables[0].Rows[n]["AddPrices"].ToString() != "") { model.AddPrices = decimal.Parse(ds.Tables[0].Rows[n]["AddPrices"].ToString()); } if (ds.Tables[0].Rows[n]["CurPrice"].ToString() != "") { model.CurPrice = decimal.Parse(ds.Tables[0].Rows[n]["CurPrice"].ToString()); } model.Brief = ds.Tables[0].Rows[n]["Brief"].ToString(); if (ds.Tables[0].Rows[n]["StartTime"].ToString() != "") { model.StartTime = DateTime.Parse(ds.Tables[0].Rows[n]["StartTime"].ToString()); } if (ds.Tables[0].Rows[n]["EndTime"].ToString() != "") { model.EndTime = DateTime.Parse(ds.Tables[0].Rows[n]["EndTime"].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); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(NoName.NetShop.Model.ActionProductModel model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(NoName.NetShop.Model.ActionProductModel model) { dal.Add(model); }