/// <summary> /// 获得数据列表 /// </summary> public List <NoName.NetShop.Model.CommendModel> GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); List <NoName.NetShop.Model.CommendModel> modelList = new List <NoName.NetShop.Model.CommendModel>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { NoName.NetShop.Model.CommendModel model; for (int n = 0; n < rowsCount; n++) { model = new NoName.NetShop.Model.CommendModel(); if (ds.Tables[0].Rows[n]["SchemeId"].ToString() != "") { model.SchemeId = int.Parse(ds.Tables[0].Rows[n]["SchemeId"].ToString()); } if (ds.Tables[0].Rows[n]["CateId"].ToString() != "") { model.CateId = int.Parse(ds.Tables[0].Rows[n]["CateId"].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]["Quantity"].ToString() != "") { model.Quantity = int.Parse(ds.Tables[0].Rows[n]["Quantity"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(NoName.NetShop.Model.CommendModel model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(NoName.NetShop.Model.CommendModel model) { dal.Add(model); }