77 lines
2.5 KiB
C#
77 lines
2.5 KiB
C#
using BLL;
|
|
using Model;
|
|
using System;
|
|
using System.Linq;
|
|
|
|
namespace FineUIPro.Web.SendEmail
|
|
{
|
|
public partial class SendEmailPop : PageBase
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
GetButtonPower();
|
|
EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
|
|
if (pops != null)
|
|
{
|
|
EmailFwq.Text = pops.EmailFwq;
|
|
EmailDk.Text = pops.EmailDk;
|
|
EmailYx.Text = pops.EmailYx;
|
|
EmailUsername.Text = pops.EmailUsername;
|
|
EmailPass.Text = pops.EmailPass;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存,修改
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnSubmit_Click(object sender, EventArgs e)
|
|
{
|
|
var insertType = 0;
|
|
Model.EmailPop pop = Funs.DB.EmailPop.FirstOrDefault(p => p.EmailID == BLL.Const.EmailPopId);
|
|
if (pop == null)
|
|
{
|
|
insertType = 1;
|
|
pop = new EmailPop();
|
|
pop.EmailID = BLL.Const.EmailPopId;
|
|
}
|
|
pop.EmailFwq = EmailFwq.Text.Trim();
|
|
pop.EmailDk = EmailDk.Text.Trim();
|
|
pop.EmailYx = EmailYx.Text.Trim();
|
|
pop.EmailUsername = EmailUsername.Text.Trim();
|
|
pop.EmailPass = EmailPass.Text.Trim();
|
|
pop.CreateTime = DateTime.Now.ToString();
|
|
pop.CreateName = CurrUser.UserName;
|
|
pop.UpdateTime = DateTime.Now.ToString();
|
|
pop.UpdateName = CurrUser.UserName;
|
|
if (insertType == 1)
|
|
{
|
|
Funs.DB.EmailPop.InsertOnSubmit(pop);
|
|
}
|
|
Funs.DB.SubmitChanges();
|
|
|
|
ShowNotify("Save Successfully!", MessageBoxIcon.Success);
|
|
}
|
|
|
|
#region 权限设置
|
|
/// <summary>
|
|
/// 菜单按钮权限
|
|
/// </summary>
|
|
private void GetButtonPower()
|
|
{
|
|
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.SendEmailPopMenuId);
|
|
if (buttonList.Count() > 0)
|
|
{
|
|
if (buttonList.Contains(BLL.Const.BtnSave))
|
|
{
|
|
this.btnSubmit.Hidden = false;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
} |