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