/// <summary> /// 获得数据列表 /// </summary> public List <LPWeb.Model.Template_Wfl_CompletionEmails> DataTableToList(DataTable dt) { List <LPWeb.Model.Template_Wfl_CompletionEmails> modelList = new List <LPWeb.Model.Template_Wfl_CompletionEmails>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { LPWeb.Model.Template_Wfl_CompletionEmails model; for (int n = 0; n < rowsCount; n++) { model = new LPWeb.Model.Template_Wfl_CompletionEmails(); if (dt.Rows[n]["CompletionEmailId"] != null && dt.Rows[n]["CompletionEmailId"].ToString() != "") { model.CompletionEmailId = int.Parse(dt.Rows[n]["CompletionEmailId"].ToString()); } if (dt.Rows[n]["TemplTaskid"] != null && dt.Rows[n]["TemplTaskid"].ToString() != "") { model.TemplTaskid = int.Parse(dt.Rows[n]["TemplTaskid"].ToString()); } if (dt.Rows[n]["TemplEmailId"] != null && dt.Rows[n]["TemplEmailId"].ToString() != "") { model.TemplEmailId = int.Parse(dt.Rows[n]["TemplEmailId"].ToString()); } if (dt.Rows[n]["Enabled"] != null && dt.Rows[n]["Enabled"].ToString() != "") { if ((dt.Rows[n]["Enabled"].ToString() == "1") || (dt.Rows[n]["Enabled"].ToString().ToLower() == "true")) { model.Enabled = true; } else { model.Enabled = false; } } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(LPWeb.Model.Template_Wfl_CompletionEmails model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(LPWeb.Model.Template_Wfl_CompletionEmails model) { return(dal.Add(model)); }