135 lines
8.2 KiB
C#
135 lines
8.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Data;
|
|
namespace Mtxfw.shop
|
|
{
|
|
public partial class Member_Orders_Info : Mtxfw.Utility.MemberBase
|
|
{
|
|
Mtxfw.DAL.order_info daoorder = new Mtxfw.DAL.order_info();
|
|
Mtxfw.DAL.order_product_info daoorderproduct = new Mtxfw.DAL.order_product_info();
|
|
Mtxfw.DAL.P_Product daoProduct = new Mtxfw.DAL.P_Product();
|
|
Mtxfw.DAL.user_address daoaddress = new Mtxfw.DAL.user_address();
|
|
Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
|
|
protected string O_Id = "", orderid = "", utype = "", O_TotalNum = "", O_TotalMoney = "", O_SubmitDate = "", strStatus = "", strStatus2 = "", address = "", ShowConent = "", stryhj="";
|
|
|
|
protected override void OnLoad(EventArgs e)
|
|
{
|
|
base.OnLoad(e);
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
myDataBind();
|
|
Page.Title = "订单详情 - " + GetWebName;
|
|
}
|
|
}
|
|
|
|
private void myDataBind()
|
|
{
|
|
if (!String.IsNullOrEmpty(Request.QueryString["Id"]))
|
|
{
|
|
O_Id = Request.QueryString["Id"].ToString();
|
|
int Id = int.Parse(O_Id);
|
|
Model.order_info model = daoorder.GetModel(Id);
|
|
if (model != null)
|
|
{
|
|
orderid = model.orderid;
|
|
utype = model.utype;
|
|
switch (utype)
|
|
{
|
|
case "0":
|
|
utype = "现金购买";
|
|
break;
|
|
case "1":
|
|
utype = "积分兑换";
|
|
break;
|
|
case "2":
|
|
utype = "积分兑换";
|
|
break;
|
|
case "3":
|
|
utype = "在线支付";
|
|
break;
|
|
}
|
|
O_TotalNum = model.Totalnum.ToString();
|
|
O_TotalMoney = model.Totalprice.ToString("f2");
|
|
if (Convert.ToDouble(model.Totalprice3.ToString("f2")) > 0.00)
|
|
{
|
|
O_TotalMoney += " 使用积分:" + model.Totalprice3.ToString("f2");
|
|
}
|
|
O_SubmitDate = model.O_SubmitDate.ToString();
|
|
address = model.Contactname + " " + new DAL.province().GetProvince(model.Province) + new DAL.city().GetCity(model.City) + new DAL.county().GetCounty(model.County) + model.Address + " " + model.Contacttel;
|
|
if (model.O_yhj != "")
|
|
{
|
|
string[] ayhj = model.O_yhj.Split(',');
|
|
foreach (string yhj in ayhj)
|
|
{
|
|
if (yhj.Trim() != "")
|
|
{
|
|
int yhjid = int.Parse(yhj.Trim());
|
|
DataSet ds = daoorder.GetList("(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,(select P_JiangLi from P_Product c where c.P_ID=a.pid) as P_JiangLi,", "id=" + yhjid);
|
|
if (ds.Tables[0].Rows.Count > 0)
|
|
{
|
|
stryhj += "<a href=\"View-" + ds.Tables[0].Rows[0]["pid"].ToString() + ".html\">" + ds.Tables[0].Rows[0]["prodName"].ToString() + "</a> ¥" + ds.Tables[0].Rows[0]["P_JiangLi"].ToString() + "元 ";
|
|
}
|
|
ds.Clear();
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
stryhj += "没有使用优惠卷";
|
|
}
|
|
string[] aStatus = Mtxfw.Utility.Common.GetOrderStatus(model.utype, model.Id.ToString(), model.O_SubmitDate.ToString(), model.O_Payed.ToString(), model.O_Payed_Date.ToString(), 0);
|
|
strStatus = aStatus[0];
|
|
strStatus2 = aStatus[1];
|
|
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,(Select selcolor from P_Product b where b.P_ID=a.pid) as cselcolor,", "utype='0' And orderid=" + O_Id + " And UserID=" + Card + " 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 prodimg2 = Ds_op.Tables[0].Rows[l]["prodimg"].ToString().Split('|')[0].Split(',')[0];
|
|
string prodid2 = Ds_op.Tables[0].Rows[l]["pid"].ToString();
|
|
string prodName2 = Ds_op.Tables[0].Rows[l]["prodName"].ToString();
|
|
string selcolor2 = Ds_op.Tables[0].Rows[l]["cselcolor"].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 strUrl2 = "/view-" + prodid2 + ".html";
|
|
if (cutype == "3")
|
|
{
|
|
|
|
ShowConent += "<tr><td><div class=\"taocaolist\"><div class=\"taocaoproducts\">\n";
|
|
System.Data.DataSet tc_op = daoProduct.GetList("", "utype='0' and charindex(',' + Convert(varchar(50),P_ID) + ',',(Select P_CATEGORYs From P_Product b Where P_ID=" + prodid2 + "))>0 And P_State=N'已处理' Order By P_ADDATE asc");
|
|
if (tc_op.Tables[0].Rows.Count > 0)
|
|
{
|
|
for (int o = 0; o < Ds_op.Tables[0].Rows.Count; o++)
|
|
{
|
|
string prodimg3 = tc_op.Tables[0].Rows[o]["P_images"].ToString().Split('|')[0].Split(',')[0];
|
|
string prodid3 = tc_op.Tables[0].Rows[o]["P_ID"].ToString();
|
|
string prodName3 = tc_op.Tables[0].Rows[o]["P_NAME"].ToString();
|
|
string selcolor3 = tc_op.Tables[0].Rows[o]["P_yanse"].ToString();
|
|
string strUrl3 = "/view-" + prodid3 + ".html";
|
|
ShowConent += "<a href='" + strUrl3 + "' class='black' target='_blank' title=\"" + prodName3 + (selcolor3.Split('#')[0] != "" ? "[" + selcolor3.Split('#')[0] + "]" : "") + "\"><img src='" + Mtxfw.Utility.Common.GetCoverPic(prodimg3, "60x60", "cut") + "'/></a>\n";
|
|
}
|
|
}
|
|
tc_op.Clear();
|
|
ShowConent += "</div><br><a href='/Member_Orders_List_taocao.aspx?id=" + prodid2 + "' class='black' target='_blank'>" + prodName2 + "</a></div></td>";
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
ShowConent += " <tr><td><a href='" + strUrl2 + "' class='black' target='_blank' title=\"" + prodName2 + (selcolor2.Split('#')[0] != "" ? "[" + selcolor2.Split('#')[0] + "]" : "") + "\"><img src='" + Mtxfw.Utility.Common.GetCoverPic(prodimg2, "60x60", "cut") + "'/><br>" + prodName2 + "</a></td>\n";
|
|
}
|
|
ShowConent += "<td>" + Convert.ToDouble(DJprice2).ToString("f2") + "</td><td>" + Totalnum2 + "</td><td>" + Convert.ToDouble(Totalprice2).ToString("f2") + "</td></tr>\n";
|
|
}
|
|
}
|
|
Ds_op.Clear();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |