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