📄 minusvaliddate.aspx.cs
字号:
namespace PowerEasy.WebSite.Admin.User
{
using PowerEasy.Common;
using PowerEasy.Controls;
using PowerEasy.UserManage;
using PowerEasy.Web.UI;
using PowerEasy.WebSite.Controls;
using System;
using System.Web.UI.WebControls;
public class MinusValidDate : AdminPage
{
protected DropDownList DropValidUnit;
protected Button EBtnSubmit;
protected HiddenField HdnUsersId;
protected Label LblTitle;
protected Label LblValid;
protected RadioButton RadValidType;
protected RadioButton RadValidType2;
protected ShowUserInfo showUserInfo;
protected ExtendedSiteMapPath SmpNavigator;
protected TextBox TxtMemo;
protected TextBox TxtReason;
protected TextBox TxtValidNum;
protected PowerEasy.Controls.RequiredFieldValidator ValrReason;
protected void EBtnSubmit_Click(object sender, EventArgs e)
{
int num3;
IEncourageStrategy<int> strategy;
string toUser = this.HdnUsersId.Value;
int num = DataConverter.CLng(this.TxtValidNum.Text.Trim());
int num2 = DataConverter.CLng(this.DropValidUnit.SelectedValue);
string reason = this.TxtReason.Text.Trim();
string text = this.TxtMemo.Text;
if (this.RadValidType.Checked && ((num <= 0) || (num > 0x270f)))
{
AdminPage.WriteErrMsg("<li>指定期限必须为数字并且必须大于0小于9999!</li>");
}
if (this.RadValidType.Checked)
{
switch (num2)
{
case 1:
num3 = num;
goto Label_00BF;
case 2:
num3 = num * 30;
goto Label_00BF;
case 3:
num3 = num * 0x16d;
goto Label_00BF;
}
num3 = num;
}
else
{
num3 = 0x270f;
}
Label_00BF:
strategy = new UserDate();
if (strategy.IncreaseForUsers(toUser, -num3, reason, true, text))
{
AdminPage.WriteSuccessMsg("<li>用户扣除有效期成功!</li>", "UserShow.aspx?UserID=" + toUser);
}
else
{
AdminPage.WriteErrMsg("<li>用户扣除有效期失败!</li>");
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!base.IsPostBack)
{
this.HdnUsersId.Value = BasePage.RequestInt32("UserID").ToString();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -