protected void Page_Load(object sender, EventArgs e) { if (this.Request.QueryString["html"] == null && this.Request.QueryString["id"] == null) { this.ClientScript.RegisterClientScriptBlock(this.GetType(), "_Missing1", "alert('Missing required query string.');window.close();", true); return; } string sHtmlBody = ""; if (this.Request.QueryString["html"] != null) { string sHtmlBody_Encode = this.Request.QueryString["html"].ToString(); sHtmlBody = Encrypter.Base64Decode(sHtmlBody_Encode); } else if (this.Request.QueryString["id"] != null) { int iEmailTemplateID = Convert.ToInt32(this.Request.QueryString["id"]); LPWeb.BLL.Template_Email emailTempMgr = new Template_Email(); LPWeb.Model.Template_Email emailTempModel = emailTempMgr.GetModel(iEmailTemplateID); if (emailTempModel.TemplEmailId > 0) { sHtmlBody = GetEmailTemplateContentWithEmailSkin(emailTempModel.EmailSkinId, emailTempModel.Content); } else { sHtmlBody = emailTempModel.Content; } } this.ltEmailBody.Text = sHtmlBody; }
/// <summary> /// 获得数据列表 /// </summary> public List <LPWeb.Model.Template_Email> DataTableToList(DataTable dt) { List <LPWeb.Model.Template_Email> modelList = new List <LPWeb.Model.Template_Email>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { LPWeb.Model.Template_Email model; for (int n = 0; n < rowsCount; n++) { model = new LPWeb.Model.Template_Email(); if (dt.Rows[n]["TemplEmailId"].ToString() != "") { model.TemplEmailId = int.Parse(dt.Rows[n]["TemplEmailId"].ToString()); } if (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; } } model.Name = dt.Rows[n]["Name"].ToString(); model.Desc = dt.Rows[n]["Desc"].ToString(); if (dt.Rows[n]["FromUserRoles"].ToString() != "") { model.FromUserRoles = int.Parse(dt.Rows[n]["FromUserRoles"].ToString()); } model.FromEmailAddress = dt.Rows[n]["FromEmailAddress"].ToString(); model.Content = dt.Rows[n]["Content"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(LPWeb.Model.Template_Email model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(LPWeb.Model.Template_Email model) { return(dal.Add(model)); }