/// <summary> /// 获得数据列表 /// </summary> public List <LPWeb.Model.EmailQue> DataTableToList(DataTable dt) { List <LPWeb.Model.EmailQue> modelList = new List <LPWeb.Model.EmailQue>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { LPWeb.Model.EmailQue model; for (int n = 0; n < rowsCount; n++) { model = new LPWeb.Model.EmailQue(); if (dt.Rows[n]["EmailId"].ToString() != "") { model.EmailId = int.Parse(dt.Rows[n]["EmailId"].ToString()); } model.ToUser = dt.Rows[n]["ToUser"].ToString(); model.ToContact = dt.Rows[n]["ToContact"].ToString(); model.ToBorrower = dt.Rows[n]["ToBorrower"].ToString(); if (dt.Rows[n]["EmailTmplId"].ToString() != "") { model.EmailTmplId = int.Parse(dt.Rows[n]["EmailTmplId"].ToString()); } if (dt.Rows[n]["LoanAlertId"].ToString() != "") { model.LoanAlertId = int.Parse(dt.Rows[n]["LoanAlertId"].ToString()); } if (dt.Rows[n]["FileId"].ToString() != "") { model.FileId = int.Parse(dt.Rows[n]["FileId"].ToString()); } if (dt.Rows[n]["AlertEmailType"].ToString() != "") { model.AlertEmailType = int.Parse(dt.Rows[n]["AlertEmailType"].ToString()); } if (dt.Rows[n]["EmailBody"].ToString() != "") { model.EmailBody = (byte[])dt.Rows[n]["EmailBody"]; } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(LPWeb.Model.EmailQue model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(LPWeb.Model.EmailQue model) { return(dal.Add(model)); }