📄 pro_money.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class admin_pro_money : Sp.baseadmin
{
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
url_name = "冲值中心";
if (!this.IsPostBack)
{
this.bind();
}// 在此处放置用户代码以初始化页面
}
void bind()
{
string id = Request.QueryString["uid"];
Sp.BLL.Sp_user bll = new Sp.BLL.Sp_user();
this.Label1.Text = bll.UserMoney(int.Parse(id)).ToString(); //ds.Tables[0].Rows[0][0].ToString();
//this.mymoney.Text = bll.UserMoney(int.Parse(admin_id)).ToString();//ds.Tables[1].Rows[0][0].ToString();
}
protected void Button_Click(object sender, EventArgs e)
{
Sp.BLL.Sp_user bllmoney = new Sp.BLL.Sp_user();
string id = Request.QueryString["uid"];
//int mymoney = int.Parse(bllmoney.UserMoney(int.Parse(admin_id)).ToString());
int forusermoney = int.Parse(bllmoney.UserMoney(int.Parse(id)).ToString());
string strErr = "";
if (!PageValidate.IsNumberSign(txtTruemoney.Text))
{
strErr += "您输入的不是数字!\\n";
}
if (strErr != "")
{
MessageBox.Show(this, strErr);
return;
}
int Getmoney = int.Parse(txtTruemoney.Text);
//if (mymoney - Getmoney < 0)
//{
// strErr += "您的余额不够,不能给下级冲值!\\n";
//}
if (strErr != "")
{
MessageBox.Show(this, strErr);
return;
}
bool iscanmoney = forusermoney + Getmoney >= 0;
if (iscanmoney)
{
string sql = "update Sp_User set trueMoney=trueMoney+" + Getmoney.ToString() + " where id='" + id + "';";
// + "update Sp_User set trueMoney=trueMoney+" + (-Getmoney).ToString() + " where id='" + admin_id + "'";
Sp.Base.ExecuteSql(sql);
//Response.Write(sql);
decimal money = decimal.Parse(Getmoney.ToString());
string forUid = id;
string proUid = admin_idname;
string Proevent = Getmoney > 0 ? "0" : "1";
DateTime dtt = DateTime.Now;
Sp.Model.Sp_Money_log model = new Sp.Model.Sp_Money_log();
model.money = money;
model.forUid = forUid;
model.proUid = proUid;
model.Proevent = Proevent;
model.dtt = dtt;
Sp.BLL.Sp_Money_log bll = new Sp.BLL.Sp_Money_log();
bll.Add(model);
MessageBox.Show(this.Page, "操作成功,请注意核对余款");
}
else
{
MessageBox.Show(this.Page, "您的余额不够,不能提走此款项");
}
bind();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -