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