📄 addpoint.cs
字号:
namespace PowerEasy.WebSite.Admin.User
{
using PowerEasy.Common;
using PowerEasy.Controls;
using PowerEasy.Model.UserManage;
using PowerEasy.ModelControls;
using PowerEasy.UserManage;
using PowerEasy.Web.UI;
using PowerEasy.WebSite.Controls;
using System;
using System.Web.UI.WebControls;
public class AddPoint : AdminPage
{
protected Button EBtnSubmit;
protected Label LblTitle;
protected string m_PointName = SiteConfig.UserConfig.PointName;
protected PowerEasy.ModelControls.ShowPointName ShowPointName;
protected ShowUserInfo showUserInfo;
protected ExtendedSiteMapPath SmpNavigator;
protected TextBox TxtMemo;
protected TextBox TxtPoint;
protected TextBox TxtReason;
protected RegularExpressionValidator ValgPoint;
protected PowerEasy.Controls.RequiredFieldValidator ValrPoint;
protected PowerEasy.Controls.RequiredFieldValidator ValrReason;
protected void EBtnSubmit_Click(object sender, EventArgs e)
{
UserInfo userInfo = this.showUserInfo.UserInfo;
string reason = this.TxtReason.Text.Trim();
string text = this.TxtMemo.Text;
if (this.Page.IsValid)
{
int howMany = DataConverter.CLng(this.TxtPoint.Text);
if (userInfo == null)
{
AdminPage.WriteErrMsg("<li>找不到指定的会员!</li>");
}
else
{
IEncourageStrategy<int> strategy = new UserPoint();
if (strategy.IncreaseForUsers(userInfo.UserId.ToString(), howMany, reason, true, text))
{
AdminPage.WriteSuccessMsg("<li>会员奖励" + this.m_PointName + "成功!</li>", "UserShow.aspx?UserID=" + userInfo.UserId);
}
else
{
AdminPage.WriteErrMsg("<li>会员奖励" + this.m_PointName + "失败!</li>");
}
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
this.LblTitle.Text = "奖励" + this.m_PointName;
this.ValrPoint.ErrorMessage = "奖励" + this.m_PointName + "不能为空";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -