Basf_EProject/EProject/FineUIPro.Web/Email_Send/Email_Params_Edit.aspx.cs

86 lines
3.1 KiB
C#

using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.Email_Send
{
public partial class Email_Params_Edit : PageBase
{
#region
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//按钮权限
GetButtonPower();
Model.Email_Params pops = new Model.Email_Params();
string emailId = Request.Params["id"];
pops = BLL.Email_Send.Email_ParamsService.GetEmail_ParamsPop(emailId);
if (pops != null)
{
//this.lblID.Text = pops.ID;
this.txtMailClassName.Text = pops.MailClassName;
this.txtMailClassID.Text = pops.MailClassID;
}
}
}
#endregion
protected void btnSubmit_Click(object sender, EventArgs e)
{
Model.Email_Params pops = new Model.Email_Params();
string emailId = Request.Params["id"];
pops = BLL.Email_Send.Email_ParamsService.GetEmail_ParamsPop(emailId);
if (pops == null)
{
Email_Params pop = new Email_Params();
pop.MailClassName = this.txtMailClassName.Text;
pop.MailClassID = this.txtMailClassID.Text;
pop.CreateName = this.CurrUser.UserName;
pop.CreateTime = DateTime.Now;
pop.UpdateName = this.CurrUser.UserName;
pop.UpdateTime = DateTime.Now;
BLL.Email_Send.Email_ParamsService.AddEmail_Params(pop);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Add Parameter information");
ShowNotify("Send Successfully!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else {
pops.MailClassName = this.txtMailClassName.Text;
pops.MailClassID = this.txtMailClassID.Text;
pops.CreateName = this.CurrUser.UserName;
pops.UpdateName = this.CurrUser.UserName;
pops.UpdateTime = DateTime.Now;
BLL.Email_Send.Email_ParamsService.UpdateEmail_Params(pops);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Update Parameter information");
ShowNotify("Send Successfully!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
}
#region
/// <summary>
/// 菜单按钮权限
/// </summary>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.MailParametersMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnSubmit.Hidden = false;
}
}
}
#endregion
}
}