649 lines
34 KiB
C#
649 lines
34 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_Products_Orders : Mtxfw.Utility.MemberBase
|
|||
|
|
{
|
|||
|
|
Mtxfw.DAL.user_Results daoResults = new Mtxfw.DAL.user_Results();
|
|||
|
|
Mtxfw.DAL.user_Results_jl2 daojl2 = new Mtxfw.DAL.user_Results_jl2();
|
|||
|
|
Mtxfw.DAL.order_product_info daoorderproduct = new Mtxfw.DAL.order_product_info();
|
|||
|
|
Mtxfw.DAL.order_info daoorder = new Mtxfw.DAL.order_info();
|
|||
|
|
Mtxfw.Model.order_info model = new Mtxfw.Model.order_info();
|
|||
|
|
Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
|
|||
|
|
public Mtxfw.DAL.P_Product daoProduct = new Mtxfw.DAL.P_Product();
|
|||
|
|
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
|
|||
|
|
public int gtype = 0, t=0;
|
|||
|
|
public string strTitle = "订单列表", strUserId="";
|
|||
|
|
#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 (!String.IsNullOrEmpty(Request.QueryString["t"]))
|
|||
|
|
{
|
|||
|
|
t = Convert.ToInt32(Request.QueryString["t"].ToString());
|
|||
|
|
}
|
|||
|
|
if (t == 1)
|
|||
|
|
{
|
|||
|
|
strTitle = "流量包订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 2)
|
|||
|
|
{
|
|||
|
|
strTitle = "精选商品订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 4)
|
|||
|
|
{
|
|||
|
|
strTitle = "服务中心订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 5)
|
|||
|
|
{
|
|||
|
|
strTitle = "助农专区订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 6)
|
|||
|
|
{
|
|||
|
|
strTitle = "枣享福区订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 7)
|
|||
|
|
{
|
|||
|
|
strTitle = "其它订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 8)
|
|||
|
|
{
|
|||
|
|
strTitle = "事业联盟订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 9)
|
|||
|
|
{
|
|||
|
|
strTitle = "助农专区订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 10)
|
|||
|
|
{
|
|||
|
|
strTitle = "推广员订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 11)
|
|||
|
|
{
|
|||
|
|
strTitle = "爆品专区订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 12)
|
|||
|
|
{
|
|||
|
|
strTitle = "补贴专区订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 13)
|
|||
|
|
{
|
|||
|
|
strTitle = "体验区订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 15)
|
|||
|
|
{
|
|||
|
|
strTitle = "镇街服务商订单列表";
|
|||
|
|
}
|
|||
|
|
if (t == 16)
|
|||
|
|
{
|
|||
|
|
strTitle = "全部订单列表";
|
|||
|
|
}
|
|||
|
|
if (t != 1)
|
|||
|
|
{
|
|||
|
|
seclect_Drop.Items.Add(new ListItem("批量发货", "1"));
|
|||
|
|
}*/
|
|||
|
|
if (!IsPostBack)
|
|||
|
|
{
|
|||
|
|
// foreach (KeyValuePair<int, string> kv in Mtxfw.Utility.Common.GetTems())
|
|||
|
|
// {
|
|||
|
|
// Drop_Tem.Items.Add(new ListItem(kv.Value, kv.Key.ToString()));
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
if (Session["IFPassword"] == null)
|
|||
|
|
{
|
|||
|
|
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_Products_Orders.aspx");
|
|||
|
|
}
|
|||
|
|
if (IFStores != 1)
|
|||
|
|
{
|
|||
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|||
|
|
}
|
|||
|
|
if (MemberJS.IndexOf("订单列表") == -1)
|
|||
|
|
{
|
|||
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|||
|
|
}
|
|||
|
|
Page.Title = "订单列表 - " + GetWebName;
|
|||
|
|
|
|||
|
|
Data_Bind();
|
|||
|
|
}
|
|||
|
|
MyPager.PageChanged += delegate(object s, EventArgs ex)
|
|||
|
|
{
|
|||
|
|
Data_Bind();
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
protected String GetProvince()
|
|||
|
|
{
|
|||
|
|
StringBuilder sb = new StringBuilder();
|
|||
|
|
Mtxfw.DAL.province daoPro = new Mtxfw.DAL.province();
|
|||
|
|
System.Data.DataSet Ds = daoPro.GetCacheList("", "1=1 Order by Id Asc", "Province");
|
|||
|
|
System.Data.DataTable Dt = (Ds != null && Ds.Tables[0] != null) ? Ds.Tables[0] : null;
|
|||
|
|
foreach (System.Data.DataRow Dr in Dt.Rows)
|
|||
|
|
{
|
|||
|
|
sb.Append("<option value=\"" + Dr["ProvinceID"] + "\">" + Dr["ProvinceName"] + "</option>\r\n");
|
|||
|
|
}
|
|||
|
|
return sb.ToString();
|
|||
|
|
}
|
|||
|
|
protected void Data_Bind()
|
|||
|
|
{
|
|||
|
|
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
|||
|
|
String UserId = HttpUtility.UrlDecode(Request.QueryString["UserId"]);
|
|||
|
|
String ZTMemberId = HttpUtility.UrlDecode(Request.QueryString["ZTMemberId"]);
|
|||
|
|
String o_payed = HttpUtility.UrlDecode(Request.QueryString["o_payed"]);
|
|||
|
|
String key = HttpUtility.UrlDecode(Request.QueryString["key"]);
|
|||
|
|
String state = HttpUtility.UrlDecode(Request.QueryString["state"]);
|
|||
|
|
String t0 = HttpUtility.UrlDecode(Request.QueryString["t0"]);
|
|||
|
|
String ttype = HttpUtility.UrlDecode(Request.QueryString["type"]);
|
|||
|
|
String paytype = HttpUtility.UrlDecode(Request.QueryString["paytype"]);
|
|||
|
|
String peitype = HttpUtility.UrlDecode(Request.QueryString["peitype"]);
|
|||
|
|
String tem = HttpUtility.UrlDecode(Request.QueryString["tem"]);
|
|||
|
|
if (!String.IsNullOrEmpty(ttype))
|
|||
|
|
{
|
|||
|
|
sb.Append(" and ttype=" + ttype);
|
|||
|
|
Drop_ordertype.SelectedValue = ttype;
|
|||
|
|
}
|
|||
|
|
sb.Append(" and (Select Count(id) From User_info b where b.id=UserId)>0");
|
|||
|
|
if (MemberuLevel29 > 0)
|
|||
|
|
{
|
|||
|
|
sb.Append(" And MemberId=" + MemberShippingID);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sb.Append(" and MemberId=0");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (!String.IsNullOrEmpty(ZTMemberId))
|
|||
|
|
{
|
|||
|
|
sb.Append(" and ZTMemberId=" + ZTMemberId);
|
|||
|
|
}
|
|||
|
|
if (!String.IsNullOrEmpty(o_payed))
|
|||
|
|
{
|
|||
|
|
sb.Append(" and o_payed=" + o_payed);
|
|||
|
|
}
|
|||
|
|
if (!String.IsNullOrEmpty(paytype))
|
|||
|
|
{
|
|||
|
|
sb.Append(" and utype=" + paytype);
|
|||
|
|
Drop_paytype.Text = paytype;
|
|||
|
|
}
|
|||
|
|
if (!String.IsNullOrEmpty(peitype))
|
|||
|
|
{
|
|||
|
|
sb.Append(" and peitype=" + peitype);
|
|||
|
|
Drop_peitype.Text = peitype;
|
|||
|
|
}
|
|||
|
|
if (!String.IsNullOrEmpty(state) && state != "-2")
|
|||
|
|
{
|
|||
|
|
sb.Append(" and O_Payed='" + state + "'");
|
|||
|
|
Drop_State.SelectedValue = state;
|
|||
|
|
}
|
|||
|
|
if (!String.IsNullOrEmpty(t0))
|
|||
|
|
{
|
|||
|
|
if (t0 == "1")
|
|||
|
|
{
|
|||
|
|
sb.Append(" and DateDiff(day,addtime,getdate())=0");
|
|||
|
|
strTitle = "今日订单列表";
|
|||
|
|
}
|
|||
|
|
else if (t0 == "2")
|
|||
|
|
{
|
|||
|
|
sb.Append(" and DateDiff(day,addtime,getdate())=1");
|
|||
|
|
strTitle = "昨日订单列表";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (!String.IsNullOrEmpty(UserId))
|
|||
|
|
{
|
|||
|
|
sb.Append("and UserId=" + UserId);
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
if (!String.IsNullOrEmpty(tem))
|
|||
|
|
{
|
|||
|
|
sb.Append(" and ptgroup=" + tem + "");
|
|||
|
|
// Drop_Tem.SelectedValue = tem;
|
|||
|
|
}
|
|||
|
|
if (!String.IsNullOrEmpty(key))
|
|||
|
|
{
|
|||
|
|
strUserId = key;
|
|||
|
|
if (!System.Text.RegularExpressions.Regex.IsMatch(key, @"^[1]+[1,2,3,4,5,6,7,8,9]+\d{9}$") && !System.Text.RegularExpressions.Regex.IsMatch(key, @"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"))
|
|||
|
|
{
|
|||
|
|
sb.Append("and (orderid like '%" + key + "%' Or Contactname like '%" + key + "%' Or Contacttel like '%" + key + "%' Or yundanhao like '%" + key + "%' Or UserID in (select id from user_info b where b.IFStores=0 and (b.UserName like '%" + key + "%' or b.realname like '%" + key + "%')))");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sb.Append("and (Contacttel like '%" + key + "%' Or UserID in (select id from user_info b where b.IFStores=0 and (b.UserName like '%" + key + "%')))");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
string groupby = "";
|
|||
|
|
string strOrder = " addtime desc";
|
|||
|
|
int Start = 0;
|
|||
|
|
int Limit = 0;
|
|||
|
|
Int32 Recount = 0;
|
|||
|
|
MyPager.PageSize = 50;
|
|||
|
|
Start = MyPager.PageSize * (MyPager.CurrentPageIndex - 1);
|
|||
|
|
Limit = MyPager.PageSize;
|
|||
|
|
DataSet dss = daoorder.GetDataSet(groupby, strOrder, "ID,ttype,utype,orderid,ptype,peitype,O_SubmitDate,addtime,O_Payed,O_Payed_date,O_Shipped,O_Shipped_date,O_received,O_received_date,kdcompay,yundanhao,Guests,wlremarks,Contactname,Contacttel,Province,City,County,IFFill,Tradingarea,Address,Address0,Totalnum,pcount,ypznum,Totalprice,Totalprice0,Totalprice2,Totalprice10,refundstatus,refund_channel,user_received_account,success_time,ptgroup,O_Seef,O_ReturnReason,(select UserName from user_info c where c.ID=UserID) as UserName,(select RealName from user_info c where c.ID=UserID) as RealName", "", "gtype=" + gtype + " and IFDelete=0 and O_Payed>0" + sb.ToString(), Start, Limit, out Recount);
|
|||
|
|
Mtxfw.Utility.Tools.ToBind(Repeater1, dss.Tables[1]);
|
|||
|
|
MyPager.RecordCount = Recount;
|
|||
|
|
if (MyPager.RecordCount == 0)
|
|||
|
|
{
|
|||
|
|
MyPager.Visible = false;
|
|||
|
|
}
|
|||
|
|
string strfill = ",0 as Totalprice22";
|
|||
|
|
if (t == 1)
|
|||
|
|
{
|
|||
|
|
strfill = ",sum(Totalprice0/Totalprice2) as Totalprice22";
|
|||
|
|
}
|
|||
|
|
DataSet ds = daoorder.GetList1("sum(Totalnum) as Totalnum,sum(pcount) as pcount,sum(Totalprice) as Totalprice,sum(Totalprice0) as Totalprice0,sum(Totalprice2) as Totalprice2"+ strfill + ",sum(Totalprice10) as Totalprice10", "gtype=" + gtype + " and IFDelete=0 and O_Payed>0" + sb.ToString());
|
|||
|
|
if (ds.Tables[0].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
if (ds.Tables[0].Rows[0]["Totalnum"].ToString() != "")
|
|||
|
|
{
|
|||
|
|
Label_b0.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["Totalnum"]).ToString();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Label_b0.Text = "0";
|
|||
|
|
}
|
|||
|
|
if (ds.Tables[0].Rows[0]["pcount"].ToString() != "")
|
|||
|
|
{
|
|||
|
|
Label_b1.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["pcount"]).ToString();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Label_b1.Text = "0";
|
|||
|
|
}
|
|||
|
|
if (ds.Tables[0].Rows[0]["Totalprice"].ToString() != "")
|
|||
|
|
{
|
|||
|
|
Label_b2.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["Totalprice"]).ToString("f2");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Label_b2.Text = "0.00";
|
|||
|
|
}
|
|||
|
|
if (ds.Tables[0].Rows[0]["Totalprice0"].ToString() != "")
|
|||
|
|
{
|
|||
|
|
Label_b3.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["Totalprice0"]).ToString("0.####");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Label_b3.Text = "0";
|
|||
|
|
}
|
|||
|
|
if (ds.Tables[0].Rows[0]["Totalprice10"].ToString() != "")
|
|||
|
|
{
|
|||
|
|
Label_b4.Text = (Convert.ToDouble(ds.Tables[0].Rows[0]["Totalprice0"])-Convert.ToDouble(ds.Tables[0].Rows[0]["Totalprice10"])).ToString("0.####");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Label_b4.Text = "0";
|
|||
|
|
}
|
|||
|
|
if (ds.Tables[0].Rows[0]["Totalprice2"].ToString() != "")
|
|||
|
|
{
|
|||
|
|
Label_b5.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["Totalprice2"]).ToString("0.####");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Label_b5.Text = "0";
|
|||
|
|
}
|
|||
|
|
if (ds.Tables[0].Rows[0]["Totalprice22"].ToString() != "")
|
|||
|
|
{
|
|||
|
|
Label_b6.Text = Convert.ToDouble(ds.Tables[0].Rows[0]["Totalprice22"]).ToString("0.####");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Label_b6.Text = "0";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Label_b1.Text = "0";
|
|||
|
|
Label_b2.Text = "0.00";
|
|||
|
|
Label_b3.Text = "0";
|
|||
|
|
Label_b4.Text = "0";
|
|||
|
|
Label_b5.Text = "0";
|
|||
|
|
Label_b6.Text = "0";
|
|||
|
|
}
|
|||
|
|
ds.Clear();
|
|||
|
|
}
|
|||
|
|
protected void Run_Click(object s, System.EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (IsRefresh == false)
|
|||
|
|
{
|
|||
|
|
CheckBox Check = new CheckBox();
|
|||
|
|
string strs = seclect_Drop.SelectedItem.Value;
|
|||
|
|
foreach (RepeaterItem Item in Repeater1.Items)
|
|||
|
|
{
|
|||
|
|
//在行中查找到该单选框
|
|||
|
|
Check = (CheckBox)Item.FindControl("checka");
|
|||
|
|
int strID = int.Parse(Check.CssClass);
|
|||
|
|
if (Check.Checked == true)
|
|||
|
|
{
|
|||
|
|
if (strs == "2")
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
Mtxfw.Model.order_info ModelOrder = daoorder.GetModel(strID);
|
|||
|
|
if (ModelOrder != null)
|
|||
|
|
{
|
|||
|
|
DateTime dt = DateTime.Now;
|
|||
|
|
if (ModelOrder.IFDelete == 0)
|
|||
|
|
{
|
|||
|
|
daoorder.UpdateIFDelete(1, DateTime.Now.ToString(), strID);
|
|||
|
|
if (ModelOrder.O_Payed == "0" || ModelOrder.O_Payed == "1" || ModelOrder.O_Payed == "2" || ModelOrder.O_Payed == "3" || ModelOrder.O_Payed == "5")
|
|||
|
|
{
|
|||
|
|
System.Data.DataSet Ds_op = new Mtxfw.DAL.order_product_info().GetList1("Totalnum,guige,selcolor", "utype='0' And orderid=" + ModelOrder.Id + " And IFDelete=0 Order By SubmitTime asc");
|
|||
|
|
if (Ds_op.Tables[0].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
foreach (System.Data.DataRow drv2 in Ds_op.Tables[0].Rows)
|
|||
|
|
{
|
|||
|
|
string selcolor = drv2["selcolor"].ToString();
|
|||
|
|
int prodNum = Convert.ToInt32(drv2["Totalnum"]);
|
|||
|
|
string guige = drv2["guige"].ToString();
|
|||
|
|
if (guige != "")
|
|||
|
|
{
|
|||
|
|
Mtxfw.Model.P_Guige gmodel = new DAL.P_Guige().GetModel(Convert.ToInt32(guige));
|
|||
|
|
if (gmodel != null)
|
|||
|
|
{
|
|||
|
|
int ZKC = 0;
|
|||
|
|
bool IFKC = true;
|
|||
|
|
string strcolors = gmodel.G_Color;
|
|||
|
|
string[] acolors = gmodel.G_Color.Split(',');
|
|||
|
|
for (int jj = 0; jj < acolors.Length; jj++)
|
|||
|
|
{
|
|||
|
|
if (acolors[jj] != "")
|
|||
|
|
{
|
|||
|
|
var ac = acolors[jj].Split('|');
|
|||
|
|
|
|||
|
|
if (ac.Length > 1)
|
|||
|
|
{
|
|||
|
|
if (ac[1] != "")
|
|||
|
|
{
|
|||
|
|
int intNum = Convert.ToInt32(ac[1]);
|
|||
|
|
if (ac[0] == selcolor)
|
|||
|
|
{
|
|||
|
|
intNum = (intNum + Convert.ToInt32(prodNum));
|
|||
|
|
|
|||
|
|
strcolors = strcolors.Replace(ac[0] + "|" + ac[1], ac[0] + "|" + intNum);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
ZKC += intNum;
|
|||
|
|
IFKC = false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
gmodel.G_Color = strcolors;
|
|||
|
|
if (IFKC)
|
|||
|
|
{
|
|||
|
|
gmodel.G_KC = gmodel.G_KC + Convert.ToInt32(prodNum);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
gmodel.G_KC = ZKC;
|
|||
|
|
}
|
|||
|
|
new DAL.P_Guige().Update(gmodel);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
Ds_op.Clear();
|
|||
|
|
}
|
|||
|
|
Mtxfw.Model.user_info umodel = new Mtxfw.DAL.user_info().GetModel(ModelOrder.UserID);
|
|||
|
|
if (umodel != null)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
int ttype = ModelOrder.ttype;
|
|||
|
|
if (ttype == 1)
|
|||
|
|
{
|
|||
|
|
Double Totalprice0 = Convert.ToDouble(ModelOrder.Totalprice0.ToString("f2"));
|
|||
|
|
Double Totalprice1 = Convert.ToDouble(ModelOrder.Totalprice2.ToString("f2"));
|
|||
|
|
Double Totalprice2 = Convert.ToDouble(ModelOrder.Totalprice3.ToString("f2"));
|
|||
|
|
Double mrccmoney = Convert.ToDouble(Convert.ToDouble((Totalprice0 / Totalprice1).ToString("0.####")).ToString("f4"));
|
|||
|
|
if (mrccmoney > Convert.ToDouble(umodel.umoney26.ToString("f4")))
|
|||
|
|
{
|
|||
|
|
mrccmoney = Convert.ToDouble(umodel.umoney26.ToString("f4"));
|
|||
|
|
}
|
|||
|
|
if (mrccmoney > 0.0000)
|
|||
|
|
{
|
|||
|
|
daoUser.UpdateMoney("umoney26", -mrccmoney, umodel.Id);
|
|||
|
|
}
|
|||
|
|
Double hyzmoney = Totalprice2;
|
|||
|
|
if (hyzmoney > Convert.ToDouble(umodel.umoney33.ToString("f2")))
|
|||
|
|
{
|
|||
|
|
hyzmoney = Convert.ToDouble(umodel.umoney33.ToString("f2"));
|
|||
|
|
}
|
|||
|
|
if (hyzmoney > 0.00)
|
|||
|
|
{
|
|||
|
|
Model.user_Results_jl2 mjl2 = new Model.user_Results_jl2();
|
|||
|
|
mjl2.MemberId = umodel.Id;
|
|||
|
|
mjl2.MemberId2 = 0;
|
|||
|
|
mjl2.Addmoney = -hyzmoney;
|
|||
|
|
mjl2.Cutmoney = 0;
|
|||
|
|
mjl2.Totalmoney = umodel.umoney33 - hyzmoney;
|
|||
|
|
mjl2.addtime = dt;
|
|||
|
|
mjl2.BZContent = "流量包完成";
|
|||
|
|
mjl2.PayID = "";
|
|||
|
|
mjl2.OrdersIDs = "";
|
|||
|
|
mjl2.OrdersID = 0;
|
|||
|
|
mjl2.utype = 5;
|
|||
|
|
mjl2.utype2 = 0;
|
|||
|
|
mjl2.Seef = -1;
|
|||
|
|
mjl2.seeftime = dt;
|
|||
|
|
mjl2.gtype = gtype;
|
|||
|
|
daojl2.Add(mjl2);
|
|||
|
|
daoUser.UpdateMoney("umoney33", -hyzmoney, umodel.Id);
|
|||
|
|
daoUser.UpdateMoney("umoney19", -hyzmoney, umodel.Id);
|
|||
|
|
umodel.umoney33 -= hyzmoney;
|
|||
|
|
umodel.umoney19 -= hyzmoney;
|
|||
|
|
Mtxfw.DAL.MemberStatistics.UpdteuLevel0(gtype, config, umodel.Id, umodel.ContactIDS, umodel.uLevel, umodel.uLevel4, umodel.IFBecomeAgents, Convert.ToInt32(umodel.umoney33.ToString().Split('.')[0]), dt);
|
|||
|
|
string[] ASuperiorsIDS = (umodel.ContactIDS).Split(',');
|
|||
|
|
for (int ak = ASuperiorsIDS.Length - 2; ak > 0; ak--)
|
|||
|
|
{
|
|||
|
|
if (ASuperiorsIDS[ak] != "")
|
|||
|
|
{
|
|||
|
|
//
|
|||
|
|
DataSet ds0 = daoUser.GetList1("ID,ContactIDS,umoney33,uLevel,uLevel24,IFBecomeAgents", "gtype=" + gtype + " and UserState='正常' And IFStores=0 And uLevel17=0 And id=" + ASuperiorsIDS[ak]);
|
|||
|
|
if (ds0.Tables[0].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
int dID = Convert.ToInt32(ds0.Tables[0].Rows[0]["ID"].ToString());
|
|||
|
|
string dContactIDS = ds0.Tables[0].Rows[0]["ContactIDS"].ToString();
|
|||
|
|
int dumoney33 = Convert.ToInt32(ds0.Tables[0].Rows[0]["umoney33"].ToString().Split('.')[0]);
|
|||
|
|
int duLevel = Convert.ToInt32(ds0.Tables[0].Rows[0]["uLevel"].ToString());
|
|||
|
|
int duLevel24 = Convert.ToInt32(ds0.Tables[0].Rows[0]["uLevel24"].ToString());
|
|||
|
|
int dIFBecomeAgents = Convert.ToInt32(ds0.Tables[0].Rows[0]["IFBecomeAgents"].ToString());
|
|||
|
|
daoUser.UpdateMoney("umoney19", -hyzmoney, dID);
|
|||
|
|
if (ak == ASuperiorsIDS.Length - 2)
|
|||
|
|
{
|
|||
|
|
daoUser.UpdateMoney("umoney35", -hyzmoney, dID);
|
|||
|
|
}
|
|||
|
|
Mtxfw.DAL.MemberStatistics.UpdteuLevel0(gtype, config, dID, dContactIDS, duLevel, duLevel24, dIFBecomeAgents, dumoney33, dt);
|
|||
|
|
}
|
|||
|
|
ds0.Clear();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (ttype == 11)
|
|||
|
|
{
|
|||
|
|
if (umodel.uLevel42 == 1)
|
|||
|
|
{
|
|||
|
|
int ordercunt = daoorder.GetCount("gtype=" + gtype + " and ttype=11 and IFDelete=0 and O_Payed>0 and MemberId=" + umodel.Id);
|
|||
|
|
if (ordercunt == 0)
|
|||
|
|
{
|
|||
|
|
umodel.uLevel42 = 0;
|
|||
|
|
daoUser.UpdateuLevel("uLevel42", 0, umodel.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 = DateTime.Now;
|
|||
|
|
amodel.Author = "../image/order-ico.png";
|
|||
|
|
amodel.Content = "您的订单" + ModelOrder.orderid + "1小时内未付款,已被删除";
|
|||
|
|
amodel.Paths = "orders.html";
|
|||
|
|
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 = new DAL.Article().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);
|
|||
|
|
}
|
|||
|
|
Model.User_CZ_log logmodel = new Model.User_CZ_log();
|
|||
|
|
logmodel.MemberId = Card;
|
|||
|
|
logmodel.AddTime = dt;
|
|||
|
|
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
|||
|
|
logmodel.Body = "删除" + Mtxfw.Utility.Common.GetOrderType(ModelOrder.ttype) + ",会员:" + umodel.UserName + "(" + umodel.RealName + "),订单号:" + ModelOrder.orderid;
|
|||
|
|
logmodel.UType = 0;
|
|||
|
|
logmodel.gtype = gtype;
|
|||
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else if (strs == "1")
|
|||
|
|
{
|
|||
|
|
Mtxfw.Model.order_info ModelOrder = daoorder.GetModel(strID);
|
|||
|
|
if (ModelOrder != null)
|
|||
|
|
{
|
|||
|
|
TextBox Totalprice = (TextBox)Item.FindControl("txtTotalprice");
|
|||
|
|
ModelOrder.Totalprice = Convert.ToDouble(Totalprice.Text);
|
|||
|
|
daoorder.UpdateTotalprice(ModelOrder.Totalprice, ModelOrder.Id);
|
|||
|
|
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 = "修改订单金额,订单号" + model.orderid;
|
|||
|
|
logmodel.UType = 0;
|
|||
|
|
logmodel.gtype = gtype;
|
|||
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
Response.Redirect(Request.Url.AbsoluteUri);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
protected void IsGo_Click(object s, CommandEventArgs ex)
|
|||
|
|
{
|
|||
|
|
Int32 ID = int.Parse(ex.CommandName);
|
|||
|
|
daoorder.UpdateqyState(1, "1", DateTime.Now, ID);
|
|||
|
|
|
|||
|
|
Mtxfw.Utility.Tools.Message("处理成功!", Request.Url.AbsoluteUri);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected string GetProducts(int O_Id)
|
|||
|
|
{
|
|||
|
|
string ShowConent = "";
|
|||
|
|
System.Data.DataSet Ds_op = daoorderproduct.GetList("(Select utype from P_Product b where b.P_ID=a.pid) as cutype,(Select P_NAME from P_Product b where b.P_ID=a.pid) as prodName,(Select P_images from P_Product b where b.P_ID=a.pid) as prodimg,", "orderid=" + O_Id + " And IFDelete=0 Order By SubmitTime asc");
|
|||
|
|
if (Ds_op.Tables[0].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
for (int l = 0; l < Ds_op.Tables[0].Rows.Count; l++)
|
|||
|
|
{
|
|||
|
|
string pid2 = Ds_op.Tables[0].Rows[l]["id"].ToString();
|
|||
|
|
string prodimg2 = Ds_op.Tables[0].Rows[l]["prodimg"].ToString();
|
|||
|
|
string[] aprodimg = prodimg2.Split('|');
|
|||
|
|
string prodid2 = Ds_op.Tables[0].Rows[l]["pid"].ToString();
|
|||
|
|
string prodName2 = Ds_op.Tables[0].Rows[l]["prodName"].ToString();
|
|||
|
|
string guige2 = Ds_op.Tables[0].Rows[l]["guige"].ToString();
|
|||
|
|
string selcolor2 = Ds_op.Tables[0].Rows[l]["selcolor"].ToString();
|
|||
|
|
string Totalnum2 = Ds_op.Tables[0].Rows[l]["Totalnum"].ToString();
|
|||
|
|
string DJprice2 = Ds_op.Tables[0].Rows[l]["DJprice"].ToString();
|
|||
|
|
string Totalprice2 = Ds_op.Tables[0].Rows[l]["Totalprice"].ToString();
|
|||
|
|
string cutype = Ds_op.Tables[0].Rows[l]["cutype"].ToString();
|
|||
|
|
string strimg = "";
|
|||
|
|
|
|||
|
|
|
|||
|
|
string strUrl2 = "/shop/view-" + prodid2 + ".html";
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (guige2 != "")
|
|||
|
|
{
|
|||
|
|
Mtxfw.Model.P_Guige gmodel = new DAL.P_Guige().GetModel(Convert.ToInt32(guige2));
|
|||
|
|
if (gmodel != null)
|
|||
|
|
{
|
|||
|
|
prodName2 += " " + gmodel.G_Name;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (selcolor2 != "")
|
|||
|
|
{
|
|||
|
|
foreach (string img in aprodimg)
|
|||
|
|
{
|
|||
|
|
if (img.IndexOf(selcolor2) != -1)
|
|||
|
|
{
|
|||
|
|
strimg = img.Split(',')[0];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (strimg == "")
|
|||
|
|
{
|
|||
|
|
strimg = prodimg2.Split('|')[0].Split(',')[0];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
strimg = prodimg2.Split('|')[0].Split(',')[0];
|
|||
|
|
}
|
|||
|
|
ShowConent += "<span title=\"" + prodName2 + " " + selcolor2 + "\"><img src='" + (strimg.IndexOf("http") != -1 ? strimg : Mtxfw.Utility.Common.GetCoverPic(strimg, "40x40", "cut")) + "'/><br>" + prodName2 + "</span>\n";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
Ds_op.Clear();
|
|||
|
|
return ShowConent;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|