/// <summary> /// 获得数据列表 /// </summary> public List <NoName.NetShop.Model.ProductImageModel> GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); List <NoName.NetShop.Model.ProductImageModel> modelList = new List <NoName.NetShop.Model.ProductImageModel>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { NoName.NetShop.Model.ProductImageModel model; for (int n = 0; n < rowsCount; n++) { model = new NoName.NetShop.Model.ProductImageModel(); if (ds.Tables[0].Rows[n]["ImageId"].ToString() != "") { model.ImageId = int.Parse(ds.Tables[0].Rows[n]["ImageId"].ToString()); } if (ds.Tables[0].Rows[n]["ProductId"].ToString() != "") { model.ProductId = int.Parse(ds.Tables[0].Rows[n]["ProductId"].ToString()); } model.SmallImage = ds.Tables[0].Rows[n]["SmallImage"].ToString(); model.LargeImage = ds.Tables[0].Rows[n]["LargeImage"].ToString(); model.OriginImage = ds.Tables[0].Rows[n]["OriginImage"].ToString(); model.Title = ds.Tables[0].Rows[n]["Title"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// ��������б� /// </summary> public List<NoName.NetShop.Model.ProductImageModel> GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); List<NoName.NetShop.Model.ProductImageModel> modelList = new List<NoName.NetShop.Model.ProductImageModel>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { NoName.NetShop.Model.ProductImageModel model; for (int n = 0; n < rowsCount; n++) { model = new NoName.NetShop.Model.ProductImageModel(); if(ds.Tables[0].Rows[n]["ImageId"].ToString()!="") { model.ImageId=int.Parse(ds.Tables[0].Rows[n]["ImageId"].ToString()); } if(ds.Tables[0].Rows[n]["ProductId"].ToString()!="") { model.ProductId=int.Parse(ds.Tables[0].Rows[n]["ProductId"].ToString()); } model.SmallImage=ds.Tables[0].Rows[n]["SmallImage"].ToString(); model.LargeImage=ds.Tables[0].Rows[n]["LargeImage"].ToString(); model.OriginImage=ds.Tables[0].Rows[n]["OriginImage"].ToString(); model.Title=ds.Tables[0].Rows[n]["Title"].ToString(); modelList.Add(model); } } return modelList; }
/// <summary> /// 更新一条数据 /// </summary> public void Update(NoName.NetShop.Model.ProductImageModel model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(NoName.NetShop.Model.ProductImageModel model) { dal.Add(model); }