153 lines
8.0 KiB
C#
153 lines
8.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace Mtxfw.WebSite._Admin
|
|
{
|
|
public partial class admin_cardbindqx : Mtxfw.Utility.AdminPage
|
|
{
|
|
public Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
|
|
public Int32 icount=0;
|
|
public String ResultCard = "";
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
|
|
{
|
|
ResultCard = Request.QueryString["ID"].ToString();
|
|
Hidd_Card.Value = ResultCard;
|
|
}
|
|
}
|
|
AspNetPager1.PageChanged += delegate(object s, EventArgs ex)
|
|
{
|
|
Data_Bind();
|
|
};
|
|
}
|
|
|
|
protected void Data_Bind()
|
|
{
|
|
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
|
sb.Append("UserState='正常' And uLevel10=1 And ContactID=" + Hidd_Card.Value + "");
|
|
AspNetPager1.PageSize = 12;
|
|
AspNetPager1.RecordCount = daoUser.GetCount(sb.ToString());
|
|
Mtxfw.Utility.Tools.ToBind(Repeater1, daoUser.GetPager(AspNetPager1, "", sb.ToString() + " Order by ID desc"));
|
|
}
|
|
protected void IsGo_Click(object s, CommandEventArgs ex)
|
|
{
|
|
if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
|
|
{
|
|
int ID = int.Parse(Request.QueryString["ID"]);
|
|
string MemberCard = "", UserName="";
|
|
int IFStores = 0;
|
|
Double umoney28 = 0;
|
|
Mtxfw.Model.user_info model2 = daoUser.GetModel(ID);
|
|
if (model2 != null)
|
|
{
|
|
UserName = model2.UserName;
|
|
MemberCard = model2.MemberCard;
|
|
IFStores = model2.IFStores;
|
|
umoney28 = (model2.umoney28 - model2.umoney29);
|
|
}
|
|
int CardID = int.Parse(ex.CommandName.ToString());
|
|
Mtxfw.Model.user_info umodel = daoUser.GetModel(CardID);
|
|
if (umodel != null)
|
|
{
|
|
if (umodel.uutype == "1")
|
|
{
|
|
if (umodel.ContactID > 0)
|
|
{
|
|
Double money = -umodel.umoney20 * 0.1;
|
|
Model.user_Results_jl2 mjl2 = new Model.user_Results_jl2();
|
|
mjl2.MemberId = umodel.ContactID;
|
|
mjl2.MemberId2 = umodel.Id;
|
|
mjl2.Addmoney = 0;
|
|
mjl2.Cutmoney = -money;
|
|
mjl2.Totalmoney = umoney28 - money;
|
|
mjl2.addtime = DateTime.Now;
|
|
mjl2.BZContent = "取消绑定" + umodel.UserName + "减少" + money;
|
|
mjl2.PayID = "";
|
|
mjl2.OrdersIDs = "";
|
|
mjl2.OrdersID = 0;
|
|
mjl2.utype = 0;
|
|
mjl2.utype2 = 0;
|
|
mjl2.Seef = -1;
|
|
mjl2.seeftime = DateTime.Now;
|
|
new DAL.user_Results_jl2().Add(mjl2);
|
|
daoUser.UpdateMoney("umoney28", money, umodel.ContactID);
|
|
string strpContactID = daoUser.Getzd("ContactID", "UserState='正常' And Id=" + umodel.ContactID).ToString();
|
|
if (strpContactID != "")
|
|
{
|
|
int pContactID = Convert.ToInt32(strpContactID);
|
|
if (pContactID > 0)
|
|
{
|
|
string strumoney28 = new DAL.user_info().Getzd("(umoney28-umoney29) as umoney28", "UserState='正常' And ID=" + pContactID).ToString();
|
|
if (strumoney28 != "")
|
|
{
|
|
umoney28 = Convert.ToDouble(strumoney28);
|
|
money = -umodel.umoney20 * 0.03;
|
|
mjl2 = new Model.user_Results_jl2();
|
|
mjl2.MemberId = pContactID;
|
|
mjl2.MemberId2 = umodel.Id;
|
|
mjl2.Addmoney = 0;
|
|
mjl2.Cutmoney = -money;
|
|
mjl2.Totalmoney = umoney28 - money;
|
|
mjl2.addtime = DateTime.Now;
|
|
mjl2.BZContent = UserName + "取消绑定" + umodel.UserName + "减少" + money;
|
|
mjl2.PayID = "";
|
|
mjl2.OrdersIDs = "";
|
|
mjl2.OrdersID = 0;
|
|
mjl2.utype = 0;
|
|
mjl2.utype2 = 0;
|
|
mjl2.Seef = -1;
|
|
mjl2.seeftime = DateTime.Now;
|
|
new DAL.user_Results_jl2().Add(mjl2);
|
|
daoUser.UpdateMoney("umoney28", money, pContactID);
|
|
}
|
|
strpContactID = daoUser.Getzd("ContactID", "UserState='正常' And Id=" + umodel.ContactID).ToString();
|
|
if (strpContactID != "")
|
|
{
|
|
pContactID = Convert.ToInt32(strpContactID);
|
|
if (pContactID > 0)
|
|
{
|
|
strumoney28 = new DAL.user_info().Getzd("(umoney28-umoney29) as umoney28", "UserState='正常' And ID=" + pContactID).ToString();
|
|
if (strumoney28 != "")
|
|
{
|
|
umoney28 = Convert.ToDouble(strumoney28);
|
|
money = -umodel.umoney20 * 0.02;
|
|
mjl2 = new Model.user_Results_jl2();
|
|
mjl2.MemberId = pContactID;
|
|
mjl2.MemberId2 = umodel.Id;
|
|
mjl2.Addmoney = 0;
|
|
mjl2.Cutmoney = -money;
|
|
mjl2.Totalmoney = umoney28 - money;
|
|
mjl2.addtime = DateTime.Now;
|
|
mjl2.BZContent = UserName + "取消绑定" + umodel.UserName + "减少" + money;
|
|
mjl2.PayID = "";
|
|
mjl2.OrdersIDs = "";
|
|
mjl2.OrdersID = 0;
|
|
mjl2.utype = 0;
|
|
mjl2.utype2 = 0;
|
|
mjl2.Seef = -1;
|
|
mjl2.seeftime = DateTime.Now;
|
|
new DAL.user_Results_jl2().Add(mjl2);
|
|
daoUser.UpdateMoney("umoney28", money, pContactID);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
daoUser.UpdateTJR(0, "", CardID);
|
|
daoUser.UpdateuLevel("uLevel6", 0, CardID);
|
|
Mtxfw.Utility.Tools.Message("取消绑定成功!", Request.Url.AbsoluteUri);
|
|
}
|
|
}
|
|
}
|
|
} |