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