首次推送
This commit is contained in:
170
Mtxfw.shop/Member_Currencytocash.aspx.cs
Normal file
170
Mtxfw.shop/Member_Currencytocash.aspx.cs
Normal file
@@ -0,0 +1,170 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Text;
|
||||
|
||||
namespace Mtxfw.shop
|
||||
{
|
||||
public partial class Member_Currencytocash : Mtxfw.Utility.MemberBase
|
||||
{
|
||||
Mtxfw.DAL.user_bank daoBank = new Mtxfw.DAL.user_bank();
|
||||
Mtxfw.DAL.user_info daouser = new Mtxfw.DAL.user_info();
|
||||
Mtxfw.DAL.user_Results_jl2 daoResults2 = new Mtxfw.DAL.user_Results_jl2();
|
||||
|
||||
#region 判断页面是否刷新
|
||||
private bool _refreshState;
|
||||
private bool _isRefresh;
|
||||
|
||||
/// <summary>
|
||||
/// 判断页面是否刷新
|
||||
/// </summary>
|
||||
public bool IsRefresh
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isRefresh;
|
||||
}
|
||||
}
|
||||
protected override void LoadViewState(object savedState)
|
||||
{
|
||||
object[] allStates = (object[])savedState;
|
||||
base.LoadViewState(allStates[0]);
|
||||
_refreshState = (bool)allStates[1];
|
||||
_isRefresh = _refreshState == (bool)Session["__ISREFRESH"];
|
||||
}
|
||||
protected override object SaveViewState()
|
||||
{
|
||||
Session["__ISREFRESH"] = _refreshState;
|
||||
object[] allStates = new object[2];
|
||||
allStates[0] = base.SaveViewState();
|
||||
allStates[1] = !_refreshState;
|
||||
return allStates;
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Page.Title = "申请提现消费币 - " + GetWebName;
|
||||
Mtxfw.Model.user_info umodel = daouser.GetModel(Card);
|
||||
if (umodel != null)
|
||||
{
|
||||
if (umodel.uLevel8 == 1)
|
||||
{
|
||||
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('账户被冻结!');location.replace('/Member_Index.aspx');</script>");
|
||||
}
|
||||
|
||||
text_Integral.Text = (umodel.umoney28 - umodel.umoney29).ToString("f2");
|
||||
|
||||
Label_JF.Text = (umodel.umoney28 - umodel.umoney29).ToString("f2");
|
||||
}
|
||||
Mtxfw.Model.user_bank model = daoBank.GetModelByMemberID(Card);
|
||||
if (model != null)
|
||||
{
|
||||
Text_Bank.Text = "收款人姓名:" + model.PayeeName + " 银行卡号:" + model.BankCard + " 开户银行:" + model.Mobile + "开户地址:" + new Mtxfw.DAL.province().GetProvince(model.Province) + model.BankName;
|
||||
}
|
||||
else
|
||||
{
|
||||
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('必须完善银行资料才能提现!');location.replace('/Member_Bank.aspx?Url=/Member_Currencytocash.aspx');</script>");
|
||||
}
|
||||
}
|
||||
|
||||
Btn_Save.Click += delegate(object s, EventArgs ex)
|
||||
{
|
||||
Btn_Save.Enabled = false;
|
||||
Btn_Save.Text = "提交中...";
|
||||
bool b=true;
|
||||
|
||||
if (Text_MM2.Text.Trim() == "")
|
||||
{
|
||||
b = false;
|
||||
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('二级密码不能为空!');</script>");
|
||||
}
|
||||
if (b)
|
||||
{
|
||||
if (Text_Pay.Text.Trim() == "")
|
||||
{
|
||||
b = false;
|
||||
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('提现金额不能为空!');</script>");
|
||||
}
|
||||
}
|
||||
Mtxfw.Model.user_info umodel = daouser.GetModel(Card);
|
||||
if (umodel != null)
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
if (umodel.Password2 != Mtxfw.Utility.Security.EncryptString(Text_MM2.Text.Trim()))
|
||||
{
|
||||
b = false;
|
||||
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('二级密码不正确!');</script>");
|
||||
}
|
||||
}
|
||||
if (b)
|
||||
{
|
||||
if (Text_Pay.Text.Trim() != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Convert.ToInt32(Text_Pay.Text) < 100)
|
||||
{
|
||||
b = false;
|
||||
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('提现金额不能少于100!');</script>");
|
||||
}
|
||||
Label_JF.Text = (umodel.umoney28 - umodel.umoney29).ToString("f2");
|
||||
if (b)
|
||||
{
|
||||
if (Convert.ToDouble(Text_Pay.Text) > Convert.ToDouble(Label_JF.Text))
|
||||
{
|
||||
b = false;
|
||||
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('消费币余额不足!');</script>");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
b = false;
|
||||
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('提现金额必须为整数!');</script>");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (b && IsRefresh == false)
|
||||
{
|
||||
//daouser.UpdatePhoneTime3("", Card);
|
||||
Double money = Convert.ToDouble(Text_Pay.Text);
|
||||
Double umoney28 = (umodel.umoney28 - umodel.umoney29);
|
||||
Model.user_Results_jl2 mjl2 = new Model.user_Results_jl2();
|
||||
mjl2.MemberId = Card;
|
||||
mjl2.MemberId2 = 0;
|
||||
mjl2.Addmoney = 0;
|
||||
mjl2.Cutmoney = -money;
|
||||
mjl2.Totalmoney = umoney28 - money;
|
||||
mjl2.addtime = DateTime.Now;
|
||||
mjl2.BZContent = "申请提现消费币";
|
||||
mjl2.PayID = "";
|
||||
mjl2.OrdersIDs = "";
|
||||
mjl2.OrdersID = 0;
|
||||
mjl2.utype = 0;
|
||||
mjl2.utype2 = 2;
|
||||
mjl2.Seef = 0;
|
||||
mjl2.seeftime = DateTime.Now;
|
||||
new DAL.user_Results_jl2().Add(mjl2);
|
||||
daouser.UpdateMoney("umoney29", money, Card);
|
||||
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('提交成功!');location.replace('"+ Request.Url.AbsoluteUri+"');</script>");
|
||||
}
|
||||
else
|
||||
{
|
||||
Btn_Save.Enabled = true;
|
||||
Btn_Save.Text = "确认提交";
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user