/// <summary> /// 获得数据列表 /// </summary> public List <Maticsoft.Model.ZiXunInfo> DataTableToList(DataTable dt) { List <Maticsoft.Model.ZiXunInfo> modelList = new List <Maticsoft.Model.ZiXunInfo>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Maticsoft.Model.ZiXunInfo model; for (int n = 0; n < rowsCount; n++) { model = new Maticsoft.Model.ZiXunInfo(); if (dt.Rows[n]["zixunID"].ToString() != "") { model.zixunID = int.Parse(dt.Rows[n]["zixunID"].ToString()); } model.zixunTitle = dt.Rows[n]["zixunTitle"].ToString(); if (dt.Rows[n]["zixuntime"].ToString() != "") { model.zixuntime = DateTime.Parse(dt.Rows[n]["zixuntime"].ToString()); } model.zixuncontent = dt.Rows[n]["zixuncontent"].ToString(); model.zixunUserName = dt.Rows[n]["zixunUserName"].ToString(); model.zixunuserPhoto = dt.Rows[n]["zixunuserPhoto"].ToString(); model.ZiXundaan = dt.Rows[n]["ZiXundaan"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Maticsoft.Model.ZiXunInfo model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.ZiXunInfo model) { return(dal.Add(model)); }