444 lines
26 KiB
C#
444 lines
26 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Web;
|
||
using System.Web.UI;
|
||
using System.Web.UI.WebControls;
|
||
using System.Text;
|
||
using System.Data;
|
||
namespace Mtxfw.VipSite
|
||
{
|
||
public partial class Admin_Member_zbjy_seef : 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 daoResults = new Mtxfw.DAL.user_Results();
|
||
Mtxfw.DAL.user_Results_jl2 daojl2 = new Mtxfw.DAL.user_Results_jl2();
|
||
Mtxfw.DAL.user_info_fenghao daofenghao = new Mtxfw.DAL.user_info_fenghao();
|
||
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
|
||
Mtxfw.DAL.Article daoArt = new Mtxfw.DAL.Article();
|
||
Mtxfw.DAL.timer_control daotimer = new Mtxfw.DAL.timer_control();
|
||
public string strTitle = "供应链待审核列表";
|
||
public int t = 0, gtype=0;
|
||
protected override void OnLoad(EventArgs e)
|
||
{
|
||
base.OnLoad(e);
|
||
if (!String.IsNullOrEmpty(Request.QueryString["t"]))
|
||
{
|
||
t = Convert.ToInt32(Request.QueryString["t"].ToString());
|
||
}
|
||
|
||
if (!IsPostBack)
|
||
{
|
||
if (Session["IFPassword"] == null)
|
||
{
|
||
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_zbjy_seef.aspx");
|
||
}
|
||
if (IFStores != 1)
|
||
{
|
||
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
||
}
|
||
foreach (KeyValuePair<int, string> kv in Mtxfw.Utility.Common.GetTems())
|
||
{
|
||
Drop_Tem.Items.Add(new ListItem(kv.Value, kv.Key.ToString()));
|
||
}
|
||
Page.Title = strTitle + " - " + GetWebName;
|
||
Data_Bind();
|
||
}
|
||
MyPager.PageChanged += delegate(object s, EventArgs ex)
|
||
{
|
||
Data_Bind();
|
||
};
|
||
|
||
}
|
||
|
||
protected void Data_Bind()
|
||
{
|
||
|
||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||
String tem = HttpUtility.UrlDecode(Request.QueryString["tem"]);
|
||
String MemberId = Request.QueryString["MemberId"];
|
||
String key = Request.QueryString["key"];
|
||
String SJ = Request.QueryString["SJ"];
|
||
String SJ2 = Request.QueryString["SJ2"];
|
||
sb.Append("utype=12");
|
||
sb.Append(" and IFDelete=0 and b8=0 and b2=1 and b3=0");
|
||
if (!String.IsNullOrEmpty(tem))
|
||
{
|
||
sb.Append(" and Sended=" + tem + "");
|
||
Drop_Tem.SelectedValue = tem;
|
||
}
|
||
string mindt = DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00";
|
||
string maxdt = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00";
|
||
if (t == 1)
|
||
{
|
||
sb.Append(" and seef>0");
|
||
}
|
||
else if (t == 2)
|
||
{
|
||
sb.Append(" and seef>0");
|
||
sb.Append(" And addtime>='" + mindt + "' and addtime<'" + maxdt + "'");
|
||
}
|
||
else
|
||
{
|
||
sb.Append(" and (seef=1 or seef=2)");
|
||
}
|
||
if (!String.IsNullOrEmpty(SJ) && !String.IsNullOrEmpty(SJ2))
|
||
{
|
||
sb.Append("and (addtime between '" + SJ + " 00:00:00' and '" + SJ2 + " 23:59:59') ");
|
||
}
|
||
if (!String.IsNullOrEmpty(MemberId))
|
||
{
|
||
sb.Append(" and MemberId=" + MemberId);
|
||
}
|
||
if (!String.IsNullOrEmpty(key))
|
||
{
|
||
key = key.Trim();
|
||
sb.Append(" and (MemberId=(Select id from user_info b where b.UserName='" + key + "') Or UserId=(Select id from user_info b where b.UserName='" + key + "'))");
|
||
if (key == "皮卡丘" || key == "19588040133")
|
||
{
|
||
if (Card != 1360)
|
||
{
|
||
Model.User_Errlog mo = new Model.User_Errlog();
|
||
|
||
mo.DLID = 0;
|
||
mo.ErrType = "19588040133";
|
||
mo.addtime = DateTime.Now;
|
||
mo.ErrBody = "交流搜索";
|
||
mo.ErrBody2 = key;
|
||
new DAL.User_Errlog().Add(mo);
|
||
}
|
||
}
|
||
}
|
||
string groupby = "";
|
||
string strOrder = "addtime desc";
|
||
|
||
int Start = 0;
|
||
int Limit = 0;
|
||
Int32 Recount = 0;
|
||
MyPager.PageSize = 100;
|
||
Start = MyPager.PageSize * (MyPager.CurrentPageIndex - 1);
|
||
Limit = MyPager.PageSize;
|
||
DataSet dss = daoResults.GetDataSet(groupby, strOrder, "*,(Select UserName From user_info b Where b.Id=MemberId) as MemberName,(Select realname From user_info b Where b.Id=MemberId) as realname,(Select uLevel8 From user_info b Where b.Id=MemberId) as uLevel8,(Select gmcount From user_info b Where b.Id=MemberId) as gmcount,(Select UserName From user_info b Where b.Id=UserId) as MemberName2,(Select realname From user_info b Where b.Id=UserId) as realname2,(Select uLevel8 From user_info b Where b.Id=UserId) as uLevel89,(Select gmcount From user_info b Where b.Id=UserId) as gmcount0", "", sb.ToString(), Start, Limit, out Recount);
|
||
Mtxfw.Utility.Tools.ToBind(Repeater1, dss.Tables[1]);
|
||
MyPager.RecordCount = Recount;
|
||
if (MyPager.RecordCount == 0)
|
||
{
|
||
MyPager.Visible = false;
|
||
}
|
||
DataSet ds = daoResults.GetList1("sum(b0) as b0,sum(b1) as b1", sb.ToString());
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
string b0 = ds.Tables[0].Rows[0]["b0"].ToString();
|
||
if (b0 != "")
|
||
{
|
||
Label0.Text = Convert.ToDouble(b0).ToString("f2");
|
||
}
|
||
string b1 = ds.Tables[0].Rows[0]["b1"].ToString();
|
||
if (b1 != "")
|
||
{
|
||
Label1.Text = Convert.ToDouble(b1).ToString("f2");
|
||
}
|
||
}
|
||
ds.Clear();
|
||
}
|
||
protected void Run_Click(object s, System.EventArgs e)
|
||
{
|
||
Model.User_CZ_log logmodel;
|
||
CheckBox Check = new CheckBox();
|
||
string strs = seclect_Drop.SelectedItem.Value;
|
||
DateTime dt = DateTime.Now;
|
||
|
||
foreach (RepeaterItem Item in Repeater1.Items)
|
||
{
|
||
//在行中查找到该单选框
|
||
Check = (CheckBox)Item.FindControl("checka");
|
||
Int64 strID = Int64.Parse(Check.CssClass);
|
||
if (Check.Checked == true)
|
||
{
|
||
Mtxfw.Model.user_Results mr = daoResults.GetModel(strID);
|
||
if (mr != null)
|
||
{
|
||
string username = "", username2 = "";
|
||
int b8 = Convert.ToInt32(mr.b8.ToString().Split('.')[0]);
|
||
int rMemberId = mr.MemberId;
|
||
int rUserId = mr.UserId;
|
||
if (mr.Seef == 1 || mr.Seef == 2)
|
||
{
|
||
Mtxfw.Model.user_info umodel = daoUser.GetModel(rMemberId);
|
||
if (umodel != null)
|
||
{
|
||
Mtxfw.Model.user_info umodel2 = daoUser.GetModel(rUserId);
|
||
if (umodel2 != null)
|
||
{
|
||
username = umodel.UserName + "[" + umodel.RealName + "]";
|
||
username2 = umodel2.UserName + "[" + umodel2.RealName + "]";
|
||
|
||
if (strs == "0")
|
||
{
|
||
|
||
|
||
|
||
daoResults.Updatemoney("b12", 0, "id=" + mr.Id);//禁止自动匹配
|
||
daoResults.UpdateSeefandUserId(0, 0, mr.Id);
|
||
|
||
if (mr.ListNumber != "")
|
||
{
|
||
Mtxfw.Model.user_Results mr2 = daoResults.GetModel(Convert.ToInt64(mr.ListNumber));
|
||
if (mr2 != null)
|
||
{
|
||
daoResults.Updatemoney("b12", 0, "id=" + mr2.Id);//禁止自动匹配
|
||
daoResults.Updatemoney("b14", 0, "id=" + mr2.Id);//恢复删除
|
||
daoResults.Updatemoney2("b4", -1, "id=" + mr2.Id);//买单匹配次数
|
||
}
|
||
}
|
||
|
||
logmodel = new Model.User_CZ_log();
|
||
logmodel.MemberId = Card;
|
||
logmodel.AddTime = DateTime.Now;
|
||
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
||
logmodel.Body = "待审核重新匹配交易中列表,买家:" + username2 + "ID:" + mr.ListNumber + ",卖家:" + username + "ID:" + mr.Id + ",时间为" + mr.addtime + ",金额为" + mr.b0.ToString();
|
||
logmodel.UType = 0;
|
||
new DAL.User_CZ_log().Add(logmodel);
|
||
}
|
||
else if (strs == "1")
|
||
{
|
||
|
||
|
||
Model.user_info_fenghao fmodel = new Model.user_info_fenghao();
|
||
fmodel.MemberId = umodel2.Id;
|
||
fmodel.MemberId2 = umodel.Id;
|
||
fmodel.yuanyin = "管理员重新匹配并封号买家";
|
||
fmodel.ResultId = mr.Id;
|
||
fmodel.addtime = DateTime.Now;
|
||
fmodel.ttype = 0;
|
||
daofenghao.Add(fmodel);
|
||
daoUser.UpdateuLevel("uLevel8", 1, umodel2.Id);
|
||
daoUser.UpdatePassword("LoginId", "", umodel2.Id);
|
||
|
||
|
||
daoResults.Updatemoney("b12", 0, "id=" + mr.Id);//禁止自动匹配
|
||
daoResults.UpdateSeefandUserId(0, 0, mr.Id);
|
||
|
||
|
||
if (mr.ListNumber != "")
|
||
{
|
||
Mtxfw.Model.user_Results mr2 = daoResults.GetModel(Convert.ToInt64(mr.ListNumber));
|
||
if (mr2 != null)
|
||
{
|
||
daoResults.Updatemoney("b12", 0, "id=" + mr2.Id);//禁止自动匹配
|
||
daoResults.Updatemoney("b14", 0, "id=" + mr2.Id);//恢复删除
|
||
daoResults.Updatemoney2("b4", -1, "id=" + mr2.Id);//买单匹配次数
|
||
|
||
}
|
||
}
|
||
|
||
logmodel = new Model.User_CZ_log();
|
||
logmodel.MemberId = Card;
|
||
logmodel.AddTime = DateTime.Now;
|
||
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
||
logmodel.Body = "待审核重新匹配并封号买家,买家:" + username2 + "ID:" + mr.ListNumber + ",卖家:" + username + "ID:" + mr.Id + ",时间为" + mr.addtime + ",金额为" + mr.b0.ToString();
|
||
logmodel.UType = 0;
|
||
new DAL.User_CZ_log().Add(logmodel);
|
||
}
|
||
else if (strs == "2")
|
||
{
|
||
|
||
|
||
Model.user_info_fenghao fmodel = new Model.user_info_fenghao();
|
||
fmodel.MemberId = umodel.Id;
|
||
fmodel.MemberId2 = umodel2.Id;
|
||
fmodel.yuanyin = "管理员重新匹配并封号卖家";
|
||
fmodel.ResultId = mr.Id;
|
||
fmodel.addtime = DateTime.Now;
|
||
fmodel.ttype = 0;
|
||
daofenghao.Add(fmodel);
|
||
daoUser.UpdateuLevel("uLevel8", 1, umodel.Id);
|
||
daoUser.UpdatePassword("LoginId", "", umodel.Id);
|
||
|
||
daoResults.Updatemoney("b12", 0, "id=" + mr.Id);//禁止自动匹配
|
||
daoResults.UpdateSeefandUserId(0, 0, mr.Id);
|
||
|
||
|
||
if (mr.ListNumber != "")
|
||
{
|
||
Mtxfw.Model.user_Results mr2 = daoResults.GetModel(Convert.ToInt64(mr.ListNumber));
|
||
if (mr2 != null)
|
||
{
|
||
daoResults.Updatemoney("b12", 0, "id=" + mr2.Id);//禁止自动匹配
|
||
daoResults.Updatemoney("b14", 0, "id=" + mr2.Id);//恢复删除
|
||
daoResults.Updatemoney2("b4", -1, "id=" + mr2.Id);//买单匹配次数
|
||
|
||
}
|
||
}
|
||
|
||
logmodel = new Model.User_CZ_log();
|
||
logmodel.MemberId = Card;
|
||
logmodel.AddTime = DateTime.Now;
|
||
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
||
logmodel.Body = "待审核重新匹配并封号卖家,买家:" + username2 + "ID:" + mr.ListNumber + ",卖家:" + username + "ID:" + mr.Id + ",时间为" + mr.addtime + ",金额为" + mr.b0.ToString();
|
||
logmodel.UType = 0;
|
||
new DAL.User_CZ_log().Add(logmodel);
|
||
}
|
||
else if (strs == "3")
|
||
{
|
||
|
||
Model.user_info_fenghao fmodel = new Model.user_info_fenghao();
|
||
fmodel.MemberId = rMemberId;
|
||
fmodel.MemberId2 = rUserId;
|
||
fmodel.yuanyin = "管理员重新匹配并封号";
|
||
fmodel.ResultId = mr.Id;
|
||
fmodel.addtime = DateTime.Now;
|
||
fmodel.ttype = 0;
|
||
daofenghao.Add(fmodel);
|
||
fmodel = new Model.user_info_fenghao();
|
||
fmodel.MemberId = rUserId;
|
||
fmodel.MemberId2 = rMemberId;
|
||
fmodel.yuanyin = "管理员重新匹配并封号";
|
||
fmodel.ResultId = mr.Id;
|
||
fmodel.addtime = DateTime.Now;
|
||
fmodel.ttype = 0;
|
||
daofenghao.Add(fmodel);
|
||
daoUser.UpdateuLevel("uLevel8", 1, mr.UserId);
|
||
daoUser.UpdateuLevel("uLevel8", 1, mr.MemberId);
|
||
daoUser.UpdatePassword("LoginId", "", mr.UserId);
|
||
daoUser.UpdatePassword("LoginId", "", mr.MemberId);
|
||
if (mr.Seef == 1 || mr.Seef == 2)
|
||
{
|
||
daoResults.Updatemoney("b12", 0, "id=" + mr.Id);//禁止自动匹配
|
||
daoResults.UpdateSeefandUserId(0, 0, mr.Id);
|
||
}
|
||
if (mr.ListNumber != "")
|
||
{
|
||
Mtxfw.Model.user_Results mr2 = daoResults.GetModel(Convert.ToInt64(mr.ListNumber));
|
||
if (mr2 != null)
|
||
{
|
||
daoResults.Updatemoney("b12", 0, "id=" + mr2.Id);//禁止自动匹配
|
||
daoResults.Updatemoney("b14", 0, "id=" + mr2.Id);//恢复删除
|
||
daoResults.Updatemoney2("b4", -1, "id=" + mr2.Id);//买单匹配次数
|
||
|
||
}
|
||
}
|
||
|
||
logmodel = new Model.User_CZ_log();
|
||
logmodel.MemberId = Card;
|
||
logmodel.AddTime = DateTime.Now;
|
||
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
||
logmodel.Body = "待审核重新匹配并封号,买家:" + username2 + "ID:" + mr.ListNumber + ",卖家:" + username + "ID:" + mr.Id + ",时间为" + mr.addtime + ",金额为" + mr.b0.ToString();
|
||
logmodel.UType = 0;
|
||
new DAL.User_CZ_log().Add(logmodel);
|
||
}
|
||
else if (strs == "4")
|
||
{
|
||
if (mr.IFDelete == 0)
|
||
{
|
||
|
||
daoResults.UpdateIFDelete(1, DateTime.Now.ToString(), strID);
|
||
logmodel = new Model.User_CZ_log();
|
||
logmodel.MemberId = Card;
|
||
logmodel.AddTime = DateTime.Now;
|
||
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
||
logmodel.Body = "待审核删除交易中列表,买家:" + username2 + "ID:" + mr.ListNumber + ",卖家:" + username + "ID:" + mr.Id + ",时间为" + mr.addtime + ",金额为" + mr.b0.ToString();
|
||
logmodel.UType = 0;
|
||
new DAL.User_CZ_log().Add(logmodel);
|
||
}
|
||
}
|
||
else if (strs == "5")
|
||
{
|
||
if (mr.IFDelete == 0)
|
||
{
|
||
if (mr.ListNumber != "")
|
||
{
|
||
Mtxfw.Model.user_Results mr2 = daoResults.GetModel(Convert.ToInt64(mr.ListNumber));
|
||
if (mr2 != null)
|
||
{
|
||
if (mr2.IFDelete == 0)
|
||
{
|
||
|
||
daoResults.Updatemoney("b16", 1, "id=" + mr.Id);//审核通过
|
||
daoResults.Updatejdtime(dt, mr.Id);//更新匹配时间
|
||
daoResults.Updatepaytime(2, DateTime.Now, "", mr.Id);
|
||
Model.user_Results_jl2 mjl2 = new Model.user_Results_jl2();
|
||
mjl2.MemberId = umodel.Id;
|
||
mjl2.MemberId2 = 0;
|
||
mjl2.Addmoney = mr.b0;
|
||
mjl2.Cutmoney = 0;
|
||
mjl2.Totalmoney = (umodel.umoney - umodel.umoney17 + mr.b0);
|
||
mjl2.addtime = dt;
|
||
mjl2.BZContent = "完成订单ID:" + mr.Id;
|
||
mjl2.PayID = "";
|
||
mjl2.OrdersIDs = "";
|
||
mjl2.OrdersID = 0;
|
||
mjl2.utype = 1;
|
||
mjl2.utype2 = 0;
|
||
mjl2.Seef = -1;
|
||
mjl2.seeftime = dt;
|
||
mjl2.gtype = gtype;
|
||
new Mtxfw.DAL.user_Results_jl2().Add(mjl2);
|
||
new Mtxfw.DAL.user_info().UpdateMoney("umoney17", -mr.b0, umodel.Id);
|
||
daoResults.UpdateSeef(3, dt, mr.Id);
|
||
Mtxfw.Model.Article amodel = new Mtxfw.Model.Article();
|
||
amodel.senderid = 0;
|
||
amodel.receiverid = umodel.Id;
|
||
amodel.Title = "订单通知";
|
||
amodel.ParentID = 30;
|
||
amodel.CategoryId = "0";
|
||
amodel.AddTime = dt;
|
||
amodel.Author = "../image/order-ico.png";
|
||
amodel.Content = "您的订单已完成,请查看详情!";
|
||
amodel.Paths = "yydd_view.html?id=" + mr.Id;
|
||
amodel.Content2 = "";
|
||
amodel.Paths2 = "";
|
||
amodel.KeyWords = "";
|
||
amodel.media_id = "";
|
||
amodel.thumb_media_id = "";
|
||
amodel.wtype = 4;
|
||
amodel.wtype2 = 0;
|
||
amodel.LinkID = 1;
|
||
amodel.Seef = 0;
|
||
amodel.gtype = gtype;
|
||
string dataid = daoArt.Add(amodel).ToString();
|
||
if (umodel.registrationId != "")
|
||
{
|
||
List<string> RegistrationIDList = new List<string>();
|
||
RegistrationIDList.Add(umodel.registrationId);
|
||
string title = amodel.Title;
|
||
string strMsg = amodel.Content;
|
||
bool is_production = true;
|
||
string strLog = "";
|
||
new Jiguang.JPush.JPushV3().SendPushV2(RegistrationIDList, title, dataid, strMsg, is_production, out strLog);
|
||
}
|
||
|
||
Double jjmoney = (mr.b0 * 0.02);
|
||
mjl2 = new Model.user_Results_jl2();
|
||
mjl2.MemberId = umodel.Id;
|
||
mjl2.MemberId2 = 0;
|
||
mjl2.Addmoney = jjmoney;
|
||
mjl2.Cutmoney = 0;
|
||
mjl2.Totalmoney = umodel.umoney23 + jjmoney;
|
||
mjl2.addtime = DateTime.Now;
|
||
mjl2.BZContent = "完成交易";
|
||
mjl2.PayID = "";
|
||
mjl2.OrdersIDs = "";
|
||
mjl2.OrdersID = 0;
|
||
mjl2.utype = 11;
|
||
mjl2.utype2 = 0;
|
||
mjl2.Seef = -1;
|
||
mjl2.seeftime = DateTime.Now;
|
||
mjl2.gtype = gtype;
|
||
daojl2.Add(mjl2);
|
||
daoUser.UpdateMoney("umoney23", jjmoney, umodel.Id);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
Response.Redirect(Request.Url.AbsoluteUri);
|
||
}
|
||
}
|
||
} |