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