/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.Information.Tb_Information_ConsumerGuid> DataTableToList(DataTable dt) { List <MobileSoft.Model.Information.Tb_Information_ConsumerGuid> modelList = new List <MobileSoft.Model.Information.Tb_Information_ConsumerGuid>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.Information.Tb_Information_ConsumerGuid model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.Information.Tb_Information_ConsumerGuid(); //model.GuideId=dt.Rows[n]["GuideId"].ToString(); //model.BussId=dt.Rows[n]["BussId"].ToString(); model.Title = dt.Rows[n]["Title"].ToString(); model.GudPublisher = dt.Rows[n]["GudPublisher"].ToString(); if (dt.Rows[n]["PubulishDate"].ToString() != "") { model.PubulishDate = DateTime.Parse(dt.Rows[n]["PubulishDate"].ToString()); } model.GudContent = dt.Rows[n]["GudContent"].ToString(); model.GudImage = dt.Rows[n]["GudImage"].ToString(); //model.NumID=dt.Rows[n]["NumID"].ToString(); if (dt.Rows[n]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.Information.Tb_Information_ConsumerGuid model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public long Add(MobileSoft.Model.Information.Tb_Information_ConsumerGuid model) { return(dal.Add(model)); }