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