/// <summary> /// 获得数据列表 /// </summary> public List <Maticsoft.Model.WeiLanInfo> DataTableToList(DataTable dt) { List <Maticsoft.Model.WeiLanInfo> modelList = new List <Maticsoft.Model.WeiLanInfo>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Maticsoft.Model.WeiLanInfo model; for (int n = 0; n < rowsCount; n++) { model = new Maticsoft.Model.WeiLanInfo(); if (dt.Rows[n]["WeiID"].ToString() != "") { model.WeiID = int.Parse(dt.Rows[n]["WeiID"].ToString()); } model.WeiTitle = dt.Rows[n]["WeiTitle"].ToString(); model.WeiKey = dt.Rows[n]["WeiKey"].ToString(); if (dt.Rows[n]["Fatime"].ToString() != "") { model.Fatime = DateTime.Parse(dt.Rows[n]["Fatime"].ToString()); } model.Write = dt.Rows[n]["Write"].ToString(); if (dt.Rows[n]["HitNum"].ToString() != "") { model.HitNum = int.Parse(dt.Rows[n]["HitNum"].ToString()); } model.Weicontent = dt.Rows[n]["Weicontent"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Maticsoft.Model.WeiLanInfo model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.WeiLanInfo model) { return(dal.Add(model)); }