151 lines
6.1 KiB
C#
151 lines
6.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Text;
|
|
|
|
namespace Mtxfw.VipSite
|
|
{
|
|
public partial class Admin_Member_update2 : Mtxfw.Utility.MemberBase
|
|
{
|
|
public Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
|
|
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
|
|
Mtxfw.DAL.user_Results daoResults = new Mtxfw.DAL.user_Results();
|
|
Mtxfw.DAL.user_Results_jl4 daojl4 = new Mtxfw.DAL.user_Results_jl4();
|
|
public int uLevel=0;
|
|
public string strTitle = "级别";
|
|
public int gtype = 0;
|
|
#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);
|
|
string hostname = Request.Url.Host;
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
if (Session["IFPassword"] == null)
|
|
{
|
|
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_update.aspx?ID=" + ID);
|
|
}
|
|
if (IFStores != 1)
|
|
{
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|
}
|
|
if (MemberJS.IndexOf("空单变实单") == -1)
|
|
{
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|
}
|
|
if (Hidd_Url.Value == "")
|
|
{
|
|
Hidd_Url.Value = Request.UrlReferrer.ToString();
|
|
}
|
|
Page.Title = "空单升级 - " + config.webName;
|
|
|
|
}
|
|
if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
|
|
{
|
|
int ID = int.Parse(Request.QueryString["ID"].ToString());
|
|
Mtxfw.Model.user_info model = daoUser.GetModel(ID);
|
|
if (model != null)
|
|
{
|
|
uLevel = model.uLevel;
|
|
if (!IsPostBack)
|
|
{
|
|
Lit_UserName.Text = model.UserName;
|
|
Lit_realname.Text = model.RealName;
|
|
Lit_uLevel.Text = Mtxfw.Utility.Common.GetuLevelname(model.uLevel);
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
Btn_Edit.Click += delegate(object s, EventArgs ex)
|
|
{
|
|
try
|
|
{
|
|
Btn_Edit.Enabled = false;
|
|
int ID = int.Parse(Request.QueryString["ID"].ToString());
|
|
Mtxfw.Model.user_info model = daoUser.GetModel(ID);
|
|
if (model != null)
|
|
{
|
|
bool b = true;
|
|
if (model.uLevel7 == 0)
|
|
{
|
|
b = false;
|
|
Btn_Edit.Enabled = true;
|
|
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('不是空单会员不能进行此操作!');</script>");
|
|
}
|
|
|
|
if (b)
|
|
{
|
|
|
|
|
|
daoUser.UpdateuLevel("uLevel7", 0, model.Id);
|
|
Mtxfw.Model.user_Results_jl4 Modeljl4 = new Mtxfw.Model.user_Results_jl4();
|
|
Modeljl4.MemberId = model.Id;
|
|
Modeljl4.MemberId0 = Card;
|
|
Modeljl4.MemberId1 = model.uLevel;
|
|
Modeljl4.MemberId2 = 0;
|
|
Modeljl4.IFMFSJ = 0;
|
|
Modeljl4.IFUpdateMoney = 0;
|
|
Modeljl4.utype = "7";
|
|
Modeljl4.addtime = DateTime.Now;
|
|
Modeljl4.gtype = gtype;
|
|
int ResultId = new DAL.user_Results_jl4().Add(Modeljl4);
|
|
|
|
//Mtxfw.DAL.MemberStatistics.UpdteSXYJ(config, model.Id, model.SuperiorsIDS, money);
|
|
//Mtxfw.DAL.MemberStatistics.UpdteData(config, model, DateTime.Now, money);
|
|
|
|
Model.User_CZ_log logmodel = new Model.User_CZ_log();
|
|
logmodel.MemberId = Card;
|
|
logmodel.AddTime = DateTime.Now;
|
|
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
|
logmodel.Body = "空单变实单,账户:" + Lit_UserName.Text + ",级别:" + Mtxfw.Utility.Common.GetuLevelname(model.uLevel);
|
|
logmodel.UType = 0;
|
|
logmodel.gtype = gtype;
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('升级成功!');location.replace('" + Hidd_Url.Value + "')</script>");
|
|
}
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('升级错误!');</script>");
|
|
}
|
|
};
|
|
|
|
}
|
|
|
|
|
|
}
|
|
} |