/// <summary> /// 获得数据列表 /// </summary> public List <Tc.Model.TcLiuyan> DataTableToList(DataTable dt) { List <Tc.Model.TcLiuyan> modelList = new List <Tc.Model.TcLiuyan>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Tc.Model.TcLiuyan model; for (int n = 0; n < rowsCount; n++) { model = new Tc.Model.TcLiuyan(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } model.Xingming = dt.Rows[n]["Xingming"].ToString(); model.QQ = dt.Rows[n]["QQ"].ToString(); model.GongsiMc = dt.Rows[n]["GongsiMc"].ToString(); model.Email = dt.Rows[n]["Email"].ToString(); model.Dianhua = dt.Rows[n]["Dianhua"].ToString(); model.Dizhi = dt.Rows[n]["Dizhi"].ToString(); model.Neirong = dt.Rows[n]["Neirong"].ToString(); if (dt.Rows[n]["RukuSj"].ToString() != "") { model.RukuSj = DateTime.Parse(dt.Rows[n]["RukuSj"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Tc.Model.TcLiuyan model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Tc.Model.TcLiuyan model) { return(dal.Add(model)); }