本文整理汇总了C#中Users.AddUserBalanceManual方法的典型用法代码示例。如果您正苦于以下问题:C# Users.AddUserBalanceManual方法的具体用法?C# Users.AddUserBalanceManual怎么用?C# Users.AddUserBalanceManual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Users
的用法示例。
在下文中一共展示了Users.AddUserBalanceManual方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnGO_Click
protected void btnGO_Click(object sender, EventArgs e)
{
long SiteID = Shove._Convert.StrToLong(ddlSites.SelectedValue, -1);
if (SiteID < 0)
{
Shove._Web.JavaScript.Alert(this.Page, "请输入有效的站点编号。");
return;
}
if (tbUserName.Text.Trim() == "")
{
Shove._Web.JavaScript.Alert(this.Page, "请输入用户名称。");
return;
}
double Money = Shove._Convert.StrToDouble(tbMoney.Text, 0);
if (Money == 0)
{
Shove._Web.JavaScript.Alert(this.Page, "请输入有效的金额。");
return;
}
Users tu = new Users(SiteID)[SiteID, tbUserName.Text.Trim()];
if (tu == null)
{
PF.GoError(ErrorNumber.Unknow, "用户不存在", "Admin_UserAddMoney");
return;
}
string Message = "手工充值";
string ReturnDescription = "";
if (rb2.Checked)
{
Message += ",获得的奖励";
}
else if (rb3.Checked)
{
Message += ",购彩";
}
else if (rb4.Checked)
{
Message += ",预付款";
}
else if (rb5.Checked)
{
Message += ",转帐户";
}
else if (rb6.Checked)
{
Message += ",擂台奖励";
}
if (tbMessage.Text.Trim() != "")
{
Message += "," + tbMessage.Text.Trim();
}
if (tu.AddUserBalanceManual(Money, Message, _User.ID, ref ReturnDescription) < 0)
{
PF.GoError(ErrorNumber.Unknow, ReturnDescription, "Admin_UserAddMoney");
return;
}
if (rb6.Checked)
{
DAL.Tables.T_ChallengeBetRed t_ChallengeBetRed = new DAL.Tables.T_ChallengeBetRed();
// 获取用户当前奖金
string TotalMoney = Shove.Database.MSSQL.ExecuteScalar("select TotalWinMoney from T_ChallengeBetRed where UserId = " + tu.ID.ToString()) + "";
t_ChallengeBetRed.TotalWinMoney.Value = Shove._Convert.StrToDouble(TotalMoney, 0) + Money;
t_ChallengeBetRed.Update("UserId = " + tu.ID.ToString());
// 清楚擂台缓存
Shove._Web.Cache.ClearCache("DataCache_Challenge_72_BetHot");
}
tbUserName.Text = "";
tbMoney.Text = "";
tbMessage.Text = "";
Shove._Web.JavaScript.Alert(this, "为用户充值成功。");
}
示例2: btnGO_Click
protected void btnGO_Click(object sender, EventArgs e)
{
long siteid = _Convert.StrToLong(this.ddlSites.SelectedValue, -1L);
if (siteid < 0L)
{
JavaScript.Alert(this.Page, "请输入有效的站点编号。");
}
else if (this.tbUserName.Text.Trim() == "")
{
JavaScript.Alert(this.Page, "请输入用户名称。");
}
else
{
double money = _Convert.StrToDouble(this.tbMoney.Text, 0.0);
if (money == 0.0)
{
JavaScript.Alert(this.Page, "请输入有效的金额。");
}
else
{
Users users = new Users(siteid)[siteid, this.tbUserName.Text.Trim()];
if (users == null)
{
PF.GoError(1, "用户不存在", "Admin_UserAddMoney");
}
else
{
string memo = "手工充值";
string returnDescription = "";
if (this.rb2.Checked)
{
memo = memo + ",获得的奖励";
}
else if (this.rb3.Checked)
{
memo = memo + ",购彩";
}
else if (this.rb4.Checked)
{
memo = memo + ",预付款";
}
else if (this.rb5.Checked)
{
memo = memo + ",转帐户";
}
if (this.tbMessage.Text.Trim() != "")
{
memo = memo + "," + this.tbMessage.Text.Trim();
}
if (users.AddUserBalanceManual(money, memo, base._User.ID, ref returnDescription) < 0)
{
PF.GoError(1, returnDescription, "Admin_UserAddMoney");
}
else
{
this.tbUserName.Text = "";
this.tbMoney.Text = "";
this.tbMessage.Text = "";
JavaScript.Alert(this, "为用户充值成功。");
}
}
}
}
}