📄 orderinfo.aspx.cs
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using System.Text;
using Shop.Web.UI;
namespace YXShop.Web.Admin.Orders
{
public partial class orderInfo : System.Web.UI.Page
{
private static string orderId = "";// "yx201251020";
private static decimal remiPrice = 0;
private static decimal paymPrice = 0;
private static decimal prepPrice = 0;
public decimal inPrice = 0;
YXShop.BLL.RemittanceInfo Remibll = new YXShop.BLL.RemittanceInfo();//银行支付
YXShop.BLL.PaymentMoney paymbll = new YXShop.BLL.PaymentMoney();//现金支付
YXShop.BLL.PrepayMoney prepbll = new YXShop.BLL.PrepayMoney();//预付款支付
YXShop.BLL.Orders bll = new YXShop.BLL.Orders();
YXShop.BLL.OrderInvoice bllInv = new YXShop.BLL.OrderInvoice();
YXShop.BLL.LineItem orderItem = new YXShop.BLL.LineItem();
YXShop.BLL.InvoiceItem invoBll = new YXShop.BLL.InvoiceItem();
YXShop.BLL.UserInAndExp usieBll = new YXShop.BLL.UserInAndExp();
public YXShop.Model.Orders model = null;
BasePage bp = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!PowerTree.PowerPass.isPass("006001001", PowerTree.PowerPanel.PowerType.look))
{
bp = new BasePage();
bp.PageError("对不起,你没有查看订单详情页面的权限!", "../index.aspx");
}
if ((!IsPostBack) || ((Request["Event"] != null) && (Request["Event"] != "")))
{
Button4.Attributes.Add("onclick", "return confirm('你确定要作废此订单!');");
Button5.Attributes.Add("onclick", "return confirm('你确定要暂停处理此订单吗!')");
Button18.Attributes.Add("onclick", "return confirm('你确定要删除些订单吗!')");
if (!string.IsNullOrEmpty(Request.QueryString["OrderID"]))
{
orderId = YXShop.Common.WebUtility.replaceStr(Request.QueryString["OrderID"]);
InitStatus(true);
bindOrderInfo(orderId);
bindProduct(orderId);
}
else
{
Response.Redirect("orderList.aspx");
}
}
}
private void bindOrderInfo(string orderID)
{
List<YXShop.Model.Orders> li = bll.GetListByColumn("OrderID", orderID);
if (li.Count == 1)
{
model = li[0];
}
else
{
model = new YXShop.Model.Orders();
Response.Redirect("orderList.aspx");
}
invoInfo.Text = checkInvoiceInfo(orderId);
remark.Text = model.Remark;
Label2.Text = model.PaymentType == 1 ? "在线支付" : "银行汇款";
YXShop.Model.RemittanceInfo remiModel = Remibll.GetModel(orderId);
YXShop.Model.PaymentMoney paymModel = paymbll.GetModel(orderId);
YXShop.Model.PrepayMoney prepModel = prepbll.GetModel(orderId);
remiPrice = Convert.ToDecimal(remiModel != null ? remiModel.RemittanceMoney : 0);
paymPrice = Convert.ToDecimal(paymModel != null ? paymModel.GatheringMoney : 0);
prepPrice = Convert.ToDecimal(prepModel != null ? prepModel.PayoutMoney : 0);
inPrice = remiPrice + paymPrice + prepPrice;
#region 状态信息控制
int orderStatu = li[0].OrderStatus;
int paymentStatu = li[0].PaymentStatus;
int ogisticsStatu = li[0].OgisticsStatus;
if (orderStatu == 1) //暂停处理
{
InitStatus(false);//所有状态按钮不可用
Button6.Enabled = true;
}
else if (orderStatu == 7) //订单作废
{
InitStatus(false);
Button6.Enabled = true;
Button18.Enabled = true;
}
else
{
InitStatus(true);
Button6.Enabled = false;
#region 订单状态
switch (orderStatu)
{
case 0:
Button3.Enabled = false;
Button6.Enabled = false;
break;
case 1:
Button5.Enabled = false;
break;
case 2:
Button2.Enabled = false;
Button6.Enabled = false;
break;
case 3:
Button3.Enabled = false;
break;
case 4:
Button12.Enabled = false;
break;
case 5:
Button2.Enabled = false;
Button3.Enabled = false;
Button4.Enabled = false;
Button5.Enabled = false;
Button6.Enabled = false;
Button15.Enabled = false;
break;
case 6:
Button3.Enabled = false;
break;
default:
break;
}
#endregion
#region 支付状态
switch (paymentStatu)
{
case 0:
Button15.Enabled = false;
Button10.Enabled = false;
break;
case 1:
Button7.Enabled = false;
Button8.Enabled = false;
Button9.Enabled = false;
Button10.Enabled = true;
break;
case 2:
case 3:
Button15.Enabled = false;
Button10.Enabled = true;
break;
default:
break;
}
#endregion
#region 物流状态
switch (ogisticsStatu)
{
case 0:
Button13.Enabled = false;
Button14.Enabled = false;
Button15.Enabled = false;
Button17.Enabled = false;
Button18.Enabled = false;
break;
case 1:
Button14.Enabled = false;
Button12.Enabled = false;
break;
case 2:
Button12.Enabled = false;
Button17.Enabled = false;
break;
case 3:
Button13.Enabled = false;
break;
default:
break;
}
#endregion
}
#endregion
//发票处理,待修改
YXShop.BLL.OrderInvoice ordIBll = new YXShop.BLL.OrderInvoice();
List<YXShop.Model.OrderInvoice> ordIList = ordIBll.GetListByColumn("OrderID", orderId);
List<YXShop.Model.InvoiceItem> invoMList = invoBll.GetListByColumn("OrderID", orderId);
if (invoMList != null && ordIList != null)
{
if (ordIList.Count > 0 && invoMList.Count == 0)
{
Button14.Enabled = true;
}
else
{
Button14.Enabled = false;
}
}
else
{
Button14.Enabled = false;
}
Button11.Enabled = false;
}
#region 客户信息查询
protected string UserName(int UID)
{
string asd = "";
YXShop.BLL.UserCommon usBll = new YXShop.BLL.UserCommon();
List<YXShop.Model.UserCommon> usList = usBll.GetListByColumn("UID", UID);
if (usList != null && usList.Count == 1)
{
asd = usList[0].UserName;
}
return asd;
}
protected string UserReal(int UserID)
{
string str = "";
YXShop.BLL.MemberInfo data = new YXShop.BLL.MemberInfo();
List<YXShop.Model.MemberInfo> dataStr = data.GetListByColumn("UID", UserID);
if (dataStr.Count > 0)
{
str = dataStr[0].cTrueName;
}
return str;
}
#endregion
#region Formant Str
public string checkInv(string OrderId)
{
YXShop.BLL.OrderInvoice datab = new YXShop.BLL.OrderInvoice();
List<YXShop.Model.OrderInvoice> data = datab.GetListByColumn("OrderID", OrderId);
if (data.Count > 0)
{
return "√";
}
return "<span style='color:red'>×</span>";
}
public string checkOrderStatu(object obj)
{
string reStr = string.Empty;
Type orderStatu = typeof(YXShop.Common.StatuEnum.OrderStatu);
bool bl = YXShop.Common.WebUtility.isNumeric(obj);
if (bl)
{
reStr = Enum.GetName(orderStatu, obj);
}
return reStr;
}
public string checkPaymentStatu(object obj)
{
string reStr = string.Empty;
Type paymentStatu = typeof(YXShop.Common.StatuEnum.PaymentStatu);
bool bl = YXShop.Common.WebUtility.isNumeric(obj);
if (bl)
{
reStr = Enum.GetName(paymentStatu, obj);
}
return reStr;
}
public string checkOgisticsStatu(object obj)
{
string reStr = string.Empty;
Type ogisticsStatu = typeof(YXShop.Common.StatuEnum.OgisticsStatus);
bool bl = YXShop.Common.WebUtility.isNumeric(obj);
if (bl)
{
reStr = Enum.GetName(ogisticsStatu, obj);
}
return reStr;
}
public string checkInvoice(string OrderId)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -