/// <summary> /// 获得数据列表 /// </summary> public List <LPWeb.Model.ContactRoles> DataTableToList(DataTable dt) { List <LPWeb.Model.ContactRoles> modelList = new List <LPWeb.Model.ContactRoles>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { LPWeb.Model.ContactRoles model; for (int n = 0; n < rowsCount; n++) { model = new LPWeb.Model.ContactRoles(); if (dt.Rows[n]["ContactRoleId"].ToString() != "") { model.ContactRoleId = int.Parse(dt.Rows[n]["ContactRoleId"].ToString()); } model.Name = dt.Rows[n]["Name"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(LPWeb.Model.ContactRoles model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(LPWeb.Model.ContactRoles model) { return(dal.Add(model)); }