public void bindReturnInfo() { int returnId = this.Page.Request["ReturnId"].ToInt(0); ReturnInfo returnInfo = TradeHelper.GetReturnInfo(returnId); if (returnInfo == null) { this.ShowMsg("退货信息错误!", false); } else { HiddenField hiddenField = this.hidReturnStatus; int num = (int)returnInfo.HandleStatus; hiddenField.Value = num.ToString(); OrderInfo orderInfo = TradeHelper.GetOrderInfo(returnInfo.OrderId); if (orderInfo == null) { this.ShowMsg("错误的订单信息!", false); } else { if (string.IsNullOrEmpty(returnInfo.SkuId)) { this.listPrducts.DataSource = orderInfo.LineItems.Values; } else { Dictionary <string, LineItemInfo> dictionary = new Dictionary <string, LineItemInfo>(); foreach (LineItemInfo value in orderInfo.LineItems.Values) { if (value.SkuId == returnInfo.SkuId) { dictionary.Add(value.SkuId, value); } } this.listPrducts.DataSource = dictionary.Values; } this.listPrducts.DataBind(); this.litOrderId.Text = orderInfo.PayOrderId; this.litOrderTotal.Text = orderInfo.GetTotal(false).F2ToString("f2"); this.litRefundReason.Text = returnInfo.ReturnReason; this.litRefundTotal.Text = returnInfo.RefundAmount.F2ToString("f2"); this.litRemark.Text = returnInfo.UserRemark; Literal literal = this.litReturnQuantity; num = returnInfo.Quantity; literal.Text = num.ToString(); if (returnInfo.RefundType == RefundTypes.InBankCard) { this.litType.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.RefundType, 0) + "(" + returnInfo.BankName + " " + returnInfo.BankAccountName + " " + returnInfo.BankAccountNo + ")"; } else { this.litType.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.RefundType, 0); } string userCredentials = returnInfo.UserCredentials; if (!string.IsNullOrEmpty(userCredentials)) { string[] array = userCredentials.Split('|'); userCredentials = ""; string[] array2 = array; foreach (string str in array2) { userCredentials += string.Format(this.credentialsImgHtml, Globals.GetImageServerUrl() + str); } this.litImageList.Text = userCredentials; } else { this.divCredentials.Visible = false; } if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund) { this.btnAcceptReturn.Text = "确认退款"; this.btnRefuseReturn.Text = "拒绝退款"; this.AfterSaleType = "退款"; } if (returnInfo.HandleStatus == ReturnStatus.Applied && !orderInfo.IsStoreCollect) { this.btnAcceptReturn.Visible = true; this.btnRefuseReturn.Visible = true; } if (returnInfo.HandleStatus == ReturnStatus.Deliverying && this.UserStoreId > 0 && !orderInfo.IsStoreCollect) { this.btnGetGoods.Visible = true; } if ((orderInfo.StoreId == this.UserStoreId || orderInfo.StoreId <= 0 || (!orderInfo.IsStoreCollect && this.UserStoreId == 0)) && (returnInfo.HandleStatus == ReturnStatus.GetGoods || (returnInfo.HandleStatus == ReturnStatus.Deliverying && orderInfo.StoreId <= 0))) { if (returnInfo.HandleStatus == ReturnStatus.Deliverying) { this.btnFinishReturn.Text = "确认收货并完成退款"; } this.btnFinishReturn.Visible = true; } if (returnInfo.HandleStatus != ReturnStatus.Refused && returnInfo.HandleStatus != ReturnStatus.Returned) { this.inputPanel.Visible = true; this.showPanel.Visible = false; } else { this.inputPanel.Visible = false; this.showPanel.Visible = true; } if (returnInfo.HandleStatus != 0) { this.txtAdminCellPhone.Visible = false; this.txtAdminShipAddress.Visible = false; this.txtAdminShipTo.Visible = false; this.litAdminCellPhone.Visible = true; this.litAdminShipAddrss.Visible = true; this.litAdminShipTo.Visible = true; this.litAdminCellPhone.Text = returnInfo.AdminCellPhone; this.litAdminShipTo.Text = returnInfo.AdminShipTo; this.litAdminShipAddrss.Text = returnInfo.AdminShipAddress; } else if (orderInfo.SupplierId > 0) { ShippersInfo defaultGetGoodsShipperBysupplierId = SalesHelper.GetDefaultGetGoodsShipperBysupplierId(orderInfo.SupplierId); if (defaultGetGoodsShipperBysupplierId != null) { Literal literal2 = this.litAdminShipAddrss; TextBox textBox = this.txtAdminShipAddress; string text3 = literal2.Text = (textBox.Text = RegionHelper.GetFullRegion(defaultGetGoodsShipperBysupplierId.RegionId, " ", true, 0) + " " + defaultGetGoodsShipperBysupplierId.Address); Literal literal3 = this.litAdminShipTo; TextBox textBox2 = this.txtAdminShipTo; text3 = (literal3.Text = (textBox2.Text = defaultGetGoodsShipperBysupplierId.ShipperName)); Literal literal4 = this.litAdminCellPhone; TextBox textBox3 = this.txtAdminCellPhone; text3 = (literal4.Text = (textBox3.Text = defaultGetGoodsShipperBysupplierId.CellPhone)); } } else if (orderInfo.StoreId > 0) { StoresInfo storeById = DepotHelper.GetStoreById(orderInfo.StoreId); if (storeById != null) { Literal literal5 = this.litAdminShipAddrss; TextBox textBox4 = this.txtAdminShipAddress; string text3 = literal5.Text = (textBox4.Text = RegionHelper.GetFullRegion(storeById.RegionId, " ", true, 0) + " " + storeById.Address); Literal literal6 = this.litAdminShipTo; TextBox textBox5 = this.txtAdminShipTo; text3 = (literal6.Text = (textBox5.Text = storeById.ContactMan)); Literal literal7 = this.litAdminCellPhone; TextBox textBox6 = this.txtAdminCellPhone; text3 = (literal7.Text = (textBox6.Text = storeById.Tel)); } } else { ShippersInfo defaultOrFirstGetGoodShipper = TradeHelper.GetDefaultOrFirstGetGoodShipper(); if (defaultOrFirstGetGoodShipper != null) { Literal literal8 = this.litAdminShipAddrss; TextBox textBox7 = this.txtAdminShipAddress; string text3 = literal8.Text = (textBox7.Text = RegionHelper.GetFullRegion(defaultOrFirstGetGoodShipper.RegionId, " ", true, 0) + " " + defaultOrFirstGetGoodShipper.Address); Literal literal9 = this.litAdminShipTo; TextBox textBox8 = this.txtAdminShipTo; text3 = (literal9.Text = (textBox8.Text = defaultOrFirstGetGoodShipper.ShipperName)); Literal literal10 = this.litAdminCellPhone; TextBox textBox9 = this.txtAdminCellPhone; text3 = (literal10.Text = (textBox9.Text = defaultOrFirstGetGoodShipper.CellPhone)); } } this.litRefundMoney.Text = returnInfo.RefundAmount.F2ToString("f2") + "元"; this.txtAdminRemark.Text = returnInfo.AdminRemark; if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund) { this.txtStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 3); } else { this.txtStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 0); } this.litRefundMoney.Text = returnInfo.RefundAmount.F2ToString("f2") + "元"; Literal literal11 = this.txtAfterSaleId; num = returnInfo.ReturnId; literal11.Text = num.ToString(); this.txtPayMoney.Text = orderInfo.GetTotal(false).F2ToString("f2"); this.txtRefundMoney.Text = returnInfo.RefundAmount.F2ToString("f2"); HiddenField hiddenField2 = this.hidAfterSaleType; num = (int)returnInfo.AfterSaleType; hiddenField2.Value = num.ToString(); this.hidRefundMaxAmount.Value = orderInfo.GetCanRefundAmount(returnInfo.SkuId, null, 0).F2ToString("f2"); if (returnInfo.AfterSaleType == AfterSaleTypes.ReturnAndRefund && (returnInfo.HandleStatus == ReturnStatus.Deliverying || returnInfo.HandleStatus == ReturnStatus.GetGoods || returnInfo.HandleStatus == ReturnStatus.Returned)) { this.btnViewLogistic.Visible = true; AttributeCollection attributes = this.btnViewLogistic.Attributes; num = returnInfo.ReturnId; attributes.Add("returnsid", num.ToString()); AttributeCollection attributes2 = this.btnViewLogistic.Attributes; num = returnInfo.ReturnId; attributes2.Add("returnsid", num.ToString()); this.btnViewLogistic.Attributes.Add("expresscompanyname", returnInfo.ExpressCompanyName.ToString()); this.btnViewLogistic.Attributes.Add("shipordernumber", returnInfo.ShipOrderNumber.ToString()); } if (orderInfo.SupplierId > 0) { this.btnGetGoods.Visible = false; } } } }
public void bindReplaceInfo() { int replaceId = this.Page.Request["replaceId"].ToInt(0); ReplaceInfo replaceInfo = TradeHelper.GetReplaceInfo(replaceId); if (replaceInfo == null) { this.ShowMsg("换货信息错误!", false); } else { OrderInfo orderInfo = TradeHelper.GetOrderInfo(replaceInfo.OrderId); HiddenField hiddenField = this.hidReplaceStatus; int num = (int)replaceInfo.HandleStatus; hiddenField.Value = num.ToString(); if (orderInfo == null) { this.ShowMsg("错误的订单信息!", false); } else { if (string.IsNullOrEmpty(replaceInfo.SkuId)) { this.listPrducts.DataSource = orderInfo.LineItems.Values; } else { Dictionary <string, LineItemInfo> dictionary = new Dictionary <string, LineItemInfo>(); foreach (LineItemInfo value in orderInfo.LineItems.Values) { if (value.SkuId == replaceInfo.SkuId) { dictionary.Add(value.SkuId, value); } } this.listPrducts.DataSource = dictionary.Values; } this.txtAdminRemark.Text = replaceInfo.AdminRemark; this.listPrducts.DataBind(); this.litOrderId.Text = orderInfo.PayOrderId; this.litOrderTotal.Text = orderInfo.GetTotal(false).F2ToString("f2"); this.litRefundReason.Text = replaceInfo.ReplaceReason; this.litRemark.Text = replaceInfo.UserRemark; Literal literal = this.litReturnQuantity; num = replaceInfo.Quantity; literal.Text = num.ToString(); string userCredentials = replaceInfo.UserCredentials; if (!string.IsNullOrEmpty(userCredentials)) { string[] array = userCredentials.Split('|'); userCredentials = ""; string[] array2 = array; foreach (string str in array2) { userCredentials += string.Format(this.credentialsImgHtml, Globals.GetImageServerUrl() + str); } this.litImageList.Text = userCredentials; } else { this.divCredentials.Visible = false; } if (orderInfo.StoreId <= 0) { if (replaceInfo.HandleStatus == ReplaceStatus.Applied) { this.btnAcceptReplace.Visible = true; this.btnRefuseReplace.Visible = true; } else if (replaceInfo.HandleStatus == ReplaceStatus.UserDelivery) { this.btnGetAndSendGoods.Visible = true; } } if (replaceInfo.HandleStatus != 0) { this.txtAdminCellPhone.Visible = false; this.txtAdminShipAddress.Visible = false; this.txtAdminShipTo.Visible = false; this.litAdminCellPhone.Visible = true; this.litAdminShipAddrss.Visible = true; this.litAdminShipTo.Visible = true; this.litAdminCellPhone.Text = replaceInfo.AdminCellPhone; this.litAdminShipTo.Text = replaceInfo.AdminShipTo; this.litAdminShipAddrss.Text = replaceInfo.AdminShipAddress; } else if (orderInfo.SupplierId > 0) { ShippersInfo defaultGetGoodsShipperBysupplierId = SalesHelper.GetDefaultGetGoodsShipperBysupplierId(orderInfo.SupplierId); if (defaultGetGoodsShipperBysupplierId != null) { Literal literal2 = this.litAdminShipAddrss; TextBox textBox = this.txtAdminShipAddress; string text3 = literal2.Text = (textBox.Text = RegionHelper.GetFullRegion(defaultGetGoodsShipperBysupplierId.RegionId, " ", true, 0) + " " + defaultGetGoodsShipperBysupplierId.Address); Literal literal3 = this.litAdminShipTo; TextBox textBox2 = this.txtAdminShipTo; text3 = (literal3.Text = (textBox2.Text = defaultGetGoodsShipperBysupplierId.ShipperName)); Literal literal4 = this.litAdminCellPhone; TextBox textBox3 = this.txtAdminCellPhone; text3 = (literal4.Text = (textBox3.Text = defaultGetGoodsShipperBysupplierId.CellPhone)); } } else if (orderInfo.StoreId > 0) { StoresInfo storeById = DepotHelper.GetStoreById(orderInfo.StoreId); if (storeById != null) { Literal literal5 = this.litAdminShipAddrss; TextBox textBox4 = this.txtAdminShipAddress; string text3 = literal5.Text = (textBox4.Text = RegionHelper.GetFullRegion(storeById.RegionId, " ", true, 0) + " " + storeById.Address); Literal literal6 = this.litAdminShipTo; TextBox textBox5 = this.txtAdminShipTo; text3 = (literal6.Text = (textBox5.Text = storeById.ContactMan)); Literal literal7 = this.litAdminCellPhone; TextBox textBox6 = this.txtAdminCellPhone; text3 = (literal7.Text = (textBox6.Text = storeById.Tel)); } } else { ShippersInfo defaultOrFirstGetGoodShipper = TradeHelper.GetDefaultOrFirstGetGoodShipper(); if (defaultOrFirstGetGoodShipper != null) { Literal literal8 = this.litAdminShipAddrss; TextBox textBox7 = this.txtAdminShipAddress; string text3 = literal8.Text = (textBox7.Text = RegionHelper.GetFullRegion(defaultOrFirstGetGoodShipper.RegionId, " ", true, 0) + " " + defaultOrFirstGetGoodShipper.Address); Literal literal9 = this.litAdminShipTo; TextBox textBox8 = this.txtAdminShipTo; text3 = (literal9.Text = (textBox8.Text = defaultOrFirstGetGoodShipper.ShipperName)); Literal literal10 = this.litAdminCellPhone; TextBox textBox9 = this.txtAdminCellPhone; text3 = (literal10.Text = (textBox9.Text = defaultOrFirstGetGoodShipper.CellPhone)); } } if (replaceInfo.HandleStatus == ReplaceStatus.UserDelivery) { this.btnViewUserLogistic.Visible = true; AttributeCollection attributes = this.btnViewUserLogistic.Attributes; num = replaceInfo.ReplaceId; attributes.Add("replaceid", num.ToString()); this.btnViewUserLogistic.Attributes.Add("expresscompanyname", replaceInfo.UserExpressCompanyName.ToString()); this.btnViewUserLogistic.Attributes.Add("shipordernumber", replaceInfo.UserShipOrderNumber.ToString()); } if (replaceInfo.HandleStatus == ReplaceStatus.MerchantsDelivery || replaceInfo.HandleStatus == ReplaceStatus.Replaced) { this.btnViewMallLogistic.Visible = true; AttributeCollection attributes2 = this.btnViewMallLogistic.Attributes; num = replaceInfo.ReplaceId; attributes2.Add("replaceid", num.ToString()); this.btnViewMallLogistic.Attributes.Add("expresscompanyname", replaceInfo.ExpressCompanyName.ToString()); this.btnViewMallLogistic.Attributes.Add("shipordernumber", replaceInfo.ShipOrderNumber.ToString()); } string str2 = string.IsNullOrEmpty(orderInfo.RealName) ? "" : (orderInfo.RealName.Replace("\n\r", "").Replace("\n", "").Replace("\r", "") + " (" + (string.IsNullOrEmpty(orderInfo.CellPhone) ? orderInfo.TelPhone : orderInfo.CellPhone) + ")"); str2 = str2 + orderInfo.ShippingRegion + " " + orderInfo.Address; this.litUserAddress.Text = str2; this.txtStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)replaceInfo.HandleStatus, 0); Literal literal11 = this.txtAfterSaleId; num = replaceInfo.ReplaceId; literal11.Text = num.ToString(); if (orderInfo.SupplierId > 0) { this.btnGetAndSendGoods.Visible = false; } } } }