代码修改后的版本,全部提交
This commit is contained in:
164
Mtxfw.VipSite/admin_member_delete.aspx.cs
Normal file
164
Mtxfw.VipSite/admin_member_delete.aspx.cs
Normal file
@@ -0,0 +1,164 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
namespace Mtxfw.VipSite
|
||||
{
|
||||
public partial class admin_member_delete : Mtxfw.Utility.MemberBase
|
||||
{
|
||||
public Mtxfw.DAL.user_Results_jl4 daojl = new Mtxfw.DAL.user_Results_jl4();
|
||||
public Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
|
||||
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
|
||||
Mtxfw.DAL.user_bank daoBank = new Mtxfw.DAL.user_bank();
|
||||
protected String pid, cid, qid;
|
||||
public int gtype = 0;
|
||||
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_delete.aspx");
|
||||
}
|
||||
if (IFStores != 1)
|
||||
{
|
||||
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
||||
}
|
||||
if (MemberJS.IndexOf("删除会员") == -1)
|
||||
{
|
||||
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
||||
}
|
||||
if (Request.UrlReferrer != null)
|
||||
{
|
||||
if (Request.UrlReferrer.ToString().IndexOf("admin_member_delete.aspx") != -1)
|
||||
{
|
||||
Hidd_Url.Value = Request.UrlReferrer.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
Hidd_Url.Value = "/Admin_Member_List.aspx";
|
||||
}
|
||||
}
|
||||
Page.Title = "删除会员 - " + config.webName;
|
||||
|
||||
if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
|
||||
{
|
||||
int ID = int.Parse(Request.QueryString["ID"].ToString());
|
||||
if (daoUser.GetCount("ContactID=" + ID + "") > 0)
|
||||
{
|
||||
//ifshowtx.Visible = true;
|
||||
Mtxfw.Utility.Tools.Message("此会员包含下级,请先删除下级会员!", Hidd_Url.Value);
|
||||
}
|
||||
/*if (new Mtxfw.DAL.user_Results().GetCount("utype='12' And MemberId=" + ID) > 0)
|
||||
{
|
||||
Mtxfw.Utility.Tools.Message("已购买会员不能删除!", Hidd_Url.Value);
|
||||
}*/
|
||||
Mtxfw.Model.user_info model = daoUser.GetModel(ID);
|
||||
if (model != null)
|
||||
{
|
||||
|
||||
txtUserID.Text = model.UserName + "(" + model.RealName + ")";
|
||||
|
||||
Mtxfw.Model.user_info tjmodel = daoUser.GetModel(model.ContactID);
|
||||
if (tjmodel != null)
|
||||
{
|
||||
txtUserID2.Text = tjmodel.UserName + "(" + tjmodel.RealName + ")";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Btn_Edit.Click += delegate(object s, EventArgs ex)
|
||||
{
|
||||
Btn_Edit.Enabled = false;
|
||||
if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
|
||||
{
|
||||
int Id = Convert.ToInt32(Request.QueryString["ID"]);
|
||||
//if (new Mtxfw.DAL.user_Results().GetCount("utype='12' And MemberId=" + Id) == 0)
|
||||
//{
|
||||
Mtxfw.Model.user_info model = daoUser.GetModel(Id);
|
||||
if (model != null)
|
||||
{
|
||||
if (model.UserState == "正常")
|
||||
{
|
||||
daoUser.UpdatePassword("UserState", "正在删除", model.Id);
|
||||
|
||||
daoUser.Delete(model.Id);
|
||||
|
||||
DateTime dt = DateTime.Now;
|
||||
if (model.IFStores != 4)
|
||||
{
|
||||
if (model.uLevel14 == 1)
|
||||
{
|
||||
Mtxfw.Model.user_Results_jl4 Modeljl4;
|
||||
|
||||
string[] ASuperiorsIDS = (model.SuperiorsIDS).Split(',');
|
||||
|
||||
DataSet ds;
|
||||
//降级
|
||||
for (int ak = ASuperiorsIDS.Length - 2; ak > 0; ak--)
|
||||
{
|
||||
if (ASuperiorsIDS[ak] != "")
|
||||
{
|
||||
ds = daoUser.GetList1("ID,uLevel,uLevel24,IFBecomeAgents,umoney33,ContactIDS", "uutype='0' And UserState='正常' And IFStores=0 And id=" + ASuperiorsIDS[ak]);
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
int dID = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"].ToString());
|
||||
int YuLevel = Convert.ToInt32(ds.Tables[0].Rows[0]["uLevel"].ToString());
|
||||
int YuLevel24 = Convert.ToInt32(ds.Tables[0].Rows[0]["uLevel24"].ToString());
|
||||
int YIFBecomeAgents = Convert.ToInt32(ds.Tables[0].Rows[0]["IFBecomeAgents"].ToString());
|
||||
int dumoney33 = Convert.ToInt32(ds.Tables[0].Rows[0]["umoney33"].ToString().Split('.')[0]);
|
||||
string dContactIDS = ds.Tables[0].Rows[0]["ContactIDS"].ToString();
|
||||
daoUser.UpdateMoney("umoney18", -model.umoney18, dID);
|
||||
}
|
||||
ds.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
Modeljl4 = new Mtxfw.Model.user_Results_jl4();
|
||||
Modeljl4.MemberName = txtUserID.Text;
|
||||
Modeljl4.MemberId = model.Id;
|
||||
Modeljl4.MemberId1 = model.SuperiorsID;
|
||||
Modeljl4.MemberId2 = model.ContactID;
|
||||
Modeljl4.IFMFSJ = 0;
|
||||
Modeljl4.IFUpdateMoney = 1;
|
||||
Modeljl4.UpdateMoney = 0;
|
||||
Modeljl4.UpdateMoney2 = 0;
|
||||
Modeljl4.utype = "2";
|
||||
Modeljl4.addtime = dt;
|
||||
Modeljl4.gtype = gtype;
|
||||
new DAL.user_Results_jl4().Add(Modeljl4);
|
||||
}
|
||||
}
|
||||
Model.User_CZ_log logmodel = new Model.User_CZ_log();
|
||||
logmodel.MemberId = Card;
|
||||
logmodel.AddTime = dt;
|
||||
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
||||
logmodel.Body = "删除会员,会员账号(姓名):" + txtUserID.Text + ",推荐人账号(姓名):" + txtUserID2.Text;
|
||||
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>");
|
||||
}
|
||||
}
|
||||
/*}
|
||||
else
|
||||
{
|
||||
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('已购买会员不能删除!');location.replace('" + Hidd_Url.Value + "')</script>");
|
||||
}*/
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user