代码修改后的版本,全部提交
This commit is contained in:
331
Mtxfw.VipSite/Admin_Member_seefusers.aspx.cs
Normal file
331
Mtxfw.VipSite/Admin_Member_seefusers.aspx.cs
Normal file
@@ -0,0 +1,331 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
namespace Mtxfw.VipSite
|
||||
{
|
||||
public partial class Admin_Member_seefusers : Mtxfw.Utility.MemberBase
|
||||
{
|
||||
public Mtxfw.DAL.queue_window daoQuque = new DAL.queue_window();
|
||||
Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
|
||||
Mtxfw.DAL.user_Results daoResults = new Mtxfw.DAL.user_Results();
|
||||
private static Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
|
||||
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_seefusers.aspx");
|
||||
}
|
||||
if (IFStores != 1)
|
||||
{
|
||||
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
||||
}
|
||||
if (MemberJS.IndexOf("未审核会员") == -1)
|
||||
{
|
||||
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
||||
}
|
||||
Data_Bind();
|
||||
Page.Title = "未审核会员 - " + GetWebName;
|
||||
}
|
||||
|
||||
MyPager.PageChanged += delegate(object s, EventArgs ex)
|
||||
{
|
||||
Data_Bind();
|
||||
};
|
||||
}
|
||||
|
||||
protected void Data_Bind()
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||
String key = HttpUtility.UrlDecode(Request.QueryString["key"]);
|
||||
String strOrder = Request.QueryString["Order"];
|
||||
sb.Append("gtype=" + gtype + " and uutype='0' And userstate='未审核' And IFStores=0");
|
||||
if (gtype == 0)
|
||||
{
|
||||
if (Memberttype != -1)
|
||||
{
|
||||
sb.Append(" And gtype=" + Memberttype);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append(" And gtype=" + gtype);
|
||||
}
|
||||
strOrder = " Order By ID desc";
|
||||
|
||||
MyPager.PageSize = 50;
|
||||
MyPager.RecordCount = daoUser.GetCount(sb.ToString());
|
||||
if (MyPager.RecordCount == 0)
|
||||
{
|
||||
MyPager.Visible = false;
|
||||
}
|
||||
Mtxfw.Utility.Tools.ToBind(Repeater1, daoUser.GetPager(MyPager, "(select UserName from user_info b where b.Id=a.SuperiorsID) as UserName2,(select UserName from user_info b where b.Id=a.ContactID)as UserName3,(select UserName from user_info b where b.Id=a.DLRememberID) as BDName,", sb.ToString() + strOrder));
|
||||
}
|
||||
protected void Run_Click(object s, System.EventArgs e)
|
||||
{
|
||||
if (IsRefresh == false)
|
||||
{
|
||||
string sidss = ",";
|
||||
CheckBox Check = new CheckBox();
|
||||
string strs = seclect_Drop.SelectedItem.Value;
|
||||
for (int i = Repeater1.Items.Count-1; i >= 0; i--)
|
||||
{
|
||||
//在行中查找到该单选框
|
||||
Check = (CheckBox)Repeater1.Items[i].FindControl("checka");
|
||||
int strID = int.Parse(Check.CssClass);
|
||||
string sids = "";
|
||||
if (Check.Checked == true)
|
||||
{
|
||||
TextBox Seef = new TextBox();
|
||||
Seef = (TextBox)Repeater1.Items[i].FindControl("TextBox_Seef");
|
||||
Mtxfw.Model.user_info umodel = daoUser.GetModel(strID);
|
||||
if (umodel != null)
|
||||
{
|
||||
if (umodel.UserState == "未审核")
|
||||
{
|
||||
if (strs == "0" && Seef.Text == "未审核")
|
||||
{
|
||||
|
||||
//审核通过
|
||||
daoUser.UpdatePassword("UserState", "正常", strID);
|
||||
//更新审核时间
|
||||
daoUser.UpdateTime("regtime", DateTime.Now, strID);
|
||||
if (umodel.uLevel7 == 0)
|
||||
{
|
||||
Double zmoney = umodel.umoney20;
|
||||
int znum = 0;
|
||||
string[] agoods = umodel.ProductName.Split(',');
|
||||
for (int l = 0; l < agoods.Length; l++)
|
||||
{
|
||||
string good = agoods[l];
|
||||
if (good != "")
|
||||
{
|
||||
string[] ag = good.Split('|');
|
||||
Mtxfw.Model.user_Goods model = new DAL.user_Goods().GetModel(Convert.ToInt32(ag[0]));
|
||||
if (model != null)
|
||||
{
|
||||
znum += Convert.ToInt32(ag[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Mtxfw.Model.user_Results ModelResults = new Mtxfw.Model.user_Results();
|
||||
ModelResults.b0 = zmoney;
|
||||
ModelResults.b1 = znum;
|
||||
ModelResults.b2 = 0;
|
||||
ModelResults.b3 = 0;
|
||||
ModelResults.b4 = 0;
|
||||
ModelResults.b5 = zmoney;
|
||||
ModelResults.b6 = 0;
|
||||
ModelResults.b7 = 0;
|
||||
ModelResults.b8 = 0;
|
||||
ModelResults.b9 = 0;
|
||||
ModelResults.b10 = 0;
|
||||
ModelResults.b11 = 0;
|
||||
ModelResults.b12 = 0;
|
||||
ModelResults.b13 = 0;
|
||||
ModelResults.b14 = 0;
|
||||
ModelResults.conent = "选择产品";
|
||||
ModelResults.Totalmoney = zmoney;
|
||||
ModelResults.MemberId = umodel.Id;
|
||||
ModelResults.UserId = umodel.DLRememberID;
|
||||
ModelResults.ListNumber = "";
|
||||
ModelResults.Managers = umodel.ProductName;
|
||||
ModelResults.Seef = 0;
|
||||
ModelResults.utype = "17";
|
||||
ModelResults.addtime = DateTime.Now;
|
||||
ModelResults.gtype = gtype;
|
||||
Int64 ResultId = new DAL.user_Results().Add(ModelResults);
|
||||
//Mtxfw.DAL.MemberStatistics.UpdteSXYJ(config, umodel.Id, umodel.SuperiorsIDS, umodel.umoney21);
|
||||
//Mtxfw.DAL.MemberStatistics.UpdteData(config, umodel, DateTime.Now, umodel.umoney21);
|
||||
}
|
||||
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 = "审核会员记录,用户名:" + umodel.UserName + "";
|
||||
logmodel.UType = 0;
|
||||
new DAL.User_CZ_log().Add(logmodel);
|
||||
sidss += sids;
|
||||
}
|
||||
else if (strs == "2")
|
||||
{
|
||||
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 = "删除未审核会员记录,用户名:" + umodel.UserName + "";
|
||||
logmodel.UType = 0;
|
||||
logmodel.gtype = gtype;
|
||||
new DAL.User_CZ_log().Add(logmodel);
|
||||
daoUser.Delete(strID);
|
||||
}
|
||||
else if (strs == "12")
|
||||
{
|
||||
daoUser.UpdateuLevel("uLevel7", 1, strID);
|
||||
daoUser.UpdateMoney2("umoney20", 0, strID);
|
||||
daoUser.UpdateMoney2("umoney21", 0, strID);
|
||||
}
|
||||
else if (strs == "13")
|
||||
{
|
||||
daoUser.UpdateuLevel("uLevel7", 0, strID);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strs == "0")
|
||||
{
|
||||
|
||||
Data_Bind();
|
||||
}
|
||||
else
|
||||
{
|
||||
Data_Bind();
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void Seef_Click(object s, CommandEventArgs ex)
|
||||
{
|
||||
if (IsRefresh == false)
|
||||
{
|
||||
string sids = "";
|
||||
int strID = int.Parse(ex.CommandName.ToString());
|
||||
Mtxfw.Model.user_info umodel = daoUser.GetModel(strID);
|
||||
if (umodel != null)
|
||||
{
|
||||
if (umodel.UserState == "未审核")
|
||||
{
|
||||
|
||||
//审核通过
|
||||
daoUser.UpdatePassword("UserState", "正常", strID);
|
||||
//更新审核时间
|
||||
daoUser.UpdateTime("regtime", DateTime.Now, strID);
|
||||
if (umodel.uLevel7 == 0)
|
||||
{
|
||||
Double zmoney = umodel.umoney20;
|
||||
int znum = 0;
|
||||
string[] agoods = umodel.ProductName.Split(',');
|
||||
for (int l = 0; l < agoods.Length; l++)
|
||||
{
|
||||
string good = agoods[l];
|
||||
if (good != "")
|
||||
{
|
||||
string[] ag = good.Split('|');
|
||||
Mtxfw.Model.user_Goods model = new DAL.user_Goods().GetModel(Convert.ToInt32(ag[0]));
|
||||
if (model != null)
|
||||
{
|
||||
znum += Convert.ToInt32(ag[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Mtxfw.Model.user_Results ModelResults = new Mtxfw.Model.user_Results();
|
||||
ModelResults.b0 = zmoney;
|
||||
ModelResults.b1 = znum;
|
||||
ModelResults.b2 = 0;
|
||||
ModelResults.b3 = 0;
|
||||
ModelResults.b4 = 0;
|
||||
ModelResults.b5 = zmoney;
|
||||
ModelResults.b6 = 0;
|
||||
ModelResults.b7 = 0;
|
||||
ModelResults.b8 = 0;
|
||||
ModelResults.b9 = 0;
|
||||
ModelResults.b10 = 0;
|
||||
ModelResults.b11 = 0;
|
||||
ModelResults.b12 = 0;
|
||||
ModelResults.b13 = 0;
|
||||
ModelResults.b14 = 0;
|
||||
ModelResults.conent = "选择产品";
|
||||
ModelResults.Totalmoney = zmoney;
|
||||
ModelResults.MemberId = umodel.Id;
|
||||
ModelResults.UserId = umodel.DLRememberID;
|
||||
ModelResults.ListNumber = "";
|
||||
ModelResults.Managers = umodel.ProductName;
|
||||
ModelResults.Seef = 0;
|
||||
ModelResults.utype = "17";
|
||||
ModelResults.addtime = DateTime.Now;
|
||||
ModelResults.gtype = gtype;
|
||||
Int64 ResultId = new DAL.user_Results().Add(ModelResults);
|
||||
//Mtxfw.DAL.MemberStatistics.UpdteSXYJ(config, umodel.Id, umodel.SuperiorsIDS, umodel.umoney21);
|
||||
//Mtxfw.DAL.MemberStatistics.UpdteData(config, umodel, DateTime.Now, umodel.umoney21);
|
||||
}
|
||||
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 = "审核会员记录,用户名:" + umodel.UserName + "";
|
||||
logmodel.UType = 0;
|
||||
logmodel.gtype = gtype;
|
||||
new DAL.User_CZ_log().Add(logmodel);
|
||||
Mtxfw.Utility.Tools.Message("审核成功!", Request.Url.AbsoluteUri);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void Delete_Click(object s, CommandEventArgs ex)
|
||||
{
|
||||
if (IsRefresh == false)
|
||||
{
|
||||
int strID = int.Parse(ex.CommandName.ToString());
|
||||
Mtxfw.Model.user_info umodel = daoUser.GetModel(strID);
|
||||
if (umodel != null)
|
||||
{
|
||||
if (umodel.UserState == "未审核")
|
||||
{
|
||||
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 = "删除未审核会员记录,用户名:" + umodel.UserName + "";
|
||||
logmodel.UType = 0;
|
||||
logmodel.gtype = gtype;
|
||||
new DAL.User_CZ_log().Add(logmodel);
|
||||
daoUser.Delete(strID);
|
||||
}
|
||||
}
|
||||
Mtxfw.Utility.Tools.Message("删除成功!", Request.Url.AbsoluteUri);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user