/// <summary> /// 获得数据列表 /// </summary> public List <Maticsoft.Model.CMS_Video> DataTableToList(DataTable dt) { List <Maticsoft.Model.CMS_Video> modelList = new List <Maticsoft.Model.CMS_Video>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Maticsoft.Model.CMS_Video model; for (int n = 0; n < rowsCount; n++) { model = new Maticsoft.Model.CMS_Video(); if (dt.Rows[n]["Id"].ToString() != "") { model.Id = int.Parse(dt.Rows[n]["Id"].ToString()); } model.Author = dt.Rows[n]["Author"].ToString(); model.VideoTitle = dt.Rows[n]["VideoTitle"].ToString(); model.VideoDescription = dt.Rows[n]["VideoDescription"].ToString(); model.VideoPath = dt.Rows[n]["VideoPath"].ToString(); model.VideoPicture = dt.Rows[n]["VideoPicture"].ToString(); model.VideoDate = dt.Rows[n]["VideoDate"].ToString(); if (dt.Rows[n]["IsLocal"].ToString() != "") { if ((dt.Rows[n]["IsLocal"].ToString() == "1") || (dt.Rows[n]["IsLocal"].ToString().ToLower() == "true")) { model.IsLocal = true; } else { model.IsLocal = false; } } model.VideoCode = dt.Rows[n]["VideoCode"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Maticsoft.Model.CMS_Video model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.CMS_Video model) { return(dal.Add(model)); }