protected override void AttachChildControls() { this.orderId = this.Page.Request["orderId"].ToNullString(); this.divIng = (HtmlControl)this.FindControl("divIng"); this.divSuccess = (HtmlControl)this.FindControl("divSuccess"); this.litJoin = (HtmlGenericControl)this.FindControl("litJoin"); this.litCreate = (HtmlGenericControl)this.FindControl("litCreate"); this.litNeedPerson = (HtmlGenericControl)this.FindControl("litNeedPerson"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTimestamp = (HtmlInputHidden)this.FindControl("hdTimestamp"); this.hdNonceStr = (HtmlInputHidden)this.FindControl("hdNonceStr"); this.hdSignature = (HtmlInputHidden)this.FindControl("hdSignature"); this.hdTitle = (HtmlInputHidden)this.FindControl("hdTitle"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdImgUrl = (HtmlInputHidden)this.FindControl("hdImgUrl"); this.hdLink = (HtmlInputHidden)this.FindControl("hdLink"); OrderInfo orderInfo = OrderHelper.GetOrderInfo(this.orderId); if (orderInfo == null) { base.GotoResourceNotFound("错误的订单信息"); } else { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(orderInfo.FightGroupId); if (fightGroup == null) { base.GotoResourceNotFound("错误的拼团信息"); } else { int fightGroupActiveNumber = VShopHelper.GetFightGroupActiveNumber(orderInfo.FightGroupId); int num = fightGroup.JoinNumber - fightGroupActiveNumber; num = ((num > 0) ? num : 0); if (orderInfo.IsFightGroupHead) { this.litJoin.Visible = false; this.litNeedPerson.InnerText = $"{num}"; } else { this.litJoin.InnerText = $"您已参团成功,还差{num}人就可以拼团成功了!"; this.litCreate.Visible = false; } if (num == 0) { this.divIng.Visible = false; } else { this.divSuccess.Visible = false; } IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroup.ProductId, out dictionary, out list); this.SetWXShare(fightGroup, productDetails); } } }
public int UpdateFightOrderFaile(int fightGroupId) { FightGroupInfo fightGroupInfo = this.Get <FightGroupInfo>(fightGroupId); if (fightGroupInfo != null) { fightGroupInfo.Status = FightGroupStatus.FightGroupFail; this.Update(fightGroupInfo, null); return(fightGroupInfo.JoinNumber); } return(-1); }
protected override void Render(HtmlTextWriter writer) { if (this.Order != null) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.Order.FightGroupId); if (fightGroup != null && fightGroup.Status == FightGroupStatus.FightGroupIn && this.Order.OrderStatus == OrderStatus.BuyerAlreadyPaid) { base.Text = $" ({((Enum)(object)fightGroup.Status).ToDescription()}) "; } } base.Render(writer); }
private DataGridViewModel <Dictionary <string, object> > GetOrderList(OrderQuery query) { DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >(); DbQueryResult orders = OrderHelper.GetOrders(query); dataGridViewModel.rows = DataHelper.DataTableToDictionary(orders.Data); dataGridViewModel.total = orders.TotalRecords; string[] orderIds = (from d in dataGridViewModel.rows select d["OrderId"].ToString()).ToArray(); List <RefundInfo> refundInfos = TradeHelper.GetRefundInfos(orderIds); foreach (Dictionary <string, object> row in dataGridViewModel.rows) { OrderInfo order = TradeHelper.GetOrderInfo(row["OrderId"].ToString()); row.Add("OrderStatusText", OrderHelper.GetOrderStatusText(order.OrderStatus, order.ShippingModeId, order.IsConfirm, order.Gateway, 0, order.PreSaleId, order.DepositDate, false, order.ItemStatus, order.OrderType)); row.Add("CanConfirmOrder", order.CanConfirmOrder()); row.Add("canCheckTake", order.CanConfirmTakeCode()); row.Add("canCloseOrder", order.CanClose(base.CurrentSiteSetting.OpenMultStore, true)); row.Add("canOfflineReceipt", OrderHelper.CanConfirmOfflineReceipt(order, true)); row.Add("canSendGoods", order.CanSendGoods(base.CurrentSiteSetting.OpenMultStore)); row.Add("canFinishTrade", order.OrderStatus == OrderStatus.SellerAlreadySent && order.ItemStatus == OrderItemStatus.Nomarl); row.Add("canCancelSendGoods", order.OrderStatus == OrderStatus.SellerAlreadySent && (order.DadaStatus == DadaStatus.WaitOrder || order.DadaStatus == DadaStatus.WaitTake)); row.Add("InvoiceTypeText", string.IsNullOrEmpty(order.InvoiceTitle) ? "" : EnumDescription.GetEnumDescription((Enum)(object)order.InvoiceType, 0)); row.Add("dadaState", (order.DadaStatus != 0) ? ((Enum)(object)order.DadaStatus).ToDescription() : ""); RefundInfo refundInfo = refundInfos.FirstOrDefault((RefundInfo d) => d.OrderId == order.OrderId); if (refundInfo != null) { row.Add("RefundId", refundInfo.RefundId); } if (order.IsStoreCollect) { row.Add("isShowCheckRefund", order.OrderStatus == OrderStatus.ApplyForRefund && order.StoreId == base.CurrentManager.StoreId); } bool flag = false; if (order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(order.FightGroupId); if (fightGroup != null) { row.Add("FightGroupActivityId", fightGroup.FightGroupActivityId); if (fightGroup.Status == FightGroupStatus.FightGroupIn && order.OrderStatus != OrderStatus.WaitBuyerPay && order.OrderStatus != OrderStatus.Closed) { flag = true; } } } row.Add("FightGrouping", flag); } return(dataGridViewModel); }
public void CloseOrderToReduceFightGroup(int fightGroupId, string skuId, int quantity) { FightGroupInfo fightGroupInfo = this.Get <FightGroupInfo>(fightGroupId); if (fightGroupInfo != null) { FightGroupSkuInfo groupSkuInfoByActivityIdSkuId = this.GetGroupSkuInfoByActivityIdSkuId(fightGroupInfo.FightGroupActivityId, skuId); if (groupSkuInfoByActivityIdSkuId != null) { groupSkuInfoByActivityIdSkuId.BoughtCount -= quantity; this.Update(groupSkuInfoByActivityIdSkuId, null); } } }
private void CloseOrderToReduceFightGroup(int fightGroupId, string skuId, int quantity) { BaseDao baseDao = new BaseDao(); FightGroupInfo fightGroupInfo = baseDao.Get <FightGroupInfo>(fightGroupId); if (fightGroupInfo != null) { FightGroupSkuInfo groupSkuInfoByActivityIdSkuId = this.GetGroupSkuInfoByActivityIdSkuId(fightGroupInfo.FightGroupActivityId, skuId); if (groupSkuInfoByActivityIdSkuId != null) { groupSkuInfoByActivityIdSkuId.BoughtCount -= quantity; baseDao.Update(groupSkuInfoByActivityIdSkuId, null); } } }
private void SetWXShare(FightGroupInfo fightGroup, ProductInfo product) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); string jsApiTicket = base.GetJsApiTicket(true); string text = WAPTemplatedWebControl.GenerateNonceStr(); string text2 = WAPTemplatedWebControl.GenerateTimeStamp(); string absoluteUri = this.Page.Request.Url.AbsoluteUri; this.hdAppId.Value = base.site.WeixinAppId; this.hdTimestamp.Value = text2; this.hdNonceStr.Value = text; this.hdSignature.Value = base.GetSignature(jsApiTicket, text, text2, absoluteUri); FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); if (fightGroupActivitieInfo == null) { base.GotoResourceNotFound("活动已结束或者已删除"); } else { string icon = fightGroupActivitieInfo.Icon; this.hdImgUrl.Value = Globals.FullPath(string.IsNullOrEmpty(icon) ? masterSettings.DefaultProductThumbnail8 : icon); if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareTitle)) { this.hdTitle.Value = (string.IsNullOrEmpty(product.Title) ? product.ProductName : product.Title); } else { this.hdTitle.Value = fightGroupActivitieInfo.ShareTitle.Trim(); } if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareContent.Trim())) { this.hdDesc.Value = product.Meta_Description; } else { this.hdDesc.Value = fightGroupActivitieInfo.ShareContent.Trim(); } if (HiContext.Current.User.IsReferral()) { this.hdLink.Value = Globals.FullPath(string.Format("/vshop/FightGroupDetails.aspx?fightGroupId={0}&ReferralUserId=" + HiContext.Current.User.UserId, fightGroup.FightGroupId)); } else { this.hdLink.Value = Globals.FullPath($"/vshop/FightGroupDetails.aspx?fightGroupId={fightGroup.FightGroupId}"); } } }
private void FightGrouptBusiness() { if (this.FightGroupActivityId > 0) { FightGroupActivityInfo fightGroupActivitieInfo = VShopHelper.GetFightGroupActivitieInfo(this.FightGroupActivityId); int num; if (fightGroupActivitieInfo != null) { Literal literal = this.litMaxCount; num = fightGroupActivitieInfo.MaxCount; literal.Text = num.ToString(); } if (fightGroupActivitieInfo == null) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.FightGroupId); if (fightGroup != null) { fightGroupActivitieInfo = VShopHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); Literal literal2 = this.litMaxCount; num = fightGroupActivitieInfo.MaxCount; literal2.Text = num.ToString(); } } HtmlInputHidden htmlInputHidden = this.hidden_SKUSubmitOrderFightGroupActivityId; num = this.FightGroupActivityId; htmlInputHidden.Value = num.ToString(); HtmlInputHidden htmlInputHidden2 = this.hidden_SKUSubmitOrderFightGroupId; num = this.FightGroupId; htmlInputHidden2.Value = num.ToString(); IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(this.FightGroupActivityId); this.hidden_SKUSubmitOrderFightGroupActivityMinPrice.Value = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice).F2ToString("f2"); int num2 = fightGroupSkus.Sum(delegate(FightGroupSkuInfo c) { if (c.Stock >= c.TotalCount - c.BoughtCount) { return(c.TotalCount - c.BoughtCount); } return(c.Stock); }); this.hidden_SKUSubmitOrderFightGroupActivityStock.Value = ((num2 > 0) ? num2.ToString() : "0"); } }
private void SetWXShare(FightGroupInfo fightGroup, ProductInfo product) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); string absoluteUri = this.Page.Request.Url.AbsoluteUri; FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); if (fightGroupActivitieInfo != null) { string jsApiTicket = base.GetJsApiTicket(true); string text = WAPTemplatedWebControl.GenerateNonceStr(); string text2 = WAPTemplatedWebControl.GenerateTimeStamp(); this.hdAppId.Value = base.site.WeixinAppId; this.hdTimestamp.Value = text2; this.hdNonceStr.Value = text; this.hdSignature.Value = base.GetSignature(jsApiTicket, text, text2, absoluteUri); string icon = fightGroupActivitieInfo.Icon; this.hdImgUrl.Value = Globals.FullPath(string.IsNullOrEmpty(icon) ? masterSettings.DefaultProductThumbnail8 : icon); this.hdTitle.Value = fightGroupActivitieInfo.ShareTitle; HtmlInputHidden htmlInputHidden = this.hdDesc; HtmlInputHidden htmlInputHidden2 = this.hdLink; string text5 = htmlInputHidden.Value = (htmlInputHidden2.Value = Globals.FullPath($"/vshop/FightGroupDetails.aspx?fightGroupId={fightGroup.FightGroupId}")); } }
private void toFightGroupSuccess() { int num = 1; int num2 = 0; SiteSettings masterSettings = SettingsManager.GetMasterSettings(); FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.Order.FightGroupId); if (fightGroup != null) { IList <FightGroupUserModel> fightGroupUsers = VShopHelper.GetFightGroupUsers(this.Order.FightGroupId); num = (this.Order.IsFightGroupHead ? 1 : ((fightGroupUsers == null || fightGroupUsers.Count >= fightGroup.JoinNumber) ? 3 : 2)); if (num != 3) { num2 = fightGroup.JoinNumber - fightGroupUsers.Count; } FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); if (fightGroupActivitieInfo != null) { ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(fightGroupActivitieInfo.ProductId); if (productSimpleInfo != null) { string arg = (masterSettings.SiteUrl.ToNullString().ToLower().StartsWith("http://") ? masterSettings.SiteUrl : ("http://" + masterSettings.SiteUrl)).TrimEnd('/'); string str = "{Result\":{"; str += string.Format("\"ShareImage\":\"{0}\",", fightGroupActivitieInfo.Icon.Contains("http://") ? fightGroupActivitieInfo.Icon : $"{arg}/{fightGroupActivitieInfo.Icon}"); str += $"\"ShareTitle\":\"{(string.IsNullOrEmpty(fightGroupActivitieInfo.ShareTitle) ? productSimpleInfo.Title : fightGroupActivitieInfo.ShareTitle)}\","; str += $"\"ShareContent\":\"{(string.IsNullOrEmpty(fightGroupActivitieInfo.ShareContent) ? productSimpleInfo.ProductName : fightGroupActivitieInfo.ShareContent)}\","; str += $"\"ShareLink\":\"{$"{arg}/vshop/FightGroupDetails.aspx?fightGroupId={fightGroup.FightGroupId}"}\""; str += "}}"; base.Response.Write("<script type=\"text/javascript\" src=\"/Templates/appshop/script/jquery-1.11.0.min.js\"></script>"); base.Response.Write("<script type=\"text/javascript\" src=\"/Utility/globals.js\"></script>"); base.Response.Write("<script type=\"text/javascript\" src=\"/Templates/appshop/script/main.js\"></script>"); base.Response.Write("<script type=\"text/javascript\">$(function () {goFightGroupSuccess(" + num + "," + num2 + "," + str + ");});</script>"); base.Response.End(); } } } }
protected override void AttachChildControls() { this.orderId = base.GetParameter("orderId", false); this.litFightGroupStatusLabel = (FightGroupStatusLabel)this.FindControl("litFightGroupStatusLabel"); this.litOrderId = (Literal)this.FindControl("litOrderId"); this.lbltotalPrice = (FormatedMoneyLabel)this.FindControl("lbltotalPrice"); this.litAddDate = (FormatedTimeLabel)this.FindControl("litAddDate"); this.lblOrderStatus = (OrderStatusLabel)this.FindControl("lblOrderStatus"); this.litCloseReason = (Literal)this.FindControl("litCloseReason"); this.litRemark = (Literal)this.FindControl("litRemark"); this.litShipTo = (Literal)this.FindControl("litShipTo"); this.litRegion = (Literal)this.FindControl("litRegion"); this.litAddress = (Literal)this.FindControl("litAddress"); this.litZipcode = (Literal)this.FindControl("litZipcode"); this.litEmail = (Literal)this.FindControl("litEmail"); this.litPhone = (Literal)this.FindControl("litPhone"); this.litTellPhone = (Literal)this.FindControl("litTellPhone"); this.litShipToDate = (Literal)this.FindControl("litShipToDate"); this.litPaymentType = (Literal)this.FindControl("litPaymentType"); this.litModeName = (Literal)this.FindControl("litModeName"); this.plOrderSended = (Panel)this.FindControl("plOrderSended"); this.litRealModeName = (Literal)this.FindControl("litRealModeName"); this.litShippNumber = (Literal)this.FindControl("litShippNumber"); this.litDiscountName = (HyperLink)this.FindControl("litDiscountName"); this.lblAdjustedDiscount = (FormatedMoneyLabel)this.FindControl("lblAdjustedDiscount"); this.litFreeName = (HyperLink)this.FindControl("litFreeName"); this.plExpress = (Panel)this.FindControl("plExpress"); this.power = (HtmlAnchor)this.FindControl("power"); this.litTakeCode = (Literal)this.FindControl("litTakeCode"); this.litStoreInfo = (Literal)this.FindControl("litStoreInfo"); this.litStoreName = (Literal)this.FindControl("litStoreName"); this.litStoreTel = (Literal)this.FindControl("litStoreTel"); this.divstoreinfo = (HtmlGenericControl)this.FindControl("divstoreinfo"); this.divInvoiceTitle = (HtmlGenericControl)this.FindControl("divInvoiceTitle"); this.divInvoiceTaxpayerNumber = (HtmlGenericControl)this.FindControl("divInvoiceTaxpayerNumber"); this.divTax = (HtmlGenericControl)this.FindControl("divTax"); this.listOrders = (Common_OrderManage_OrderItems)this.FindControl("Common_OrderManage_OrderItems"); this.orderGifts = (Common_OrderManage_OrderGifts)this.FindControl("Common_OrderManage_OrderGifts"); this.plOrderGift = (Panel)this.FindControl("plOrderGift"); this.lblBundlingPrice = (Literal)this.FindControl("lblBundlingPrice"); this.litPoints = (Literal)this.FindControl("litPoints"); this.litSentTimesPointPromotion = (HyperLink)this.FindControl("litSentTimesPointPromotion"); this.litWeight = (Literal)this.FindControl("litWeight"); this.litFree = (Literal)this.FindControl("litFree"); this.lblFreight = (FormatedMoneyLabel)this.FindControl("lblFreight"); this.litCouponValue = (Literal)this.FindControl("litCouponValue"); this.litPointMoney = (Literal)this.FindControl("litPointMoney"); this.lblDiscount = (FormatedMoneyLabel)this.FindControl("lblDiscount"); this.litTotalPrice = (FormatedMoneyLabel)this.FindControl("litTotalPrice"); this.lblRefundTotal = (FormatedMoneyLabel)this.FindControl("lblRefundTotal"); this.litAddOrderDate = (FormatedTimeLabel)this.FindControl("litAddOrderDate"); this.litPayDate = (FormatedTimeLabel)this.FindControl("litPayDate"); this.litPayBack = (FormatedTimeLabel)this.FindControl("litPayBack"); this.litBackShip = (FormatedTimeLabel)this.FindControl("litBackShip"); this.litShipDate = (FormatedTimeLabel)this.FindControl("litShipDate"); this.litResultDate = (FormatedTimeLabel)this.FindControl("litResultDate"); this.lkbtnConfirmOrder = (LinkButton)this.FindControl("lkbtnConfirmOrder"); this.lkbtnCloseOrder = (LinkButton)this.FindControl("lkbtnCloseOrder"); this.hidExpressCompanyName = (HiddenField)this.FindControl("hidExpressCompanyName"); this.hidShipOrderNumber = (HiddenField)this.FindControl("hidShipOrderNumber"); this.hidHiPOSTakeCode = (HiddenField)this.FindControl("hidHiPOSTakeCode"); this.btnPay = (Button)this.FindControl("btnPay"); this.lbRefundMoney = (Label)this.FindControl("lbRefundMoney"); this.lbRefundMoney = (Label)this.FindControl("lbRefundMoney"); this.lbCloseReason = (Label)this.FindControl("lbCloseReason"); this.txtRemark = (TextBox)this.FindControl("txtRemark"); this.txtReturnRemark = (TextBox)this.FindControl("txtReturnRemark"); this.txtReplaceRemark = (TextBox)this.FindControl("txtReplaceRemark"); this.dropRefundType = (RefundTypeDropDownList)this.FindControl("dropRefundType"); this.dropReturnRefundType = (RefundTypeDropDownList)this.FindControl("dropReturnRefundType"); this.dropPayType = (DropDownList)this.FindControl("dropPayType"); this.plRefund = (Panel)this.FindControl("plRefund"); this.lblTotalBalance = (FormatedMoneyLabel)this.FindControl("lblTotalBalance"); this.litRefundOrderRemark = (Literal)this.FindControl("litRefundOrderRemark"); this.litInvoiceTitle = (Literal)this.FindControl("litInvoiceTitle"); this.litInvoiceTaxpayerNumber = (Literal)this.FindControl("litInvoiceTaxpayerNumber"); this.litTax = (FormatedMoneyLabel)this.FindControl("litTax"); this.hdorderId = (HtmlInputHidden)this.FindControl("hdorderId"); this.lkbtnApplyForRefund = (HtmlAnchor)this.FindControl("lkbtnApplyForRefund"); this.lkbtnUserRealNameVerify = (HtmlAnchor)this.FindControl("lkbtnUserRealNameVerify"); this.hidPreSaleId = (HiddenField)this.FindControl("hidPreSaleId"); this.hidIsPayDeposit = (HiddenField)this.FindControl("hidIsPayDeposit"); this.hidIsPaymentStore = (HiddenField)this.FindControl("hidIsPaymentStore"); this.litDepositPayDate = (FormatedTimeLabel)this.FindControl("litDepositPayDate"); this.litFinalPamentPayDate = (Literal)this.FindControl("litFinalPamentPayDate"); this.lblDeposit = (FormatedMoneyLabel)this.FindControl("lblDeposit"); this.lblFinalPayment = (FormatedMoneyLabel)this.FindControl("lblFinalPayment"); this.litGetGoodsRemark = (Literal)this.FindControl("litGetGoodsRemark"); this.divPickUpRemark = (HtmlGenericControl)this.FindControl("divPickUpRemark"); this.litBalanceAmount = (Literal)this.FindControl("litBalanceAmount"); this.hidExpressStatus = (HtmlInputHidden)this.FindControl("hidExpressStatus"); this.litInvoiceType = (Literal)this.FindControl("litInvoiceType"); this.litRegisterAddress = (Literal)this.FindControl("litRegisterAddress"); this.litRegisterTel = (Literal)this.FindControl("litRegisterTel"); this.litOpenBank = (Literal)this.FindControl("litOpenBank"); this.litBankName = (Literal)this.FindControl("litBankName"); this.litReceiveName = (Literal)this.FindControl("litReceiveName"); this.litReceiveMobbile = (Literal)this.FindControl("litReceiveMobbile"); this.litReceiveEmail = (Literal)this.FindControl("litReceiveEmail"); this.litReceiveRegionName = (Literal)this.FindControl("litReceiveRegionName"); this.litReceiveAddress = (Literal)this.FindControl("litReceiveAddress"); this.listOrders.ItemDataBound += this.orderItems_ItemDataBound; PageTitle.AddTitle("订单详细页", HiContext.Current.Context); this.order = TradeHelper.GetOrderInfo(this.orderId); this.divInvoiceTitle.Visible = (this.order.Tax > decimal.Zero && !string.IsNullOrEmpty(this.order.InvoiceTitle)); this.divInvoiceTaxpayerNumber.Visible = (this.order.Tax > decimal.Zero && !string.IsNullOrEmpty(this.order.InvoiceTaxpayerNumber)); this.divTax.Visible = (this.order.Tax > decimal.Zero); this.btnPay.Click += this.btnPay_Click; this.lkbtnConfirmOrder.Click += this.lkbtnConfirmOrder_Click; this.lkbtnCloseOrder.Click += this.lkbtnCloseOrder_Click; if (!this.Page.IsPostBack) { if (!string.IsNullOrEmpty(this.order.TakeCode)) { this.hidHiPOSTakeCode.Value = Globals.HIPOSTAKECODEPREFIX + this.order.TakeCode; } if (this.order == null || this.order.UserId != HiContext.Current.UserId) { this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该订单不存在或者不属于当前用户的订单")); } else { this.BindOrderBase(this.order); this.BindOrderAddress(this.order); this.BindOrderItems(this.order); this.BindStoreInfo(this.order); if (!string.IsNullOrEmpty(this.order.InvoiceTitle)) { UserInvoiceDataInfo userInvoiceDataInfo = this.order.InvoiceInfo; if (userInvoiceDataInfo == null) { userInvoiceDataInfo = new UserInvoiceDataInfo { InvoiceType = this.order.InvoiceType, InvoiceTaxpayerNumber = this.order.InvoiceTaxpayerNumber.ToNullString(), InvoiceTitle = this.order.InvoiceTitle.ToNullString() }; } this.litInvoiceTaxpayerNumber.SetWhenIsNotNull(this.order.InvoiceTaxpayerNumber); this.litInvoiceTitle.SetWhenIsNotNull(this.order.InvoiceTitle); this.litInvoiceType.SetWhenIsNotNull(EnumDescription.GetEnumDescription((Enum)(object)this.order.InvoiceType, 0)); this.litRegisterAddress.SetWhenIsNotNull(userInvoiceDataInfo.RegisterAddress.ToNullString()); this.litRegisterTel.SetWhenIsNotNull(userInvoiceDataInfo.RegisterTel.ToNullString()); this.litOpenBank.SetWhenIsNotNull(userInvoiceDataInfo.OpenBank.ToNullString()); this.litBankName.SetWhenIsNotNull(userInvoiceDataInfo.BankAccount.ToNullString()); this.litReceiveName.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveName.ToNullString()); if (this.order.InvoiceType != InvoiceType.Enterprise) { this.litReceiveMobbile.SetWhenIsNotNull(userInvoiceDataInfo.ReceivePhone.ToNullString()); if (this.order.InvoiceType != InvoiceType.VATInvoice) { this.litReceiveEmail.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveEmail.ToNullString()); } } this.litReceiveRegionName.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveRegionName.ToNullString()); this.litReceiveAddress.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveAddress.ToNullString()); } if (this.order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.order.FightGroupId); this.lkbtnApplyForRefund.Visible = (fightGroup.Status != 0 && this.order.OrderStatus == OrderStatus.BuyerAlreadyPaid && this.order.GetPayTotal() > decimal.Zero); this.litFightGroupStatusLabel.Order = this.order; } } } }
protected override void AttachChildControls() { this.hidErrorMsg = (HtmlInputHidden)this.FindControl("hidErrorMsg"); this.txtOrderId = (HtmlInputHidden)this.FindControl("txtOrderId"); this.litOrderIds = (Literal)this.FindControl("litOrderIds"); this.txtSkuId = (HtmlInputHidden)this.FindControl("txtSkuId"); this.txtRemark = (TextBox)this.FindControl("txtRemark"); this.litRefundMoney = (Literal)this.FindControl("litRefundMoney"); this.dropRefundType = (WapRefundTypeDropDownList)this.FindControl("dropRefundType"); this.DropRefundReason = (WapAfterSalesReasonDropDownList)this.FindControl("RefundReasonDropDownList"); this.btnRefund = ButtonManager.Create(this.FindControl("btnRefund")); this.groupbuyPanel = (HtmlGenericControl)this.FindControl("groupbuyPanel"); this.txtOrderId.Value = this.OrderId; this.litOrderIds.Text = this.OrderId; this.txtSkuId.Value = this.SkuId; this.order = TradeHelper.GetOrderInfo(this.OrderId); if (this.order == null) { this.ShowError("错误的订单信息!"); } else { if (this.order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.order.FightGroupId); if (fightGroup.Status != FightGroupStatus.FightGroupSuccess) { this.ShowError("火拼团订单成团之前不能进行退款操作!"); return; } } if (TradeHelper.IsOnlyOneSku(this.order)) { this.SkuId = ""; } if (!string.IsNullOrEmpty(this.SkuId) && !this.order.LineItems.ContainsKey(this.SkuId)) { this.ShowError("错误的商品信息!"); } else if (!TradeHelper.CanRefund(this.order, this.SkuId)) { this.ShowError("订单状态不正确或者已有未处理完成的退款/退货申请!"); } else { if (this.order.LineItems.ContainsKey(this.SkuId)) { this.RefundItem = this.order.LineItems[this.SkuId]; } GroupBuyInfo groupBuyInfo = null; if (this.order.GroupBuyId > 0) { groupBuyInfo = ProductBrowser.GetGroupBuy(this.order.GroupBuyId); if (groupBuyInfo != null) { if (this.groupbuyPanel != null && groupBuyInfo.Status != GroupBuyStatus.Failed) { this.groupbuyPanel.Visible = true; } if (groupBuyInfo.NeedPrice > this.order.GetTotal(false) && groupBuyInfo.Status != GroupBuyStatus.Failed) { this.ShowError("团购违约金大于订单总金额,不能进行退款申请!"); return; } } } decimal canRefundAmount = this.order.GetCanRefundAmount(this.SkuId, groupBuyInfo, 0); if (canRefundAmount < decimal.Zero) { this.ShowError("订单中已申请的退款金额超过了订单总额!"); } else { this.litRefundMoney.Text = canRefundAmount.F2ToString("f2"); PageTitle.AddSiteNameTitle("申请退款"); if (!this.Page.IsPostBack) { this.DropRefundReason.IsRefund = true; this.dropRefundType.preSaleId = this.order.PreSaleId; string enumDescription = EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.AdvancePay, 1); this.dropRefundType.BalanceAmount = this.order.BalanceAmount; this.dropRefundType.OrderGateWay = ((this.order.PreSaleId > 0 && this.order.DepositGatewayOrderId.ToNullString().ToLower() == enumDescription) ? enumDescription : this.order.Gateway); } } } } }
protected override void AttachChildControls() { this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.fightGroupRule = (Common_FightGroupRule)this.FindControl("fightGroupRule"); this.fightGroupId = this.Page.Request["fightGroupId"].ToInt(0); this.litDescription = (Literal)this.FindControl("litDescription"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.imgThumbnailUrl100 = (Image)this.FindControl("imgThumbnailUrl100"); this.litSalePrice = (Literal)this.FindControl("litSalePrice"); this.litNeedPerson = (Literal)this.FindControl("litNeedPerson"); this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount"); this.litProductName = (Literal)this.FindControl("litProductName"); this.rptFightGroups = (WapTemplatedRepeater)this.FindControl("rptFightGroups"); this.hfEndTime = (HtmlInputHidden)this.FindControl("hfEndTime"); this.hfNowTime = (HtmlInputHidden)this.FindControl("hfNowTime"); this.hfStartTime = (HtmlInputHidden)this.FindControl("hfStartTime"); this.hdTitle = (HtmlInputHidden)this.FindControl("hdTitle"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTimestamp = (HtmlInputHidden)this.FindControl("hdTimestamp"); this.hdNonceStr = (HtmlInputHidden)this.FindControl("hdNonceStr"); this.hdSignature = (HtmlInputHidden)this.FindControl("hdSignature"); this.hdTitle = (HtmlInputHidden)this.FindControl("hdTitle"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdImgUrl = (HtmlInputHidden)this.FindControl("hdImgUrl"); this.hdLink = (HtmlInputHidden)this.FindControl("hdLink"); FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.fightGroupId); if (fightGroup != null) { if (fightGroup.EndTime <= DateTime.Now && fightGroup.Status == FightGroupStatus.FightGroupIn) { VShopHelper.DealFightGroupFail(this.fightGroupId); fightGroup.Status = FightGroupStatus.FightGroupFail; } this.fightGroupRule.FightGroupActivityId = fightGroup.FightGroupActivityId; SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (fightGroup.Status != 0) { this.Page.Response.Redirect("MemberGroupDetailsStatus.aspx?fightGroupId=" + fightGroup.FightGroupId); } HtmlInputHidden htmlInputHidden = this.hfStartTime; DateTime dateTime = fightGroup.StartTime; htmlInputHidden.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); HtmlInputHidden htmlInputHidden2 = this.hfEndTime; dateTime = fightGroup.EndTime; htmlInputHidden2.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); HtmlInputHidden htmlInputHidden3 = this.hfNowTime; dateTime = DateTime.Now; htmlInputHidden3.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); int fightGroupActiveNumber = VShopHelper.GetFightGroupActiveNumber(fightGroup.FightGroupId); int num = fightGroup.JoinNumber - fightGroupActiveNumber; num = ((num >= 0) ? num : 0); this.litNeedPerson.Text = num.ToString(); this.litProductName.Text = fightGroup.ProductName; Literal literal = this.litProductReviewCount; int num2 = ProductBrowser.GetProductReviews(new ProductReviewQuery { PageIndex = 1, PageSize = 2147483647, ProductId = fightGroup.ProductId }).TotalRecords; literal.Text = num2.ToString(); this.litSalePrice.Text = VShopHelper.GetFightGroupSkus(fightGroup.FightGroupActivityId).Min((FightGroupSkuInfo c) => c.SalePrice).F2ToString("f2"); IList <FightGroupUserModel> fightGroupUsers = VShopHelper.GetFightGroupUsers(fightGroup.FightGroupId); foreach (FightGroupUserModel item in fightGroupUsers) { item.Name = DataHelper.GetHiddenUsername(item.Name); } this.rptFightGroups.DataSource = fightGroupUsers; this.rptFightGroups.DataBind(); IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroup.ProductId, out dictionary, out list); this.SetWXShare(fightGroup, productDetails); this.imgThumbnailUrl100.ImageUrl = productDetails.ImageUrl1; Literal control = this.litConsultationsCount; num2 = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, true); control.SetWhenIsNotNull(num2.ToString()); if (this.litDescription != null) { Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { this.litDescription.Text = regex.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { this.litDescription.Text = regex.Replace(productDetails.Description, ""); } } DataTable data = ProductBrowser.GetProductConsultations(new ProductConsultationAndReplyQuery { ProductId = productDetails.ProductId, PageIndex = 1, PageSize = 2147483647, SortOrder = SortAction.Desc, SortBy = "ConsultationId" }).Data; for (int i = 0; i < data.Rows.Count; i++) { data.Rows[i]["UserName"] = DataHelper.GetHiddenUsername(data.Rows[i]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = data; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = data.IsNullOrEmpty(); } else { base.GotoResourceNotFound("活动不存在"); } }
protected override void AttachChildControls() { this.hidErrorMsg = (HtmlInputHidden)this.FindControl("hidErrorMsg"); this.txtOrderId = (HtmlInputHidden)this.FindControl("txtOrderId"); this.litOrderIds = (Literal)this.FindControl("litOrderIds"); this.txtSkuId = (HtmlInputHidden)this.FindControl("txtSkuId"); this.txtRemark = (TextBox)this.FindControl("txtRemark"); this.litRefundMoney = (Literal)this.FindControl("litRefundMoney"); this.dropRefundType = (WapRefundTypeDropDownList)this.FindControl("dropRefundType"); this.DropRefundReason = (WapAfterSalesReasonDropDownList)this.FindControl("RefundReasonDropDownList"); this.btnRefund = ButtonManager.Create(this.FindControl("btnRefund")); this.groupbuyPanel = (HtmlGenericControl)this.FindControl("groupbuyPanel"); this.hidOneRefundAmount = (HtmlInputHidden)this.FindControl("hidOneRefundAmount"); this.hidIsServiceOrder = (HtmlInputHidden)this.FindControl("hidIsServiceOrder"); this.hidValidCodes = (HtmlInputHidden)this.FindControl("hidValidCodes"); this.rptOrderPassword = (WapTemplatedRepeater)this.FindControl("rptOrderPassword"); decimal num = default(decimal); decimal d = default(decimal); this.txtOrderId.Value = this.OrderId; this.litOrderIds.Text = this.OrderId; this.txtSkuId.Value = this.SkuId; this.order = TradeHelper.GetOrderInfo(this.OrderId); if (this.order == null) { this.ShowError("错误的订单信息!"); } else { this.IsServiceOrder = (this.order.OrderType == OrderType.ServiceOrder); this.hidIsServiceOrder.Value = (this.IsServiceOrder ? "1" : "0"); this.hidOneRefundAmount.Value = "0"; if (this.order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.order.FightGroupId); if (fightGroup.Status != FightGroupStatus.FightGroupSuccess) { this.ShowError("火拼团订单成团之前不能进行退款操作!"); return; } } GroupBuyInfo groupBuyInfo = null; if (this.order.GroupBuyId > 0) { groupBuyInfo = ProductBrowser.GetGroupBuy(this.order.GroupBuyId); if (groupBuyInfo != null) { if (this.groupbuyPanel != null && groupBuyInfo.Status != GroupBuyStatus.Failed) { this.groupbuyPanel.Visible = true; } if (groupBuyInfo.NeedPrice >= this.order.GetTotal(false) && groupBuyInfo.Status != GroupBuyStatus.Failed) { this.ShowError("团购违约金大于等于订单总金额,不能进行退款申请!"); return; } } num = this.order.GetCanRefundAmount(this.SkuId, groupBuyInfo, 0); } else { num = this.order.GetCanRefundAmount(this.SkuId, null, 0); } if (!this.IsServiceOrder) { if (TradeHelper.IsOnlyOneSku(this.order)) { this.SkuId = ""; } if (!string.IsNullOrEmpty(this.SkuId) && !this.order.LineItems.ContainsKey(this.SkuId)) { this.ShowError("错误的商品信息!"); return; } if (!TradeHelper.CanRefund(this.order, this.SkuId)) { this.ShowError("订单状态不正确或者已有未处理完成的退款/退货申请!"); return; } if (this.order.LineItems.ContainsKey(this.SkuId)) { this.RefundItem = this.order.LineItems[this.SkuId]; } } else { if (this.order.OrderStatus == OrderStatus.WaitBuyerPay || this.order.OrderStatus == OrderStatus.Closed || this.order.OrderStatus == OrderStatus.ApplyForRefund || this.order.OrderStatus == OrderStatus.Refunded) { this.ShowError("订单状态不正确,不能申请退款!"); } bool flag = TradeHelper.GatewayIsCanBackReturn(this.order.Gateway); bool flag2 = this.order.Gateway.ToLower() == "hishop.plugins.payment.cashreceipts" && this.order.StoreId > 0 && this.order.ShippingModeId == -2; MemberInfo user = Users.GetUser(this.order.UserId); LineItemInfo lineItemInfo = this.order.LineItems.Values.FirstOrDefault(); if (!lineItemInfo.IsRefund) { this.ShowError("商品不支持退款!"); } if (!lineItemInfo.IsValid && lineItemInfo.ValidEndDate.HasValue && lineItemInfo.ValidEndDate.Value < DateTime.Now && !lineItemInfo.IsOverRefund) { this.ShowError("已过有效期,不能申请退款!"); } IList <OrderVerificationItemInfo> orderVerificationItems = TradeHelper.GetOrderVerificationItems(this.order.OrderId); if (orderVerificationItems == null || orderVerificationItems.Count == 0) { this.ShowError("核销码为空!"); } IList <OrderVerificationItemInfo> list = null; list = ((!lineItemInfo.ValidEndDate.HasValue || !(lineItemInfo.ValidEndDate.Value < DateTime.Now) || !lineItemInfo.IsOverRefund) ? (from vi in orderVerificationItems where vi.VerificationStatus == 0 select vi).ToList() : (from vi in orderVerificationItems where vi.VerificationStatus == 0 || vi.VerificationStatus == 3 select vi).ToList()); if (list == null || list.Count == 0) { this.ShowError("没有可以退款的核销码!"); } DataTable dataTable = new DataTable(); dataTable.Columns.Add(new DataColumn("Index")); dataTable.Columns.Add(new DataColumn("Password")); for (int j = 0; j < list.Count; j++) { DataRow dataRow = dataTable.NewRow(); dataRow["Index"] = j + 1; dataRow["Password"] = list[j].VerificationPassword; dataTable.Rows.Add(dataRow); } this.rptOrderPassword.DataSource = dataTable; this.rptOrderPassword.DataBind(); d = (this.order.GetTotal(false) / (decimal)lineItemInfo.Quantity).F2ToString("f2").ToDecimal(0); this.hidValidCodes.Value = string.Join(",", (from i in list select i.VerificationPassword).ToList()); this.hidOneRefundAmount.Value = d.ToString(); num = d * (decimal)list.Count; } if (num < decimal.Zero) { this.ShowError("订单中已申请的退款金额超过了订单总额!"); } else { this.litRefundMoney.Text = num.F2ToString("f2"); PageTitle.AddSiteNameTitle("我的订单"); if (!this.Page.IsPostBack) { this.dropRefundType.IsServiceOrder = (this.order.OrderType == OrderType.ServiceOrder); this.DropRefundReason.IsRefund = true; this.dropRefundType.preSaleId = this.order.PreSaleId; string enumDescription = EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.AdvancePay, 1); this.dropRefundType.OrderGateWay = ((this.order.PreSaleId > 0 && this.order.DepositGatewayOrderId.ToNullString().ToLower() == enumDescription) ? enumDescription : this.order.Gateway); this.dropRefundType.BalanceAmount = this.order.BalanceAmount; } } } }
private DataGridViewModel <Dictionary <string, object> > GetDataList(OrderQuery query) { DateTime now = DateTime.Now; DateTime now2 = DateTime.Now; PageModel <OrderModel> pageModel = null; DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >(); TimeSpan timeSpan; double totalMilliseconds; if (query != null) { now = DateTime.Now; pageModel = OrderHelper.GetOrderList(query); now2 = DateTime.Now; timeSpan = now2 - now; totalMilliseconds = timeSpan.TotalMilliseconds; Globals.AppendLog("数据库查询花费时间", totalMilliseconds.ToString(), "", "GetDataList"); now = DateTime.Now; string[] orderIds = (from d in pageModel.Models select d.OrderId).ToArray(); List <RefundInfo> refundInfos = TradeHelper.GetRefundInfos(orderIds); dataGridViewModel.rows = DataHelper.ListToDictionary(pageModel.rows); now2 = DateTime.Now; dataGridViewModel.total = pageModel.total; int num = 0; now = DateTime.Now; foreach (Dictionary <string, object> row in dataGridViewModel.rows) { OrderModel order = (from o in pageModel.rows where o.OrderId == row["OrderId"].ToNullString() select o).FirstOrDefault(); row.Add("OrderStatusText", OrderHelper.GetOrderStatusText(order.OrderStatus, order.ShippingModeId, order.IsConfirm, order.Gateway, 0, order.PreSaleId, order.DepositDate, false, order.ItemStatus, order.OrderType)); row.Add("canCheckTake", order.CanConfirmTakeCode()); row.Add("canCloseOrder", order.CanClose(base.CurrentSiteSetting.OpenMultStore, false)); row.Add("canOfflineReceipt", this.CanConfirmOfflineReceipt(order, false)); row.Add("CanEditPrice", this.CanEditPrice(order)); row.Add("canCancelSendGoods", order.OrderStatus == OrderStatus.SellerAlreadySent && (order.DadaStatus == DadaStatus.WaitOrder || order.DadaStatus == DadaStatus.WaitTake)); row.Add("dadaState", (order.DadaStatus != 0) ? ((Enum)(object)order.DadaStatus).ToDescription() : ""); row.Add("InvoiceTypeText", string.IsNullOrEmpty(order.InvoiceTitle) ? "" : EnumDescription.GetEnumDescription((Enum)(object)order.InvoiceType, 0)); bool flag = this.CanSendGoods(order, base.CurrentSiteSetting.OpenMultStore); if (base.CurrentSiteSetting.OpenMultStore && order.StoreId != 0) { flag = false; } row.Add("canFinishTrade", order.OrderStatus == OrderStatus.SellerAlreadySent && order.ItemStatus == OrderItemStatus.Nomarl); bool flag2 = false; if (base.CurrentSiteSetting.OpenMultStore && order.CountDownBuyId == 0 && order.BundlingId == 0 && order.GroupBuyId == 0 && order.FightGroupId == 0 && order.PreSaleId == 0 && order.ItemStatus == OrderItemStatus.Nomarl && (order.OrderStatus == OrderStatus.BuyerAlreadyPaid || (order.OrderStatus == OrderStatus.WaitBuyerPay && order.Gateway == "hishop.plugins.payment.podrequest"))) { if (order.StoreId == -1) { flag2 = (order.BuyQuantity > 0); } else if (order.StoreId > 0) { flag2 = !order.IsConfirm; } else if (order.StoreId == 0) { flag2 = (order.ShippingModeId != -2 && order.BuyQuantity > 0); } } row.Add("CanAllotStore", flag2); RefundInfo refundInfo = refundInfos.FirstOrDefault((RefundInfo d) => d.OrderId == order.OrderId); if (refundInfo != null) { row.Add("IsCheckRefund", order.OrderStatus == OrderStatus.ApplyForRefund && !order.IsStoreCollect); row.Add("RefundId", refundInfo.RefundId); } bool flag3 = false; string value = string.Empty; string value2 = string.Empty; if (order.ItemStatus != 0 || order.OrderStatus == OrderStatus.ApplyForRefund) { if (refundInfo != null && order.OrderStatus == OrderStatus.ApplyForRefund) { flag3 = true; value2 = "订单已申请退款"; value = "RefundApplyDetail?RefundId=" + refundInfo.RefundId; } else { if (order.ItemStatus == OrderItemStatus.HasReturnOrReplace) { value2 = "订单中有商品正在退货/换货中"; } else if (order.ReturnedCount > 0) { value2 = "订单中有商品已退货完成"; } else if (order.ItemStatus == OrderItemStatus.HasReplace) { value2 = "订单中有商品正在进行换货操作"; } else if (order.ItemStatus == OrderItemStatus.HasReturn) { value2 = "订单中有商品正在进行退货操作"; } if (order.AfterSaleCount > 0) { flag3 = true; value = ((order.ReturnId <= 0) ? ("ReplaceApplyDetail?ReplaceId=" + order.ReplaceId) : ("ReturnApplyDetail?ReturnId=" + order.ReturnId)); } } } row.Add("IsShowRefundIcon", flag3); row.Add("RefundOperUrl", value); row.Add("RefundTips", value2); bool flag4 = false; if (order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(order.FightGroupId); if (fightGroup != null) { row["FightGroupActivityId"] = fightGroup.FightGroupActivityId; if (fightGroup.Status == FightGroupStatus.FightGroupIn && order.OrderStatus != OrderStatus.WaitBuyerPay && order.OrderStatus != OrderStatus.Closed) { flag4 = true; } } } row.Add("FightGrouping", flag4); row.Add("canSendGoods", flag); if (order.BuyQuantity <= 0) { if (order.UserAwardRecordsId > 0) { row.Add("IsAwardOrder", true); } else { row.Add("IsGiftOrder", true); } } if (order.PreSaleId > 0 && order.OrderStatus == OrderStatus.BuyerAlreadyPaid) { ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(order.PreSaleId); if (productPreSaleInfo != null) { string value3 = ""; DateTime dateTime; if (productPreSaleInfo.DeliveryDate.HasValue) { dateTime = productPreSaleInfo.DeliveryDate.Value; value3 = "<span>预计发货时间:" + dateTime.ToString("yyyy-MM-dd") + "</span>"; } else { DateTime payDate = order.PayDate; if (order.PayDate != DateTime.MinValue) { dateTime = order.PayDate; dateTime = dateTime.AddDays((double)productPreSaleInfo.DeliveryDays); value3 = "<span>预计发货时间:" + dateTime.ToString("yyyy-MM-dd") + "</span>"; } } row.Add("SendGoodsTips", value3); } } row.Add("IsOpenCertification", HiContext.Current.SiteSettings.IsOpenCertification && order.IsincludeCrossBorderGoods); if (row["IDStatus"] != null) { row["IDStatus"] = order.IDStatus; } num++; } } now2 = DateTime.Now; timeSpan = now2 - now; totalMilliseconds = timeSpan.TotalMilliseconds; Globals.AppendLog("数据计算花费时间", totalMilliseconds.ToString(), "", "GetDataList2"); return(dataGridViewModel); }
private DataGridViewModel <Dictionary <string, object> > GetDataList(OrderQuery query) { DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >(); if (query != null) { DbQueryResult orders = OrderHelper.GetOrders(query); dataGridViewModel.rows = DataHelper.DataTableToDictionary(orders.Data); dataGridViewModel.total = orders.TotalRecords; string[] orderIds = (from d in dataGridViewModel.rows select d["OrderId"].ToString()).ToArray(); List <RefundInfo> refundInfos = TradeHelper.GetRefundInfos(orderIds); foreach (Dictionary <string, object> row in dataGridViewModel.rows) { OrderInfo order = TradeHelper.GetOrderInfo(row["OrderId"].ToString()); row.Add("OrderStatusText", OrderHelper.GetOrderStatusText(order.OrderStatus, order.ShippingModeId, order.IsConfirm, order.Gateway, 0, order.PreSaleId, order.DepositDate, false, order.ItemStatus, OrderType.NormalOrder)); row.Add("CanConfirmOrder", order.CanConfirmOrder()); row.Add("canCheckTake", order.CanConfirmTakeCode()); row.Add("canCloseOrder", this.CanClose(order, base.CurrentSiteSetting.OpenMultStore)); row.Add("canOfflineReceipt", OrderHelper.CanConfirmOfflineReceipt(order, false)); row.Add("CanEditPrice", this.CanEditPrice(order)); row.Add("InvoiceTypeText", string.IsNullOrEmpty(order.InvoiceTitle) ? "" : EnumDescription.GetEnumDescription((Enum)(object)order.InvoiceType, 0)); bool flag = order.CanSendGoods(base.CurrentSiteSetting.OpenMultStore); if (base.CurrentSiteSetting.OpenMultStore && order.StoreId != 0) { flag = false; } row.Add("canSendGoods", flag); row.Add("canFinishTrade", order.OrderStatus == OrderStatus.SellerAlreadySent && order.ItemStatus == OrderItemStatus.Nomarl); bool flag2 = false; if (base.CurrentSiteSetting.OpenMultStore && order.CountDownBuyId == 0 && order.BundlingId == 0 && order.ItemStatus == OrderItemStatus.Nomarl && (order.OrderStatus == OrderStatus.BuyerAlreadyPaid || (order.OrderStatus == OrderStatus.WaitBuyerPay && order.Gateway == "hishop.plugins.payment.podrequest"))) { if (order.StoreId == -1) { flag2 = (order.LineItems.Count > 0); } else if (order.StoreId > 0) { flag2 = !order.IsConfirm; } else if (order.StoreId == 0) { flag2 = (order.ShippingModeId != -2 && order.LineItems.Count > 0); } } row.Add("CanAllotStore", flag2); RefundInfo refundInfo = refundInfos.FirstOrDefault((RefundInfo d) => d.OrderId == order.OrderId); if (refundInfo != null) { row.Add("IsCheckRefund", order.OrderStatus == OrderStatus.ApplyForRefund && !order.IsStoreCollect); row.Add("RefundId", refundInfo.RefundId); } bool flag3 = false; string value = string.Empty; string value2 = string.Empty; if (order.ItemStatus != 0 || order.OrderStatus == OrderStatus.ApplyForRefund) { if (refundInfo != null && order.OrderStatus == OrderStatus.ApplyForRefund) { flag3 = true; value2 = "订单已申请退款"; value = "/Admin/sales/RefundApplyDetail?RefundId=" + refundInfo.RefundId; } else { int num = 0; AfterSaleTypes afterSaleTypes = AfterSaleTypes.ReturnAndRefund; int num2 = 0; foreach (LineItemInfo value4 in order.LineItems.Values) { if (value4.ReturnInfo != null || value4.ReplaceInfo != null) { ReturnInfo returnInfo = value4.ReturnInfo; ReplaceInfo replaceInfo = value4.ReplaceInfo; if (num == 0 || (returnInfo != null && returnInfo.HandleStatus != ReturnStatus.Refused && returnInfo.HandleStatus != ReturnStatus.Returned) || (replaceInfo != null && (replaceInfo.HandleStatus != ReplaceStatus.Refused || replaceInfo.HandleStatus != ReplaceStatus.Replaced))) { if (value4.ReturnInfo != null) { afterSaleTypes = AfterSaleTypes.ReturnAndRefund; num2 = value4.ReturnInfo.ReturnId; } else { afterSaleTypes = AfterSaleTypes.Replace; num2 = value4.ReplaceInfo.ReplaceId; } } num++; } } if (order.ItemStatus == OrderItemStatus.HasReturnOrReplace) { value2 = "订单中有商品正在退货/换货中"; } else if (order.ReturnedCount > 0) { value2 = "订单中有商品已退货完成"; } else if (order.ItemStatus == OrderItemStatus.HasReplace) { value2 = "订单中有商品正在进行换货操作"; } else if (order.ItemStatus == OrderItemStatus.HasReturn) { value2 = "订单中有商品正在进行退货操作"; } if (num > 0) { flag3 = true; value = ((afterSaleTypes != AfterSaleTypes.ReturnAndRefund) ? ("ReplaceApplyDetail?ReplaceId=" + num2) : ("ReturnApplyDetail?ReturnId=" + num2)); } } } row.Add("IsShowRefundIcon", flag3); row.Add("RefundOperUrl", value); row.Add("RefundTips", value2); bool flag4 = false; if (order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(order.FightGroupId); if (fightGroup != null) { row.Add("FightGroupActivityId", fightGroup.FightGroupActivityId); if (fightGroup.Status == FightGroupStatus.FightGroupIn && order.OrderStatus != OrderStatus.WaitBuyerPay && order.OrderStatus != OrderStatus.Closed) { flag4 = true; } } } row.Add("FightGrouping", flag4); if (order.StoreId > 0) { row.Add("StoreName", this.GetStoreName(order.StoreId)); } if (order.LineItems.Count <= 0) { if (order.UserAwardRecordsId > 0) { row.Add("IsAwardOrder", true); } else { row.Add("IsGiftOrder", true); } } if (order.PreSaleId > 0 && order.OrderStatus == OrderStatus.BuyerAlreadyPaid) { ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(order.PreSaleId); if (productPreSaleInfo != null) { string value3 = ""; DateTime dateTime; if (productPreSaleInfo.DeliveryDate.HasValue) { dateTime = productPreSaleInfo.DeliveryDate.Value; value3 = "<span>预计发货时间:" + dateTime.ToString("yyyy-MM-dd") + "</span>"; } else { DateTime payDate = order.PayDate; if (order.PayDate != DateTime.MinValue) { dateTime = order.PayDate; dateTime = dateTime.AddDays((double)productPreSaleInfo.DeliveryDays); value3 = "<span>预计发货时间:" + dateTime.ToString("yyyy-MM-dd") + "</span>"; } } row.Add("SendGoodsTips", value3); } } } } return(dataGridViewModel); }
private void dlstOrders_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); string a = ""; if (!(DataBinder.Eval(e.Item.DataItem, "Gateway") is DBNull)) { a = (string)DataBinder.Eval(e.Item.DataItem, "Gateway"); } string text = DataBinder.Eval(e.Item.DataItem, "OrderId").ToString(); OrderInfo orderInfo = TradeHelper.GetOrderInfo(text); OrderStatus orderStatus = (OrderStatus)DataBinder.Eval(e.Item.DataItem, "OrderStatus"); int num = DataBinder.Eval(e.Item.DataItem, "ShippingModeId").ToInt(0); ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnPayOrder"); Literal literal = (Literal)e.Item.FindControl("litCloseOrder"); HyperLink hyperLink = (HyperLink)e.Item.FindControl("lkbtnEditPrice"); int num2 = (int)((DataBinder.Eval(e.Item.DataItem, "GroupBuyId") is DBNull) ? ((object)0) : DataBinder.Eval(e.Item.DataItem, "GroupBuyId")); int num3 = (int)((DataBinder.Eval(e.Item.DataItem, "CountDownBuyId") is DBNull) ? ((object)0) : DataBinder.Eval(e.Item.DataItem, "CountDownBuyId")); int num4 = (int)((DataBinder.Eval(e.Item.DataItem, "BundlingId") is DBNull) ? ((object)0) : DataBinder.Eval(e.Item.DataItem, "BundlingId")); int num5 = DataBinder.Eval(e.Item.DataItem, "ShippingModeId").ToInt(0); ImageLinkButton imageLinkButton2 = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmOrder"); Literal literal2 = (Literal)e.Item.FindControl("litDivideStore"); Literal literal3 = (Literal)e.Item.FindControl("isGiftOrder"); LinkButton linkButton = (LinkButton)e.Item.FindControl("lbtnFightGroup"); Image image = (Image)e.Item.FindControl("imgError"); HtmlAnchor htmlAnchor = (HtmlAnchor)e.Item.FindControl("lkbtnCheckRefund"); HtmlInputHidden htmlInputHidden = (HtmlInputHidden)e.Item.FindControl("hidFightGroup"); HtmlAnchor htmlAnchor2 = (HtmlAnchor)e.Item.FindControl("aftersaleImg"); image.Visible = orderInfo.IsError; if (orderInfo.IsError) { image.Attributes.Add("title", orderInfo.ErrorMessage); image.ImageUrl = "\\Admin\\images\\orderError.png"; } ProductPreSaleInfo productPreSaleInfo = null; if (orderInfo.PreSaleId > 0) { Literal literal4 = (Literal)e.Item.FindControl("litPreSale"); Literal literal5 = (Literal)e.Item.FindControl("litSendGoods"); FormatedMoneyLabel formatedMoneyLabel = (FormatedMoneyLabel)e.Item.FindControl("lblOrderTotals"); e.Item.FindControl("lblAmount").Visible = true; productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(orderInfo.PreSaleId); literal4.Text = "<font>定金:" + orderInfo.Deposit.F2ToString("f2") + "</font>"; Literal literal6 = literal4; literal6.Text = literal6.Text + "<font>尾款:" + orderInfo.FinalPayment.F2ToString("f2") + "</font>"; literal4.Visible = true; formatedMoneyLabel.Money = orderInfo.Deposit + orderInfo.FinalPayment; formatedMoneyLabel.Text = (orderInfo.Deposit + orderInfo.FinalPayment).ToString(); if (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid) { literal5.Visible = true; DateTime dateTime; if (productPreSaleInfo.DeliveryDate.HasValue) { Literal literal7 = literal5; dateTime = productPreSaleInfo.DeliveryDate.Value; literal7.Text = "<span>预计发货时间:" + dateTime.ToString("yyyy-MM-dd") + "</span>"; } else { DateTime payDate = orderInfo.PayDate; if (orderInfo.PayDate != DateTime.MinValue) { Literal literal8 = literal5; dateTime = orderInfo.PayDate; dateTime = dateTime.AddDays((double)productPreSaleInfo.DeliveryDays); literal8.Text = "<span>预计发货时间:" + dateTime.ToString("yyyy-MM-dd") + "</span>"; } } } } RefundInfo refundInfo = TradeHelper.GetRefundInfo(orderInfo.OrderId); if (orderInfo.ItemStatus != 0 || orderInfo.OrderStatus == OrderStatus.ApplyForRefund) { if (orderInfo.OrderStatus == OrderStatus.ApplyForRefund) { if (refundInfo != null) { htmlAnchor2.Visible = true; htmlAnchor2.Title = "订单已申请退款"; htmlAnchor2.HRef = "/Admin/sales/RefundApplyDetail?RefundId=" + refundInfo.RefundId; } } else { int num6 = 0; AfterSaleTypes afterSaleTypes = AfterSaleTypes.ReturnAndRefund; int num7 = 0; foreach (LineItemInfo value in orderInfo.LineItems.Values) { if (value.ReturnInfo != null || value.ReplaceInfo != null) { ReturnInfo returnInfo = value.ReturnInfo; ReplaceInfo replaceInfo = value.ReplaceInfo; if (num6 == 0 || (returnInfo != null && returnInfo.HandleStatus != ReturnStatus.Refused && returnInfo.HandleStatus != ReturnStatus.Returned) || (replaceInfo != null && (replaceInfo.HandleStatus != ReplaceStatus.Refused || replaceInfo.HandleStatus != ReplaceStatus.Replaced))) { if (value.ReturnInfo != null) { afterSaleTypes = AfterSaleTypes.ReturnAndRefund; num7 = value.ReturnInfo.ReturnId; } else { afterSaleTypes = AfterSaleTypes.Replace; num7 = value.ReplaceInfo.ReplaceId; } } num6++; } } if (orderInfo.ItemStatus == OrderItemStatus.HasReturnOrReplace) { htmlAnchor2.Title = "订单中有商品正在退货/换货中"; } else if (orderInfo.ReturnedCount > 0) { htmlAnchor2.Title = "订单中有商品已退货完成"; } else if (orderInfo.ItemStatus == OrderItemStatus.HasReplace) { htmlAnchor2.Title = "订单中有商品正在进行换货操作"; } else if (orderInfo.ItemStatus == OrderItemStatus.HasReturn) { htmlAnchor2.Title = "订单中有商品正在进行退货操作"; } if (num6 > 0) { htmlAnchor2.Visible = true; if (afterSaleTypes == AfterSaleTypes.ReturnAndRefund) { htmlAnchor2.HRef = "ReturnApplyDetail?ReturnId=" + num7; } else { htmlAnchor2.HRef = "ReplaceApplyDetail?ReplaceId=" + num7; } } } } if (orderInfo.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(orderInfo.FightGroupId); if (fightGroup != null) { linkButton.PostBackUrl = "/Admin/promotion/FightGroupDetails.aspx?fightGroupActivityId=" + fightGroup.FightGroupActivityId; if (fightGroup.Status == FightGroupStatus.FightGroupIn && orderInfo.OrderStatus != OrderStatus.WaitBuyerPay && orderInfo.OrderStatus != OrderStatus.Closed) { htmlInputHidden.Value = "1"; } else { htmlInputHidden.Value = "0"; } } } else { linkButton.Visible = false; } OrderStatusLabel orderStatusLabel = (OrderStatusLabel)e.Item.FindControl("lblOrderStatus"); if (orderStatusLabel != null) { orderStatusLabel.OrderItemStatus = orderInfo.ItemStatus; if (orderInfo.PreSaleId > 0) { orderStatusLabel.PreSaleId = orderInfo.PreSaleId; orderStatusLabel.DepositDate = orderInfo.DepositDate; } } HtmlAnchor htmlAnchor3 = (HtmlAnchor)e.Item.FindControl("lkbtnToDetail"); int num8 = (int)((DataBinder.Eval(e.Item.DataItem, "StoreId") == DBNull.Value) ? ((object)0) : DataBinder.Eval(e.Item.DataItem, "StoreId")); bool flag = (bool)((DataBinder.Eval(e.Item.DataItem, "IsStoreCollect") == DBNull.Value) ? ((object)false) : DataBinder.Eval(e.Item.DataItem, "IsStoreCollect")); bool flag2 = false; if (refundInfo != null) { htmlAnchor.HRef = "/Admin/sales/RefundApplyDetail?RefundId=" + refundInfo.RefundId.ToString(); flag2 = true; } if (orderInfo.LineItems.Count <= 0) { literal3.Text = "(礼)"; } Literal literal9 = (Literal)e.Item.FindControl("group"); if (literal9 != null) { if (num2 > 0) { literal9.Text = "(团)"; } if (num3 > 0) { literal9.Text = "(抢)"; } if (orderInfo.PreSaleId > 0) { literal9.Text = "(预)"; } } if (orderStatus == OrderStatus.WaitBuyerPay) { if (orderInfo.PreSaleId > 0) { if (!orderInfo.DepositDate.HasValue) { hyperLink.NavigateUrl = "javascript:DialogFrame('/Admin/sales/EditOrder.aspx?OrderId=" + text + "','修改订单价格',null,null,function(e){location.reload();})"; hyperLink.Visible = true; literal.Visible = true; if (a != "hishop.plugins.payment.podrequest" && num != -2 && orderInfo.FightGroupId == 0) { imageLinkButton.Visible = true; } } else if (productPreSaleInfo.PaymentStartDate <= DateTime.Now && productPreSaleInfo.PaymentEndDate >= DateTime.Now && a != "hishop.plugins.payment.podrequest" && num != -2 && orderInfo.FightGroupId == 0) { imageLinkButton.Visible = true; } } else { hyperLink.NavigateUrl = "javascript:DialogFrame('/Admin/sales/EditOrder.aspx?OrderId=" + text + "','修改订单价格',null,null,function(e){location.reload();})"; hyperLink.Visible = true; if (a != "hishop.plugins.payment.podrequest" && num != -2 && orderInfo.FightGroupId == 0 && (orderInfo.ParentOrderId == "0" || orderInfo.ParentOrderId == "-1")) { imageLinkButton.Visible = true; } } } if (a == "hishop.plugins.payment.podrequest") { int num9; switch (orderStatus) { case OrderStatus.SellerAlreadySent: num9 = ((orderInfo.ParentOrderId == "0" || orderInfo.ParentOrderId == "-1") ? 1 : 0); break; default: num9 = 0; break; case OrderStatus.WaitBuyerPay: num9 = 1; break; } if (num9 != 0) { literal.Visible = true; } } if (orderStatus == OrderStatus.SellerAlreadySent && orderInfo.StoreId > 0 && masterSettings.OpenMultStore) { literal.Visible = false; } if (orderStatus == OrderStatus.ApplyForRefund && !orderInfo.IsStoreCollect) { htmlAnchor.Visible = true; } imageLinkButton2.Visible = (orderStatus == OrderStatus.SellerAlreadySent && orderInfo.ItemStatus == OrderItemStatus.Nomarl); if (masterSettings.OpenMultStore && num == -2 && orderStatus == OrderStatus.WaitBuyerPay) { literal.Visible = !orderInfo.IsConfirm; hyperLink.Visible = true; if (a != "hishop.plugins.payment.podrequest" && orderInfo.PaymentTypeId != -3 && orderInfo.FightGroupId == 0) { imageLinkButton.Visible = true; } } } }
protected override void AttachChildControls() { this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.fightGroupRule = (Common_FightGroupRule)this.FindControl("fightGroupRule"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); int fightGroupId = this.Page.Request["fightGroupId"].ToInt(0); this.litDescription = (Literal)this.FindControl("litDescription"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.hfStartTime = (HtmlInputHidden)this.FindControl("hfStartTime"); this.hiddenJoinedUser = (HtmlInputText)this.FindControl("hiddenJoinedUser"); this.hfEndTime = (HtmlInputHidden)this.FindControl("hfEndTime"); this.hfNowTime = (HtmlInputHidden)this.FindControl("hfNowTime"); this.rptFightGroupDetails = (WapTemplatedRepeater)this.FindControl("rptFightGroupDetails"); this.rptFightGroupDetailsNeed = (WapTemplatedRepeater)this.FindControl("rptFightGroupDetailsNeed"); this.litNeedPerson = (Literal)this.FindControl("litNeedPerson"); this.divIn = (HtmlControl)this.FindControl("divIn"); this.divOver = (HtmlControl)this.FindControl("divOver"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount"); this.litJoinNumber = (Literal)this.FindControl("litJoinNumber"); this.litLimitedHour = (Literal)this.FindControl("litLimitedHour"); this.litProductName = (Literal)this.FindControl("litProductName"); this.litFGAPrice = (Literal)this.FindControl("litFGAPrice"); this.litPPrice = (Literal)this.FindControl("litPPrice"); this.imgStatus = (Image)this.FindControl("imgStatus"); this.litRemainTimeHtml = (HtmlGenericControl)this.FindControl("litRemainTimeHtml"); this.spanTime = (HtmlGenericControl)this.FindControl("spanTime"); this.hiddenProductId = (HtmlInputText)this.FindControl("hiddenProductId"); this.hlProductReview = (HyperLink)this.FindControl("hlProductReview"); this.hidFightGroupActivityStatus = (HtmlInputHidden)this.FindControl("hidFightGroupActivityStatus"); this.divGetBySelf = (HtmlControl)this.FindControl("divGetBySelf"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTitle = (HtmlInputHidden)this.FindControl("hdTitle"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdImgUrl = (HtmlInputHidden)this.FindControl("hdImgUrl"); this.hdLink = (HtmlInputHidden)this.FindControl("hdLink"); this.hdAppId.Value = base.site.WeixinAppId; FightGroupInfo fightGroup = VShopHelper.GetFightGroup(fightGroupId); if (fightGroup != null) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (masterSettings.OpenMultStore && StoresHelper.ProductHasStores(fightGroup.ProductId)) { this.divGetBySelf.Visible = true; } if (fightGroup.EndTime <= DateTime.Now && fightGroup.Status == FightGroupStatus.FightGroupIn) { VShopHelper.DealFightGroupFail(fightGroupId); fightGroup.Status = FightGroupStatus.FightGroupFail; } this.fightGroupRule.FightGroupActivityId = fightGroup.FightGroupActivityId; FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); HtmlInputText htmlInputText = this.hiddenProductId; int num = fightGroup.ProductId; htmlInputText.Value = num.ToString(); this.hidFightGroupActivityStatus.Value = ((fightGroupActivitieInfo.EndDate > DateTime.Now) ? "1" : "0"); HtmlInputHidden htmlInputHidden = this.hfNowTime; DateTime dateTime = DateTime.Now; htmlInputHidden.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); HtmlInputHidden htmlInputHidden2 = this.hfEndTime; dateTime = fightGroup.EndTime; htmlInputHidden2.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); HtmlInputHidden htmlInputHidden3 = this.hfStartTime; dateTime = fightGroup.StartTime; htmlInputHidden3.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); this.hlProductReview.NavigateUrl = $"/vshop/ProductReview.aspx?ProductId={fightGroup.ProductId}"; IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(fightGroup.FightGroupActivityId); Literal literal = this.litJoinNumber; num = fightGroup.JoinNumber; literal.Text = num.ToString(); Literal literal2 = this.litLimitedHour; num = fightGroupActivitieInfo.LimitedHour; literal2.Text = num.ToString(); this.litProductName.Text = fightGroup.ProductName; this.litFGAPrice.Text = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice).F2ToString("f2"); IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroup.ProductId, out dictionary, out list); if (productDetails != null) { this.litPPrice.Text = productDetails.MaxSalePrice.F2ToString("f2"); this.skuSubmitOrder.ProductInfo = productDetails; this.skuSubmitOrder.OrderBusiness = 1; this.skuSubmitOrder.FightGroupActivityId = fightGroup.FightGroupActivityId; this.skuSubmitOrder.FightGroupId = fightGroup.FightGroupId; } Literal literal3 = this.litProductReviewCount; num = ProductBrowser.GetProductReviews(new ProductReviewQuery { PageIndex = 1, PageSize = 2147483647, ProductId = fightGroupActivitieInfo.ProductId }).TotalRecords; literal3.Text = num.ToString(); FightGroupStatus status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupFail)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_fail.png"; this.imgStatus.Attributes.Add("class", "fg_fail"); this.spanTime.Style.Add("text-align", "center"); this.litRemainTimeHtml.Style.Add("display", "none"); } else { status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupSuccess)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_ok.png"; this.imgStatus.Attributes.Add("class", "fg_ok"); } } Image image = this.imgStatus; status = fightGroup.Status; image.Visible = !status.Equals(FightGroupStatus.FightGroupIn); int fightGroupActiveNumber = VShopHelper.GetFightGroupActiveNumber(fightGroup.FightGroupId); int num2 = fightGroup.JoinNumber - fightGroupActiveNumber; num2 = ((num2 >= 0) ? num2 : 0); this.litNeedPerson.Text = num2.ToString(); HtmlControl htmlControl = this.divIn; status = fightGroup.Status; htmlControl.Visible = status.Equals(FightGroupStatus.FightGroupIn); HtmlControl htmlControl2 = this.divOver; status = fightGroup.Status; htmlControl2.Visible = !status.Equals(FightGroupStatus.FightGroupIn); IList <FightGroupUserModel> fightGroupUsers = VShopHelper.GetFightGroupUsers(fightGroup.FightGroupId); foreach (FightGroupUserModel item in fightGroupUsers) { item.Name = DataHelper.GetHiddenUsername(item.Name); if (HiContext.Current.UserId == item.UserId) { this.hiddenJoinedUser.Value = "true"; } } this.rptFightGroupDetails.DataSource = fightGroupUsers; this.rptFightGroupDetails.DataBind(); List <int> list2 = new List <int>(); for (int i = 0; i < num2; i++) { list2.Add(i); } this.rptFightGroupDetailsNeed.DataSource = list2; this.rptFightGroupDetailsNeed.DataBind(); Literal control = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, true); control.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { string text = ""; Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { text = regex.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { text = regex.Replace(productDetails.Description, ""); } text = text.Replace("src", "data-url"); this.litDescription.Text = text; } if (this.rptProductImages != null) { string locationUrl = "javascript:;"; if (string.IsNullOrEmpty(productDetails.ImageUrl1) && string.IsNullOrEmpty(productDetails.ImageUrl2) && string.IsNullOrEmpty(productDetails.ImageUrl3) && string.IsNullOrEmpty(productDetails.ImageUrl4) && string.IsNullOrEmpty(productDetails.ImageUrl5)) { productDetails.ImageUrl1 = masterSettings.DefaultProductImage; } DataTable skus = ProductBrowser.GetSkus(fightGroupActivitieInfo.ProductId); List <SlideImage> list3 = new List <SlideImage>(); foreach (DataRow row in skus.Rows) { List <SlideImage> list4 = (from s in list3 where s.ImageUrl == row["ThumbnailUrl410"].ToString() select s).ToList(); if (list4.Count <= 0) { list3.Add(new SlideImage(row["ThumbnailUrl410"].ToString(), locationUrl)); } } list3.Add(new SlideImage(productDetails.ImageUrl1, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl2, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl3, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl4, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list3 where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); } if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareTitle)) { this.hdTitle.Value = (string.IsNullOrEmpty(productDetails.Title) ? productDetails.ProductName : productDetails.Title); } else { this.hdTitle.Value = fightGroupActivitieInfo.ShareTitle.Trim(); } if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareContent.Trim())) { this.hdDesc.Value = productDetails.Meta_Description; } else { this.hdDesc.Value = fightGroupActivitieInfo.ShareContent.Trim(); } string icon = fightGroupActivitieInfo.Icon; this.hdImgUrl.Value = Globals.FullPath(string.IsNullOrEmpty(icon) ? base.site.DefaultProductThumbnail8 : icon); this.hdLink.Value = Globals.FullPath(this.Page.Request.Url.ToString()); DataTable data = ProductBrowser.GetProductConsultations(new ProductConsultationAndReplyQuery { ProductId = productDetails.ProductId, PageIndex = 1, PageSize = 2147483647, SortOrder = SortAction.Desc, SortBy = "ConsultationId" }).Data; for (int j = 0; j < data.Rows.Count; j++) { data.Rows[j]["UserName"] = DataHelper.GetHiddenUsername(data.Rows[j]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = data; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = data.IsNullOrEmpty(); } else { base.GotoResourceNotFound("活动不存在"); } }
private void dlstOrders_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem) { return; } string orderId = DataBinder.Eval(e.Item.DataItem, "OrderId").ToString(); OrderInfo orderInfo = TradeHelper.GetOrderInfo(orderId); OrderStatus orderStatus = (OrderStatus)DataBinder.Eval(e.Item.DataItem, "OrderStatus"); HtmlAnchor htmlAnchor = (HtmlAnchor)e.Item.FindControl("lkbtnCheckTake"); Literal literal = (Literal)e.Item.FindControl("litCloseOrder"); int num = DataBinder.Eval(e.Item.DataItem, "ShippingModeId").ToInt(0); string text = ""; if (!(DataBinder.Eval(e.Item.DataItem, "Gateway") is DBNull)) { text = (string)DataBinder.Eval(e.Item.DataItem, "Gateway"); } int num2 = (int)((DataBinder.Eval(e.Item.DataItem, "GroupBuyId") is DBNull) ? ((object)0) : DataBinder.Eval(e.Item.DataItem, "GroupBuyId")); int num3 = (int)((DataBinder.Eval(e.Item.DataItem, "CountDownBuyId") is DBNull) ? ((object)0) : DataBinder.Eval(e.Item.DataItem, "CountDownBuyId")); Label label = (Label)e.Item.FindControl("lkbtnSendGoods"); ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnPayOrder"); ImageLinkButton imageLinkButton2 = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmOrder"); HtmlAnchor htmlAnchor2 = (HtmlAnchor)e.Item.FindControl("lkbtnCheckRefund"); ImageLinkButton imageLinkButton3 = (ImageLinkButton)e.Item.FindControl("lkbtnConfirm"); int num4 = (int)((DataBinder.Eval(e.Item.DataItem, "StoreId") == DBNull.Value) ? ((object)0) : DataBinder.Eval(e.Item.DataItem, "StoreId")); bool flag = (bool)((DataBinder.Eval(e.Item.DataItem, "IsStoreCollect") == DBNull.Value) ? ((object)false) : DataBinder.Eval(e.Item.DataItem, "IsStoreCollect")); OrderStatusLabel orderStatusLabel = (OrderStatusLabel)e.Item.FindControl("lblOrderStatus"); if (orderStatusLabel != null) { orderStatusLabel.OrderItemStatus = orderInfo.ItemStatus; if (orderInfo.PreSaleId > 0) { orderStatusLabel.PreSaleId = orderInfo.PreSaleId; orderStatusLabel.DepositDate = orderInfo.DepositDate; } } bool flag2 = false; RefundInfo refundInfo = TradeHelper.GetRefundInfo(orderId); if (refundInfo != null && orderInfo.StoreId == this.UserStoreId) { htmlAnchor2.Attributes.Add("refundid", refundInfo.RefundId.ToString()); flag2 = true; } Literal literal2 = (Literal)e.Item.FindControl("group"); if (literal2 != null) { if (num2 > 0) { literal2.Text = "(团)"; } if (num3 > 0) { literal2.Text = "(抢)"; } if (orderInfo.PreSaleId > 0) { literal2.Text = "(预)"; } } if (orderStatus == OrderStatus.WaitBuyerPay) { if (orderInfo.PreSaleId > 0) { if (!orderInfo.DepositDate.HasValue) { literal.Visible = true; if (text != "hishop.plugins.payment.podrequest" && num != -2 && orderInfo.FightGroupId == 0) { imageLinkButton.Visible = true; } } else { ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(orderInfo.PreSaleId); if (productPreSaleInfo.PaymentStartDate <= DateTime.Now && productPreSaleInfo.PaymentEndDate >= DateTime.Now && text != "hishop.plugins.payment.podrequest" && num != -2 && orderInfo.FightGroupId == 0) { imageLinkButton.Visible = true; } } } else { literal.Visible = true; if (text != "hishop.plugins.payment.podrequest" && num != -2 && orderInfo.FightGroupId == 0) { imageLinkButton.Visible = true; } } } if (text == "hishop.plugins.payment.podrequest" && (orderStatus == OrderStatus.WaitBuyerPay || orderStatus == OrderStatus.SellerAlreadySent)) { literal.Visible = true; } if ((orderStatus == OrderStatus.ApplyForRefund && this.UserStoreId == num4) & flag) { htmlAnchor2.Visible = true; } if (num2 > 0) { string[] source = new string[1] { "hishop.plugins.payment.podrequest" }; GroupBuyStatus groupBuyStatus = (GroupBuyStatus)DataBinder.Eval(e.Item.DataItem, "GroupBuyStatus"); Label label2 = label; int visible; switch (orderStatus) { case OrderStatus.WaitBuyerPay: if (source.Contains(text)) { goto case OrderStatus.BuyerAlreadyPaid; } goto default; case OrderStatus.BuyerAlreadyPaid: if (groupBuyStatus == GroupBuyStatus.Success) { visible = ((orderInfo.ItemStatus == OrderItemStatus.Nomarl) ? 1 : 0); break; } goto default; default: visible = 0; break; } label2.Visible = ((byte)visible != 0); } else { Label label3 = label; int visible2; switch (orderStatus) { case OrderStatus.WaitBuyerPay: if (text == "hishop.plugins.payment.podrequest") { goto case OrderStatus.BuyerAlreadyPaid; } goto default; case OrderStatus.BuyerAlreadyPaid: visible2 = ((orderInfo.ItemStatus == OrderItemStatus.Nomarl) ? 1 : 0); break; default: visible2 = 0; break; } label3.Visible = ((byte)visible2 != 0); } imageLinkButton2.Visible = (orderStatus == OrderStatus.SellerAlreadySent && orderInfo.ItemStatus == OrderItemStatus.Nomarl); HtmlAnchor htmlAnchor3; int visible3; if (num == -2) { htmlAnchor3 = htmlAnchor; if ((orderStatus == OrderStatus.BuyerAlreadyPaid || orderStatus == OrderStatus.WaitBuyerPay) && orderInfo.ItemStatus == OrderItemStatus.Nomarl) { visible3 = (orderInfo.IsConfirm ? 1 : 0); goto IL_05d6; } visible3 = 0; goto IL_05d6; } goto IL_0644; IL_0631: int visible4 = (orderInfo.ItemStatus == OrderItemStatus.Nomarl) ? 1 : 0; goto IL_063d; IL_0644: LinkButton linkButton = (LinkButton)e.Item.FindControl("lbtnFightGroup"); Image image = (Image)e.Item.FindControl("imgError"); HtmlInputHidden htmlInputHidden = (HtmlInputHidden)e.Item.FindControl("hidFightGroup"); image.Visible = orderInfo.IsError; if (orderInfo.IsError) { image.Attributes.Add("title", orderInfo.ErrorMessage); image.ImageUrl = "\\Admin\\images\\orderError.png"; } if (orderInfo.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(orderInfo.FightGroupId); if (fightGroup != null) { if (fightGroup.Status == FightGroupStatus.FightGroupIn && orderInfo.OrderStatus != OrderStatus.WaitBuyerPay && orderInfo.OrderStatus != OrderStatus.Closed) { htmlInputHidden.Value = "1"; } else { htmlInputHidden.Value = "0"; } } } else { linkButton.Visible = false; } return; IL_05d6: htmlAnchor3.Visible = ((byte)visible3 != 0); literal.Visible = (orderStatus == OrderStatus.WaitBuyerPay && orderInfo.ItemStatus == OrderItemStatus.Nomarl); label.Visible = false; ImageLinkButton imageLinkButton4 = imageLinkButton3; if (!orderInfo.IsConfirm) { if (orderInfo.OrderStatus == OrderStatus.WaitBuyerPay && (text == "hishop.plugins.payment.podrequest" || orderInfo.PaymentTypeId == -3)) { goto IL_0631; } if (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid) { goto IL_0631; } } visible4 = 0; goto IL_063d; IL_063d: imageLinkButton4.Visible = ((byte)visible4 != 0); goto IL_0644; }
private void rptOrders_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { HtmlAnchor htmlAnchor = (HtmlAnchor)e.Item.FindControl("lkbtnCouponCode"); HtmlAnchor htmlAnchor2 = (HtmlAnchor)e.Item.FindControl("lkbtnApplyForRefund"); HtmlAnchor htmlAnchor3 = (HtmlAnchor)e.Item.FindControl("lnkClose"); HtmlAnchor htmlAnchor4 = (HtmlAnchor)e.Item.FindControl("lkbtnViewMessage"); HtmlAnchor htmlAnchor5 = (HtmlAnchor)e.Item.FindControl("lkbtnProductReview"); Literal literal = (Literal)e.Item.FindControl("ltlOrderItems"); Literal literal2 = (Literal)e.Item.FindControl("ltlOrderGifts"); HtmlGenericControl htmlGenericControl = e.Item.FindControl("panelOperaters") as HtmlGenericControl; HtmlGenericControl htmlGenericControl2 = e.Item.FindControl("divToDetail") as HtmlGenericControl; HtmlGenericControl htmlGenericControl3 = e.Item.FindControl("divOrderStatus") as HtmlGenericControl; HtmlGenericControl htmlGenericControl4 = e.Item.FindControl("divOrderError") as HtmlGenericControl; HtmlGenericControl htmlGenericControl5 = e.Item.FindControl("divOrderGifts") as HtmlGenericControl; HtmlGenericControl htmlGenericControl6 = e.Item.FindControl("divOrderItems") as HtmlGenericControl; HtmlGenericControl htmlGenericControl7 = (HtmlGenericControl)e.Item.FindControl("OrderIdSpan"); HtmlGenericControl htmlGenericControl8 = (HtmlGenericControl)e.Item.FindControl("PayMoneySpan"); HtmlGenericControl htmlGenericControl9 = (HtmlGenericControl)e.Item.FindControl("TakeCodeDIV"); HtmlAnchor htmlAnchor6 = (HtmlAnchor)e.Item.FindControl("lnkViewLogistics"); HtmlAnchor htmlAnchor7 = (HtmlAnchor)e.Item.FindControl("lnkToPay"); HtmlAnchor htmlAnchor8 = (HtmlAnchor)e.Item.FindControl("lnkHelpLink"); HtmlAnchor htmlAnchor9 = (HtmlAnchor)e.Item.FindControl("lnkFinishOrder"); HtmlAnchor htmlAnchor10 = (HtmlAnchor)e.Item.FindControl("lnkViewTakeCodeQRCode"); HtmlAnchor htmlAnchor11 = (HtmlAnchor)e.Item.FindControl("lnkCertification"); HtmlGenericControl htmlGenericControl10 = (HtmlGenericControl)e.Item.FindControl("divSendRedEnvelope"); OrderStatus orderStatus = (OrderStatus)DataBinder.Eval(e.Item.DataItem, "OrderStatus"); Repeater repeater = (Repeater)e.Item.FindControl("Repeater1"); Repeater repeater2 = (Repeater)e.Item.FindControl("rptPointGifts"); this.paymenttypeselect = (Common_WAPPaymentTypeSelect)this.FindControl("paymenttypeselect"); Literal literal3 = (Literal)e.Item.FindControl("litGiftTitle"); string text = DataBinder.Eval(e.Item.DataItem, "OrderId").ToString(); OrderInfo orderInfo = TradeHelper.GetOrderInfo(text); if (orderInfo != null) { if (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid || orderInfo.OrderStatus == OrderStatus.Finished || orderInfo.OrderStatus == OrderStatus.WaitReview || orderInfo.OrderStatus == OrderStatus.History) { WeiXinRedEnvelopeInfo openedWeiXinRedEnvelope = WeiXinRedEnvelopeProcessor.GetOpenedWeiXinRedEnvelope(); bool visible = false; if (openedWeiXinRedEnvelope != null && openedWeiXinRedEnvelope.EnableIssueMinAmount <= orderInfo.GetPayTotal() && orderInfo.OrderDate >= openedWeiXinRedEnvelope.ActiveStartTime && orderInfo.OrderDate <= openedWeiXinRedEnvelope.ActiveEndTime) { visible = true; } if (htmlGenericControl10 != null) { htmlGenericControl10.Visible = visible; if (this.isVShop) { htmlGenericControl10.InnerHtml = "<a href=\"/vshop/SendRedEnvelope.aspx?OrderId=" + orderInfo.OrderId + "\"></a>"; } else { htmlGenericControl10.InnerHtml = ""; string text2 = Globals.HttpsFullPath("/vshop/SendRedEnvelope.aspx?OrderId=" + orderInfo.OrderId); htmlGenericControl10.Attributes.Add("onclick", string.Format("ShowMsg('{0}','{1}')", "代金红包请前往微信端领取!", "false")); } } } this.paymenttypeselect.ClientType = base.ClientType; htmlGenericControl4.Visible = (orderInfo.IsError && orderInfo.CloseReason != "订单已退款完成"); htmlGenericControl3.Visible = !orderInfo.IsError; htmlGenericControl5.Visible = (orderInfo.LineItems.Count() == 0); htmlGenericControl6.Visible = (orderInfo.LineItems.Count() > 0); htmlAnchor2.HRef = "ApplyRefund.aspx?OrderId=" + text; htmlAnchor.Visible = false; htmlAnchor.HRef = "MemberOrdersVCode?OrderId=" + text; HtmlGenericControl htmlGenericControl11 = (HtmlGenericControl)e.Item.FindControl("OrderSupplierH3"); string text3 = string.Empty; if (htmlGenericControl11 != null) { text3 = htmlGenericControl11.Attributes["class"]; text3 = ((!string.IsNullOrEmpty(text3)) ? text3.Replace(" ztitle", "").Replace("stitle", "") : ""); } if (orderInfo.OrderStatus != OrderStatus.WaitBuyerPay || !(orderInfo.ParentOrderId == "-1") || !orderInfo.OrderId.Contains("P")) { if (HiContext.Current.SiteSettings.OpenMultStore && orderInfo.StoreId > 0 && !string.IsNullOrWhiteSpace(orderInfo.StoreName)) { htmlGenericControl7.InnerText = orderInfo.StoreName; text3 += " mtitle"; } else if (orderInfo.StoreId == 0 && HiContext.Current.SiteSettings.OpenSupplier && orderInfo.SupplierId > 0) { htmlGenericControl7.InnerText = orderInfo.ShipperName; text3 += " stitle"; } else { htmlGenericControl7.InnerText = "平台"; text3 += " ztitle"; } htmlGenericControl11.Attributes["class"] = text3; if (orderInfo.LineItems.Count <= 0) { literal3.Text = "(礼)"; } } else { htmlGenericControl7.InnerText = orderInfo.OrderId; htmlGenericControl11.Attributes["class"] = text3; } if (orderInfo.PreSaleId > 0) { htmlGenericControl8.InnerText = (orderInfo.Deposit + orderInfo.FinalPayment).F2ToString("f2"); } else { htmlGenericControl8.InnerText = Convert.ToDecimal(DataBinder.Eval(e.Item.DataItem, "OrderTotal")).F2ToString("f2"); } if (htmlGenericControl2 != null) { if (orderInfo.OrderType == OrderType.ServiceOrder) { htmlGenericControl2.Attributes.Add("onclick", "window.location.href='ServiceMemberOrderDetails.aspx?orderId=" + orderInfo.OrderId + "'"); } else { htmlGenericControl2.Attributes.Add("onclick", "window.location.href='MemberOrderDetails.aspx?orderId=" + orderInfo.OrderId + "'"); } } if (htmlAnchor6 != null) { if (orderInfo.OrderStatus == OrderStatus.SellerAlreadySent || orderInfo.OrderStatus == OrderStatus.Finished) { if (!string.IsNullOrEmpty(orderInfo.ExpressCompanyAbb) && !string.IsNullOrEmpty(orderInfo.ShipOrderNumber)) { htmlAnchor6.HRef = "MyLogistics.aspx?OrderId=" + text; } else if (orderInfo.ExpressCompanyName == "同城物流配送") { htmlAnchor6.HRef = "MyLogistics.aspx?OrderId=" + text; } else { htmlAnchor6.Visible = false; } } else { htmlAnchor6.Visible = false; } } if (htmlAnchor10 != null) { htmlAnchor10.HRef = "ViewQRCode.aspx?orderId=" + orderInfo.OrderId; } int num4; if (htmlAnchor5 != null && ((orderStatus == OrderStatus.Finished && orderInfo.LineItems.Count > 0) || (orderStatus == OrderStatus.Closed && orderInfo.OnlyReturnedCount == orderInfo.LineItems.Count && orderInfo.LineItems.Count > 0))) { htmlAnchor5.Visible = true; htmlAnchor5.HRef = "MemberSubmitProductReview.aspx?orderId=" + text; DataTable productReviewAll = ProductBrowser.GetProductReviewAll(text); LineItemInfo lineItemInfo = new LineItemInfo(); int num = 0; int num2 = 0; int num3 = 0; bool flag = false; foreach (KeyValuePair <string, LineItemInfo> lineItem in orderInfo.LineItems) { flag = false; lineItemInfo = lineItem.Value; for (int i = 0; i < productReviewAll.Rows.Count; i++) { num4 = lineItemInfo.ProductId; if (num4.ToString() == productReviewAll.Rows[i][0].ToString() && lineItemInfo.SkuId.ToString().Trim() == productReviewAll.Rows[i][1].ToString().Trim()) { flag = true; } } if (!flag) { num2++; } else { num3++; } } if (num + num2 == orderInfo.LineItems.Count) { htmlAnchor5.InnerText = "查看评论"; } else { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (masterSettings != null) { if (masterSettings.ProductCommentPoint <= 0) { htmlAnchor5.InnerText = "评价"; } else { htmlAnchor5.InnerText = $"评价得{num3 * masterSettings.ProductCommentPoint}积分"; } } } } if (htmlAnchor3 != null && orderStatus == OrderStatus.WaitBuyerPay) { if (orderInfo.PreSaleId == 0 || (orderInfo.PreSaleId > 0 && !orderInfo.DepositDate.HasValue)) { htmlAnchor3.Visible = true; } htmlAnchor3.Attributes.Add("onclick", $"closeOrder('{text}')"); } DateTime dateTime; if (htmlAnchor7 != null) { if (orderStatus == OrderStatus.WaitBuyerPay && orderInfo.ItemStatus == OrderItemStatus.Nomarl && orderInfo.PaymentTypeId != -3 && orderInfo.Gateway != "hishop.plugins.payment.bankrequest" && orderInfo.Gateway != "hishop.plugins.payment.podrequest") { htmlAnchor7.Attributes.Add("IsServiceOrder", (orderInfo.OrderType == OrderType.ServiceOrder).ToString().ToLower()); if (orderInfo.PreSaleId > 0) { ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(orderInfo.PreSaleId); if (!orderInfo.DepositDate.HasValue) { htmlGenericControl8.InnerText = orderInfo.Deposit.F2ToString("f2"); (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "定金:¥"; if (productPreSaleInfo.PreSaleEndDate > DateTime.Now) { AttributeCollection attributes = htmlAnchor7.Attributes; num4 = orderInfo.PaymentTypeId; attributes.Add("PaymentTypeId", num4.ToString()); htmlAnchor7.Attributes.Add("OrderId", orderInfo.OrderId); htmlAnchor7.Attributes.Add("OrderTotal", orderInfo.Deposit.F2ToString("f2")); AttributeCollection attributes2 = htmlAnchor7.Attributes; num4 = orderInfo.FightGroupId; attributes2.Add("FightGroupId", num4.ToString()); } else { htmlAnchor7.Visible = false; (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "定金:¥"; } } else if (productPreSaleInfo.PaymentStartDate > DateTime.Now || productPreSaleInfo.PaymentEndDate < DateTime.Now) { (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "尾款:¥"; htmlGenericControl8.InnerText = orderInfo.FinalPayment.F2ToString("f2"); htmlAnchor7.Visible = false; htmlAnchor3.Visible = false; if (productPreSaleInfo.PaymentEndDate < DateTime.Now) { (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "尾款支付结束"; htmlGenericControl8.Visible = false; } } else { AttributeCollection attributes3 = htmlAnchor7.Attributes; num4 = orderInfo.PaymentTypeId; attributes3.Add("PaymentTypeId", num4.ToString()); htmlAnchor7.Attributes.Add("OrderId", orderInfo.OrderId); htmlAnchor7.Attributes.Add("OrderTotal", orderInfo.FinalPayment.F2ToString("f2")); AttributeCollection attributes4 = htmlAnchor7.Attributes; num4 = orderInfo.FightGroupId; attributes4.Add("FightGroupId", num4.ToString()); htmlGenericControl8.InnerText = orderInfo.FinalPayment.F2ToString("f2"); (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "尾款:¥"; htmlAnchor3.Visible = false; } } else { AttributeCollection attributes5 = htmlAnchor7.Attributes; num4 = orderInfo.PaymentTypeId; attributes5.Add("PaymentTypeId", num4.ToString()); htmlAnchor7.Attributes.Add("OrderId", orderInfo.OrderId); htmlAnchor7.Attributes.Add("OrderTotal", orderInfo.GetTotal(false).F2ToString("f2")); AttributeCollection attributes6 = htmlAnchor7.Attributes; num4 = orderInfo.FightGroupId; attributes6.Add("FightGroupId", num4.ToString()); if (HiContext.Current.SiteSettings.OpenMultStore && orderInfo.StoreId > 0 && !SettingsManager.GetMasterSettings().Store_IsOrderInClosingTime) { StoresInfo storeById = StoresHelper.GetStoreById(orderInfo.StoreId); dateTime = DateTime.Now; string str = dateTime.ToString("yyyy-MM-dd"); dateTime = storeById.OpenStartDate; DateTime value = (str + " " + dateTime.ToString("HH:mm")).ToDateTime().Value; dateTime = DateTime.Now; string str2 = dateTime.ToString("yyyy-MM-dd"); dateTime = storeById.OpenEndDate; DateTime dateTime2 = (str2 + " " + dateTime.ToString("HH:mm")).ToDateTime().Value; if (dateTime2 <= value) { dateTime2 = dateTime2.AddDays(1.0); } if (DateTime.Now < value || DateTime.Now > dateTime2) { htmlAnchor7.Attributes.Add("NeedNotInTimeTip", "1"); } } } } else { htmlAnchor7.Visible = false; } } if (htmlAnchor8 != null) { if (orderInfo.Gateway == "hishop.plugins.payment.bankrequest" && orderInfo.OrderStatus == OrderStatus.WaitBuyerPay) { htmlAnchor8.HRef = "FinishOrder.aspx?OrderId=" + text + "&onlyHelp=true"; } else { htmlAnchor8.Visible = false; } } if (htmlAnchor9 != null) { if (orderInfo.OrderStatus == OrderStatus.SellerAlreadySent && orderInfo.ItemStatus == OrderItemStatus.Nomarl) { htmlAnchor9.Attributes.Add("onclick", $"FinishOrder('{text}','{orderInfo.PaymentType}',{orderInfo.LineItems.Count})"); } else { htmlAnchor9.Visible = false; } } if (htmlAnchor11 != null) { if (HiContext.Current.SiteSettings.IsOpenCertification && orderInfo.IDStatus == 0 && orderInfo.IsincludeCrossBorderGoods) { htmlAnchor11.Attributes.Add("orderId", orderInfo.OrderId); htmlAnchor11.Attributes.Add("onclick", "Certification(this)"); htmlAnchor11.Visible = true; } else { htmlAnchor11.Visible = false; } } if (literal != null) { Literal literal4 = literal; num4 = this.GetGoodsNum(orderInfo); literal4.Text = num4.ToString(); } if (literal2 != null) { Literal literal5 = literal2; num4 = this.GetGiftsNum(orderInfo); literal5.Text = num4.ToString(); } if (orderInfo.OrderType == OrderType.ServiceOrder) { Label label = (Label)e.Item.FindControl("OrderStatusLabel2"); IList <OrderVerificationItemInfo> orderVerificationItems = TradeHelper.GetOrderVerificationItems(orderInfo.OrderId); ServiceOrderStatus orderStatus2 = this.GetOrderStatus(orderInfo, orderVerificationItems); label.Text = ((Enum)(object)orderStatus2).ToDescription(); label.Visible = true; } else { OrderStatusLabel orderStatusLabel = (OrderStatusLabel)e.Item.FindControl("OrderStatusLabel1"); orderStatusLabel.OrderItemStatus = ((orderInfo.ItemStatus != 0) ? OrderItemStatus.HasReturnOrReplace : OrderItemStatus.Nomarl); orderStatusLabel.Gateway = orderInfo.Gateway; orderStatusLabel.OrderStatusCode = orderInfo.OrderStatus; orderStatusLabel.ShipmentModelId = orderInfo.ShippingModeId; orderStatusLabel.IsConfirm = orderInfo.IsConfirm; orderStatusLabel.ShipmentModelId = orderInfo.ShippingModeId; orderStatusLabel.PaymentTypeId = orderInfo.PaymentTypeId; orderStatusLabel.PreSaleId = orderInfo.PreSaleId; orderStatusLabel.DepositDate = orderInfo.DepositDate; orderStatusLabel.OrderType = orderInfo.OrderType; orderStatusLabel.ExpressCompanyName = orderInfo.ExpressCompanyName; orderStatusLabel.DadaStatus = orderInfo.DadaStatus; orderStatusLabel.Visible = true; } Dictionary <string, LineItemInfo> lineItems = orderInfo.LineItems; foreach (string key in lineItems.Keys) { lineItems[key].IsValid = (orderInfo.OrderType == OrderType.ServiceOrder); } repeater.DataSource = lineItems.Values; repeater.ItemDataBound += this.Repeater1_ItemDataBound; repeater.DataBind(); if (orderInfo.LineItems.Count == 0) { IEnumerable <OrderGiftInfo> enumerable = from a in orderInfo.Gifts where a.PromoteType == 0 || a.PromoteType == 15 select a; foreach (OrderGiftInfo item in enumerable) { item.NeedPoint = ((orderInfo.OrderType == OrderType.ServiceOrder) ? 1 : 0); } repeater2.DataSource = enumerable; repeater2.ItemDataBound += this.rptPointGifts_ItemDataBound; repeater2.DataBind(); } OrderItemStatus itemStatus = orderInfo.ItemStatus; DateTime obj; if (DataBinder.Eval(e.Item.DataItem, "FinishDate") != DBNull.Value) { obj = (DateTime)DataBinder.Eval(e.Item.DataItem, "FinishDate"); } else { dateTime = DateTime.Now; obj = dateTime.AddYears(-1); } DateTime dateTime3 = obj; string text4 = ""; if (DataBinder.Eval(e.Item.DataItem, "Gateway") != null && !(DataBinder.Eval(e.Item.DataItem, "Gateway") is DBNull)) { text4 = (string)DataBinder.Eval(e.Item.DataItem, "Gateway"); } RefundInfo refundInfo = TradeHelper.GetRefundInfo(text); if (htmlAnchor2 != null) { if (orderInfo.OrderType == OrderType.ServiceOrder) { htmlAnchor2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid && orderInfo.ItemStatus == OrderItemStatus.Nomarl && orderInfo.LineItems.Count != 0); if (htmlAnchor2.Visible) { LineItemInfo value2 = orderInfo.LineItems.FirstOrDefault().Value; if (value2.IsRefund) { if (value2.IsOverRefund) { htmlAnchor2.Visible = true; } else if (value2.IsValid) { htmlAnchor2.Visible = true; } else if (DateTime.Now >= value2.ValidStartDate.Value && DateTime.Now <= value2.ValidEndDate.Value) { htmlAnchor2.Visible = true; } else { htmlAnchor2.Visible = false; } } else { htmlAnchor2.Visible = false; } } } else { htmlAnchor2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid && orderInfo.ItemStatus == OrderItemStatus.Nomarl && orderInfo.LineItems.Count != 0 && orderInfo.GetPayTotal() > decimal.Zero); } } if (htmlAnchor != null) { htmlAnchor.Visible = (orderInfo.OrderType == OrderType.ServiceOrder && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid); } SiteSettings masterSettings2 = SettingsManager.GetMasterSettings(); if (!string.IsNullOrEmpty(orderInfo.TakeCode) && (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid || orderInfo.OrderStatus == OrderStatus.WaitBuyerPay)) { htmlAnchor10.Visible = true; } if (!htmlAnchor2.Visible && !htmlAnchor4.Visible && !htmlAnchor10.Visible && !htmlAnchor6.Visible && !htmlAnchor3.Visible && !htmlAnchor7.Visible && !htmlAnchor8.Visible && !htmlAnchor9.Visible && !htmlAnchor5.Visible && !htmlAnchor.Visible) { htmlGenericControl.Visible = false; } if (orderInfo.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(orderInfo.FightGroupId); if (fightGroup != null) { htmlAnchor2.Visible = (fightGroup.Status != 0 && orderInfo.GetPayTotal() > decimal.Zero && (refundInfo == null || refundInfo.HandleStatus == RefundStatus.Refused) && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid); } } } } }
protected override void AttachChildControls() { this.hdorderId = (HtmlInputHidden)this.FindControl("hdorderId"); this.txtRemark = (TextBox)this.FindControl("txtRemark"); this.litRefundAmount = (Literal)this.FindControl("litRefundAmount"); this.dropRefundType = (RefundTypeRadioList)this.FindControl("dropRefundType"); this.DropRefundReason = (AfterSalesReasonDropDownList)this.FindControl("RefundReasonDropDownList"); this.btnRefund = ButtonManager.Create(this.FindControl("btnRefund")); this.groupbuyPanel = (HtmlGenericControl)this.FindControl("groupbuyPanel"); this.OrderId = HttpContext.Current.Request.QueryString["OrderId"].ToNullString(); this.txtBankName = (HtmlInputText)this.FindControl("txtBankName"); this.txtBankAccountName = (HtmlInputText)this.FindControl("txtBankAccountName"); this.txtBankAccountNo = (HtmlInputText)this.FindControl("txtBankAccountNo"); this.products = (Common_OrderItems_AfterSales)this.FindControl("Common_OrderItems_AfterSales"); this.hidRefundType = (HiddenField)this.FindControl("hidRefundType"); this.order = TradeHelper.GetOrderInfo(this.OrderId); if (this.order == null || this.order.UserId != HiContext.Current.UserId) { this.ShowMessage("错误的订单信息!", false, "", 1); } else { if (this.order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.order.FightGroupId); if (fightGroup.Status != FightGroupStatus.FightGroupSuccess && fightGroup.Status != FightGroupStatus.FightGroupFail) { this.ShowMessage("火拼团订单成团之前不能进行退款操作!", false, "", 1); return; } } GroupBuyInfo groupBuyInfo = null; if (this.order.GroupBuyId > 0) { groupBuyInfo = ProductBrowser.GetGroupBuy(this.order.GroupBuyId); if (groupBuyInfo != null) { if (this.groupbuyPanel != null && groupBuyInfo.Status != GroupBuyStatus.Failed) { this.groupbuyPanel.Visible = true; } if (groupBuyInfo.NeedPrice >= this.order.GetTotal(false) && groupBuyInfo.Status != GroupBuyStatus.Failed) { this.ShowMessage("团购违约金大于等于订单总金额,不能进行退款申请!", false, "", 1); return; } } } decimal num = this.order.GetCanRefundAmount("", groupBuyInfo, 0); if (num < decimal.Zero) { num = default(decimal); } this.litRefundAmount.Text = num.F2ToString("f2"); this.products.DataSource = this.order.LineItems.Values; this.products.DataBind(); this.btnRefund.Click += this.btnRefund_Click; PageTitle.AddSiteNameTitle("申请退款"); if (!this.Page.IsPostBack) { this.DropRefundReason.IsRefund = true; this.DropRefundReason.DataBind(); string enumDescription = EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.AdvancePay, 1); if (this.order.PreSaleId <= 0 || this.order.Gateway.ToLower() == enumDescription || this.order.DepositGatewayOrderId.ToNullString() == enumDescription) { this.dropRefundType.OrderGateWay = ((this.order.PreSaleId > 0) ? enumDescription : this.order.Gateway); } this.dropRefundType.BalanceAmount = this.order.BalanceAmount; this.dropRefundType.DataBind(); } } }
private void btnRefund_Click(object sender, EventArgs e) { string text = this.Page.Request.QueryString["returnUrl"].ToNullString(); if (string.IsNullOrEmpty(text)) { text = this.Page.Request.UrlReferrer.ToNullString(); if (text == this.Page.Request.Url.ToString()) { text = "/User/UserOrders"; } } string text2 = ""; string text3 = ""; string text4 = ""; text2 = Globals.StripAllTags(this.txtBankName.Value); text3 = Globals.StripAllTags(this.txtBankAccountName.Value); text4 = Globals.StripAllTags(this.txtBankAccountNo.Value); this.iRefundType = this.hidRefundType.Value.ToInt(0); if (!Enum.IsDefined(typeof(RefundTypes), this.iRefundType)) { this.ShowMessage("错误的退款方式", false, "", 1); } string enumDescription = EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.AdvancePay, 1); if ((this.order.Gateway.ToLower() == enumDescription || this.order.DepositGatewayOrderId.ToNullString().ToLower() == enumDescription) && this.iRefundType != 1) { this.ShowMessage("预付款支付的订单只能退回到预付款帐号", false, "", 1); } else { if (this.order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.order.FightGroupId); if (fightGroup != null && fightGroup.Status == FightGroupStatus.FightGroupIn) { this.ShowMessage("拼团过程中时,已完成支付的订单不能发起退款;", false, "", 1); return; } } if (!TradeHelper.CanRefund(this.order, "")) { this.ShowMessage("当前订单不能进行退款操作!", false, "", 1); } else { string userRemark = Globals.StripAllTags(this.txtRemark.Text.Trim()); if (this.iRefundType == 2 && (string.IsNullOrEmpty(text2) || string.IsNullOrEmpty(text3) || string.IsNullOrEmpty(text4))) { this.ShowMessage("您选择了银行退款,请在退款说明中输入退款的银行卡信息!", true, "", 1); } else if (!this.CanRefundBalance()) { this.ShowMessage("请先开通预付款账户", false, "", 1); } else { string selectedValue = this.DropRefundReason.SelectedValue; if (string.IsNullOrEmpty(selectedValue)) { this.ShowMessage("请选择退款原因", true, "", 1); } string refundGateWay = string.IsNullOrEmpty(this.order.Gateway) ? "" : this.order.Gateway.ToLower().Replace(".payment.", ".refund."); int num = 0; num = this.order.GetAllQuantity(true); GroupBuyInfo groupbuy = null; if (this.order.GroupBuyId > 0) { groupbuy = ProductBrowser.GetGroupBuy(this.order.GroupBuyId); } decimal canRefundAmount = this.order.GetCanRefundAmount("", groupbuy, 0); string orderId = this.order.OrderId; if (this.RefundItem != null) { orderId = this.RefundItem.ItemDescription + this.RefundItem.SKUContent; num = this.RefundItem.ShipmentQuantity; } string generateId = Globals.GetGenerateId(); RefundInfo refundInfo = new RefundInfo(); refundInfo.OrderId = this.order.OrderId; refundInfo.UserRemark = userRemark; refundInfo.RefundGateWay = refundGateWay; refundInfo.RefundOrderId = generateId; refundInfo.BankName = text2; refundInfo.BankAccountNo = text4; refundInfo.BankAccountName = text3; refundInfo.ApplyForTime = DateTime.Now; refundInfo.StoreId = this.order.StoreId; refundInfo.RefundReason = selectedValue; refundInfo.RefundType = (RefundTypes)this.iRefundType; refundInfo.RefundAmount = canRefundAmount; if (TradeHelper.ApplyForRefund(refundInfo)) { if (this.order.StoreId > 0) { VShopHelper.AppPsuhRecordForStore(this.order.StoreId, this.OrderId, "", EnumPushStoreAction.StoreOrderRefundApply); } this.ShowMessage("成功的申请了退款", true, text, 2); } else { this.ShowMessage("申请退款失败", false, "", 1); } } } } }
protected void Page_Load(object sender, EventArgs e) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (HiContext.Current.Manager != null) { this.UserStoreId = HiContext.Current.Manager.StoreId; } if (string.IsNullOrEmpty(RouteConfig.GetParameter(this, "OrderId", false))) { base.GotoResourceNotFound(); } else { this.orderId = RouteConfig.GetParameter(this, "OrderId", false); this.order = OrderHelper.GetOrderInfo(this.orderId); if (this.order.SupplierId != this.UserStoreId) { base.Response.Write("<h3 style=\"color:red;\">订单不是当前供应商订单,不能访问。</h3>"); base.Response.End(); } if (this.order == null) { base.Response.Write("<h3 style=\"color:red;\">订单不存在,或者已被删除。</h3>"); base.Response.End(); } else { this.LoadUserControl(this.order); } if (!this.Page.IsPostBack) { this.txtOrderId.Value = this.order.OrderId; this.lblOrderStatus.OrderStatusCode = this.order.OrderStatus; this.lblOrderStatus.OrderItemStatus = this.order.ItemStatus; this.lblOrderStatus.ShipmentModelId = this.order.ShippingModeId; this.lblOrderStatus.IsConfirm = this.order.IsConfirm; this.lblOrderStatus.Gateway = this.order.Gateway; if (this.order.PreSaleId > 0) { this.lblOrderStatus.PreSaleId = this.order.PreSaleId; this.lblOrderStatus.DepositDate = this.order.DepositDate; } this.litOrderId.Text = this.order.OrderId; this.litUserName.Text = this.order.Username; this.litRealName.Text = this.order.RealName; this.litUserTel.Text = this.order.TelPhone; string text = string.Empty; if (!string.IsNullOrEmpty(this.order.ShipTo)) { text += this.order.ShipTo; } if (!string.IsNullOrEmpty(this.order.TelPhone)) { text = text + "," + this.order.TelPhone; } if (!string.IsNullOrEmpty(this.order.CellPhone)) { text = text + "," + this.order.CellPhone; } if (!string.IsNullOrEmpty(this.order.ShippingRegion)) { text = text + "," + this.order.ShippingRegion; } if (!string.IsNullOrEmpty(this.order.Address)) { text = text + "," + this.order.Address; } this.lblShipAddress.Text = text.Trim(','); this.litShipToDate.Text = this.order.ShipToDate; this.litRemark.Text = this.order.Remark; if (this.order.OrderStatus == OrderStatus.SellerAlreadySent) { this.lbtnModifyShippingOrder.Visible = true; } if ((int)this.lblOrderStatus.OrderStatusCode != 4) { this.lbCloseReason.Visible = false; } else { this.lbReason.Text = this.order.CloseReason; } DateTime dateTime; if (this.order.PreSaleId > 0) { if (this.order.DepositDate.HasValue) { Literal litDepositTime = this.LitDepositTime; dateTime = this.order.DepositDate.Value; litDepositTime.Text = "定金时间:" + dateTime.ToString("yyyy-MM-dd HH:mm:ss"); } DateTime payDate = this.order.PayDate; if (this.order.PayDate != DateTime.MinValue) { Literal literal = this.litPayTime; dateTime = this.order.PayDate; literal.Text = "尾款时间:" + dateTime.ToString("yyyy-MM-dd HH:mm:ss"); } } else if (this.order.OrderStatus != OrderStatus.WaitBuyerPay && this.order.OrderStatus != OrderStatus.Closed && this.order.Gateway != "hishop.plugins.payment.podrequest") { Literal literal2 = this.litPayTime; dateTime = this.order.PayDate; literal2.Text = "付款时间:" + dateTime.ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.OrderStatus == OrderStatus.SellerAlreadySent || this.order.OrderStatus == OrderStatus.Finished) { Literal literal3 = this.litSendGoodTime; dateTime = this.order.ShippingDate; literal3.Text = "发货时间:" + dateTime.ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.OrderStatus == OrderStatus.Finished) { Literal literal4 = this.litFinishTime; dateTime = this.order.FinishDate; literal4.Text = "完成时间:" + dateTime.ToString("yyyy-MM-dd HH:mm:ss"); } Literal literal5 = this.litOrderTime; dateTime = this.order.OrderDate; literal5.Text = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); if ((this.order.OrderStatus == OrderStatus.BuyerAlreadyPaid || (this.order.OrderStatus == OrderStatus.WaitBuyerPay && this.order.Gateway == "hishop.plugins.payment.podrequest")) && this.order.ItemStatus == OrderItemStatus.Nomarl) { if (masterSettings.OpenMultStore && ((this.order.ShippingModeId == -1 && (this.order.StoreId > 0 || this.order.StoreId == -1)) || this.order.ShippingModeId == -2)) { this.lkbtnSendGoods.Visible = false; } else if (this.order.GroupBuyId > 0) { this.lkbtnSendGoods.Visible = (this.order.GroupBuyStatus == GroupBuyStatus.Success && this.order.ItemStatus == OrderItemStatus.Nomarl); } else if (this.order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.order.FightGroupId); if (fightGroup.Status != FightGroupStatus.FightGroupSuccess) { this.lkbtnSendGoods.Visible = false; } else { this.lkbtnSendGoods.Visible = true; } } else { this.lkbtnSendGoods.Visible = true; } } else { this.lkbtnSendGoods.Visible = false; } this.BindInvoiceInfo(this.order); } } }
protected void listOrders_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { OrderStatus orderStatus = (OrderStatus)DataBinder.Eval(e.Item.DataItem, "OrderStatus"); string text = DataBinder.Eval(e.Item.DataItem, "OrderId").ToString(); OrderInfo orderInfo = TradeHelper.GetOrderInfo(text); if (orderInfo != null) { if (orderInfo.PreSaleId > 0) { Literal literal = (Literal)e.Item.FindControl("litPresale"); literal.Text = "(预售)"; literal.Visible = true; } OrderItemStatus itemStatus = orderInfo.ItemStatus; DateTime dateTime = (DataBinder.Eval(e.Item.DataItem, "FinishDate") == DBNull.Value) ? DateTime.Now.AddYears(-1) : ((DateTime)DataBinder.Eval(e.Item.DataItem, "FinishDate")); string text2 = ""; if (DataBinder.Eval(e.Item.DataItem, "Gateway") != null && !(DataBinder.Eval(e.Item.DataItem, "Gateway") is DBNull)) { text2 = (string)DataBinder.Eval(e.Item.DataItem, "Gateway"); } HyperLink hyperLink = (HyperLink)e.Item.FindControl("hplinkorderreview"); HtmlAnchor htmlAnchor = (HtmlAnchor)e.Item.FindControl("hlinkPay"); ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmOrder"); ImageLinkButton imageLinkButton2 = (ImageLinkButton)e.Item.FindControl("lkbtnCloseOrder"); HtmlAnchor htmlAnchor2 = (HtmlAnchor)e.Item.FindControl("lkbtnApplyForRefund"); HtmlAnchor htmlAnchor3 = (HtmlAnchor)e.Item.FindControl("lkbtnUserRealNameVerify"); HyperLink hyperLink2 = (HyperLink)e.Item.FindControl("hlinkOrderDetails"); Repeater repeater = (Repeater)e.Item.FindControl("rpProduct"); Repeater repeater2 = (Repeater)e.Item.FindControl("rpGift"); Label label = (Label)e.Item.FindControl("Logistics"); HtmlAnchor htmlAnchor4 = (HtmlAnchor)e.Item.FindControl("lkbtnViewMessage"); HtmlAnchor htmlAnchor5 = (HtmlAnchor)e.Item.FindControl("lkbtnRefundDetail"); htmlAnchor2.Attributes.Add("OrderId", text); htmlAnchor2.Attributes.Add("SkuId", ""); htmlAnchor2.Attributes.Add("GateWay", text2); OrderStatusLabel orderStatusLabel = (OrderStatusLabel)e.Item.FindControl("lblOrderStatus"); Literal literal2 = (Literal)e.Item.FindControl("lblGiftTitle"); orderStatusLabel.order = orderInfo; if (orderInfo.LineItems.Count <= 0) { Literal literal3 = literal2; literal3.Text += "(礼)"; } if (hyperLink != null) { if (orderInfo.GetGiftQuantity() > 0 && orderInfo.LineItems.Count() == 0) { hyperLink.Visible = false; } else { HyperLink hyperLink3 = hyperLink; int visible; switch (orderStatus) { case OrderStatus.Closed: visible = ((orderInfo.OnlyReturnedCount == orderInfo.LineItems.Count) ? 1 : 0); break; default: visible = 0; break; case OrderStatus.Finished: visible = 1; break; } hyperLink3.Visible = ((byte)visible != 0); if (hyperLink.Visible) { DataTable productReviewAll = ProductBrowser.GetProductReviewAll(orderInfo.OrderId); LineItemInfo lineItemInfo = new LineItemInfo(); int num = 0; int num2 = 0; int num3 = 0; bool flag = false; foreach (KeyValuePair <string, LineItemInfo> lineItem in orderInfo.LineItems) { flag = false; lineItemInfo = lineItem.Value; for (int i = 0; i < productReviewAll.Rows.Count; i++) { if (lineItemInfo.ProductId.ToString() == productReviewAll.Rows[i][0].ToString() && lineItemInfo.SkuId.ToString().Trim() == productReviewAll.Rows[i][1].ToString().Trim()) { flag = true; } } if (!flag) { num2++; } else { num3++; } } if (num + num2 == orderInfo.LineItems.Count) { hyperLink.Text = "查看评论"; } else { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (masterSettings != null) { if (masterSettings.ProductCommentPoint <= 0) { hyperLink.Text = "评价"; } else { hyperLink.Text = $"评价得{num3 * masterSettings.ProductCommentPoint}积分"; } } } } } } if (orderInfo.PreSaleId > 0) { FormatedMoneyLabel formatedMoneyLabel = (FormatedMoneyLabel)e.Item.FindControl("FormatedMoneyLabel2"); formatedMoneyLabel.Money = orderInfo.Deposit + orderInfo.FinalPayment; formatedMoneyLabel.Text = (orderInfo.Deposit + orderInfo.FinalPayment).F2ToString("f2"); if (orderStatus == OrderStatus.WaitBuyerPay && text2 != "hishop.plugins.payment.podrequest" && text2 != "hishop.plugins.payment.bankrequest" && orderInfo.PaymentTypeId != -3) { if (!orderInfo.DepositDate.HasValue) { htmlAnchor.Visible = true; } else if (orderInfo.DepositDate.HasValue) { ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(orderInfo.PreSaleId); if (productPreSaleInfo.PaymentStartDate <= DateTime.Now && DateTime.Now <= productPreSaleInfo.PaymentEndDate) { htmlAnchor.Visible = true; } else { htmlAnchor.Visible = false; } } else { htmlAnchor.Visible = false; } } else { htmlAnchor.Visible = false; } } else { htmlAnchor.Visible = (orderStatus == OrderStatus.WaitBuyerPay && text2 != "hishop.plugins.payment.podrequest" && text2 != "hishop.plugins.payment.bankrequest" && orderInfo.PaymentTypeId != -3); } imageLinkButton.Visible = (orderStatus == OrderStatus.SellerAlreadySent && itemStatus == OrderItemStatus.Nomarl); if (orderInfo.PreSaleId > 0) { imageLinkButton2.Visible = (orderStatus == OrderStatus.WaitBuyerPay && itemStatus == OrderItemStatus.Nomarl && !orderInfo.DepositDate.HasValue); } else { imageLinkButton2.Visible = (orderStatus == OrderStatus.WaitBuyerPay && itemStatus == OrderItemStatus.Nomarl); } RefundInfo refundInfo = TradeHelper.GetRefundInfo(text); htmlAnchor2.Visible = ((orderInfo.FightGroupId > 0 && VShopHelper.IsFightGroupCanRefund(orderInfo.FightGroupId) && orderInfo.IsCanRefund) || (orderInfo.FightGroupId <= 0 && orderInfo.IsCanRefund)); htmlAnchor3.Visible = (HiContext.Current.SiteSettings.IsOpenCertification && orderInfo.IDStatus == 0 && orderInfo.IsincludeCrossBorderGoods); if (htmlAnchor3.Visible) { htmlAnchor3.Attributes.Add("OrderId", text); } if (repeater != null && repeater2 != null) { repeater.ItemDataBound += this.listProduct_ItemDataBound; IList <NewLineItemInfo> list = new List <NewLineItemInfo>(); foreach (LineItemInfo value in orderInfo.LineItems.Values) { NewLineItemInfo newLineItemInfo = this.GetNewLineItemInfo(value, orderInfo.OrderId); list.Add(newLineItemInfo); } if (list == null || list.Count == 0) { repeater.Visible = false; DataTable dataTable = (DataTable)(repeater2.DataSource = TradeHelper.GetOrderGiftsThumbnailsUrl(((DataRowView)e.Item.DataItem).Row["OrderId"].ToString())); repeater2.DataBind(); repeater2.Visible = true; } else { repeater.DataSource = list; repeater.DataBind(); repeater2.Visible = false; repeater.Visible = true; } } if (refundInfo != null && orderInfo.ItemStatus == OrderItemStatus.Nomarl && (orderInfo.OrderStatus == OrderStatus.ApplyForRefund || orderInfo.OrderStatus == OrderStatus.RefundRefused || orderInfo.OrderStatus == OrderStatus.Closed)) { htmlAnchor5.HRef = "/user/UserRefundApplyDetails/" + refundInfo.RefundId; htmlAnchor5.Visible = true; } hyperLink2.NavigateUrl = "/user/OrderDetails/" + orderInfo.OrderId; if ((orderStatus == OrderStatus.SellerAlreadySent || orderStatus == OrderStatus.Finished) && !string.IsNullOrEmpty(orderInfo.ExpressCompanyAbb) && !string.IsNullOrEmpty(orderInfo.ShipOrderNumber) && orderInfo.ShippingModeId != -2) { label.Attributes.Add("action", "order"); label.Attributes.Add("orderId", text); label.Visible = true; } if (orderInfo.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(orderInfo.FightGroupId); htmlAnchor2.Visible = (fightGroup.Status != 0 && orderInfo.GetPayTotal() > decimal.Zero && (refundInfo == null || refundInfo.HandleStatus == RefundStatus.Refused) && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid); } if (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid || orderInfo.OrderStatus == OrderStatus.Finished || orderInfo.OrderStatus == OrderStatus.WaitReview || orderInfo.OrderStatus == OrderStatus.History) { WeiXinRedEnvelopeInfo openedWeiXinRedEnvelope = WeiXinRedEnvelopeProcessor.GetOpenedWeiXinRedEnvelope(); bool flag2 = false; if (openedWeiXinRedEnvelope != null && openedWeiXinRedEnvelope.EnableIssueMinAmount <= orderInfo.GetPayTotal() && orderInfo.OrderDate >= openedWeiXinRedEnvelope.ActiveStartTime && orderInfo.OrderDate <= openedWeiXinRedEnvelope.ActiveEndTime) { flag2 = true; } if (flag2) { Image image = (Image)e.Item.FindControl("imgRedEnvelope"); image.ImageUrl = "../../../../common/images/SendRedEnvelope.png"; image.Attributes.Add("class", "ztitle_RedEnvelope"); image.Attributes.Add("onclick", "GetRedEnvelope(" + orderInfo.OrderId + ")"); image.Visible = true; } } if (orderInfo.OrderStatus != OrderStatus.WaitBuyerPay || !(orderInfo.ParentOrderId == "-1") || !orderInfo.OrderId.Contains("P")) { Label label2 = (Label)e.Item.FindControl("lblsupplier"); if (label2 != null) { string empty = string.Empty; if (HiContext.Current.SiteSettings.OpenMultStore && orderInfo.StoreId > 0 && !string.IsNullOrWhiteSpace(orderInfo.StoreName)) { label2.Text = orderInfo.StoreName; empty = "mtitle_1"; } else if (orderInfo.StoreId == 0 && HiContext.Current.SiteSettings.OpenSupplier && orderInfo.SupplierId > 0) { label2.Text = orderInfo.ShipperName; empty = "stitle_1"; } else { label2.Text = "平台"; empty = "ztitle_1_new"; } label2.Attributes.Add("style", string.IsNullOrWhiteSpace(label2.Text) ? "display:none" : "display:inline"); label2.Attributes.Add("class", empty); label2.Visible = true; } } } } }
protected void Page_Load(object sender, EventArgs e) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (HiContext.Current.Manager != null) { this.UserStoreId = HiContext.Current.Manager.StoreId; } if (string.IsNullOrEmpty(RouteConfig.GetParameter(this, "OrderId", false))) { base.GotoResourceNotFound(); return; } this.orderId = RouteConfig.GetParameter(this, "OrderId", false); this.btnMondifyPay.Click += this.btnMondifyPay_Click; this.btnMondifyShip.Click += this.btnMondifyShip_Click; this.btnCloseOrder.Click += this.btnCloseOrder_Click; this.btnRemark.Click += this.btnRemark_Click; this.order = OrderHelper.GetOrderInfo(this.orderId); if (this.order == null) { base.Response.Write("<h3 style=\"color:red;\">订单不存在,或者已被删除。</h3>"); base.Response.End(); } else { this.LoadUserControl(this.order); } if (this.Page.IsPostBack) { return; } this.hidOrderId.Value = this.order.OrderId; this.txtOrderId.Value = this.order.OrderId; this.lblOrderStatus.OrderStatusCode = this.order.OrderStatus; this.lblOrderStatus.OrderType = this.order.OrderType; this.lblOrderStatus.OrderItemStatus = this.order.ItemStatus; this.lblOrderStatus.ShipmentModelId = this.order.ShippingModeId; this.lblOrderStatus.IsConfirm = this.order.IsConfirm; this.lblOrderStatus.Gateway = this.order.Gateway; if (this.order.PreSaleId > 0) { this.lblOrderStatus.PreSaleId = this.order.PreSaleId; this.lblOrderStatus.DepositDate = this.order.DepositDate; } this.litOrderId.Text = this.order.PayOrderId; this.litUserName.Text = this.order.Username; this.litRealName.Text = this.order.RealName; this.litUserTel.Text = (this.order.TelPhone ?? ""); string text = string.Empty; if (!string.IsNullOrEmpty(this.order.ShipTo)) { text += this.order.ShipTo; } if (!string.IsNullOrEmpty(this.order.TelPhone)) { text = text + "," + this.order.TelPhone; } if (!string.IsNullOrEmpty(this.order.CellPhone)) { text = text + "," + this.order.CellPhone; } if (!string.IsNullOrEmpty(this.order.ShippingRegion)) { text = text + "," + this.order.ShippingRegion; } if (!string.IsNullOrEmpty(this.order.Address)) { text = text + "," + this.order.Address; } this.lblShipAddress.Text = text.Trim(','); this.litShipToDate.Text = this.order.ShipToDate; this.litRemark.Text = this.order.Remark; if (this.order.OrderStatus == OrderStatus.SellerAlreadySent) { this.lbtnModifyShippingOrder.Visible = true; this.lbtnViewLogistics.Visible = true; } if (this.order.OrderStatus == OrderStatus.WaitBuyerPay || this.order.OrderStatus == OrderStatus.BuyerAlreadyPaid) { if (masterSettings.OpenMultStore && this.order.ShippingModeId == -2) { this.lkBtnEditShippingAddress.Visible = false; } else { this.lkBtnEditShippingAddress.Visible = true; } } else { this.lkBtnEditShippingAddress.Visible = false; } if ((int)this.lblOrderStatus.OrderStatusCode != 4) { this.lbCloseReason.Visible = false; } else { this.lbReason.Text = this.order.CloseReason; } DateTime dateTime; if (this.order.PreSaleId > 0) { if (this.order.DepositDate.HasValue) { Literal litDepositTime = this.LitDepositTime; dateTime = this.order.DepositDate.Value; litDepositTime.Text = "定金时间:" + dateTime.ToString("yyyy-MM-dd HH:mm:ss"); } DateTime payDate = this.order.PayDate; if (this.order.PayDate != DateTime.MinValue) { Literal literal = this.litPayTime; dateTime = this.order.PayDate; literal.Text = "尾款时间:" + dateTime.ToString("yyyy-MM-dd HH:mm:ss"); } } else if (this.order.OrderStatus != OrderStatus.WaitBuyerPay && this.order.OrderStatus != OrderStatus.Closed && this.order.Gateway != "hishop.plugins.payment.podrequest") { Literal literal2 = this.litPayTime; dateTime = this.order.PayDate; literal2.Text = "付款时间:" + dateTime.ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.OrderStatus == OrderStatus.SellerAlreadySent || this.order.OrderStatus == OrderStatus.Finished) { Literal literal3 = this.litSendGoodTime; dateTime = this.order.ShippingDate; literal3.Text = "发货时间:" + dateTime.ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.OrderStatus == OrderStatus.Finished) { Literal literal4 = this.litFinishTime; dateTime = this.order.FinishDate; literal4.Text = "完成时间:" + dateTime.ToString("yyyy-MM-dd HH:mm:ss"); } Literal literal5 = this.litOrderTime; dateTime = this.order.OrderDate; literal5.Text = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); int num; if (this.order.OrderType == OrderType.NormalOrder && (this.order.OrderStatus == OrderStatus.BuyerAlreadyPaid || (this.order.OrderStatus == OrderStatus.WaitBuyerPay && this.order.Gateway == "hishop.plugins.payment.podrequest")) && this.order.ItemStatus == OrderItemStatus.Nomarl) { if (masterSettings.OpenMultStore) { if ((this.order.ShippingModeId != -1 || (this.order.StoreId <= 0 && this.order.StoreId != -1)) && this.order.ShippingModeId != -2) { num = ((this.order.ShippingModeId == 0 && this.order.StoreId > 0 && this.order.CountDownBuyId > 0) ? 1 : 0); goto IL_077f; } num = 1; } else { num = 0; } goto IL_077f; } this.lkbtnSendGoods.Visible = false; goto IL_087d; IL_087d: if (this.order.OrderStatus == OrderStatus.WaitBuyerPay) { if (this.order.PreSaleId > 0) { if (!this.order.DepositDate.HasValue) { this.lbtnClocsOrder.Visible = true; this.lkbtnEditPrice.Visible = true; } else { this.lbtnClocsOrder.Visible = false; this.lkbtnEditPrice.Visible = false; } } else { this.lbtnClocsOrder.Visible = (!this.order.IsConfirm && (this.order.ParentOrderId == "0" || this.order.ParentOrderId == "-1")); this.lkbtnEditPrice.Visible = !(this.order.ParentOrderId != "0"); } } else { this.lbtnClocsOrder.Visible = false; this.lkbtnEditPrice.Visible = false; } this.lkbtnEditPrice.HRef = "javascript:DialogFrame('/Admin/sales/EditOrder.aspx?OrderId=" + this.orderId + "','修改订单价格',null,null,function(e){location.reload();})"; this.BindRemark(this.order); this.ddlpayment.DataBind(); this.ddlpayment.SelectedValue = this.order.PaymentTypeId; if ((this.order.OrderStatus == OrderStatus.WaitBuyerPay || this.order.OrderStatus == OrderStatus.BuyerAlreadyPaid) && this.order.UserAwardRecordsId == 0) { this.hlkOrderGifts.Visible = true; if (this.order.Gifts.Count > 0) { this.hlkOrderGifts.Text = "编辑订单礼品"; } this.hlkOrderGifts.NavigateUrl = "javascript:DialogFrameClose('/Admin/sales/OrderGifts.aspx?OrderId=" + this.order.OrderId + "','编辑订单礼品',null,null);"; } else { this.hlkOrderGifts.Visible = false; } if (this.order.OrderType == OrderType.ServiceOrder) { this.lkbtnSendGoods.Visible = false; this.lkBtnEditShippingAddress.Visible = false; this.hlkOrderGifts.Visible = false; this.lbtnModifyShippingOrder.Visible = false; this.ShipAddressService.Visible = false; this.ShipToDateNoneService.Visible = false; this.litSendGoodTime.Visible = false; DataTable dataTable = OrderHelper.GetOrderInputItem(this.order.OrderId); this.orderInputItem.DataSource = dataTable; this.orderInputItem.DataBind(); if (dataTable != null && dataTable.Rows.Count > 0) { this.orderInputItem.Visible = true; } DataTable verificationItem = OrderHelper.GetVerificationItem(this.order.OrderId); this.orderVerificationItem.DataSource = verificationItem; this.orderVerificationItem.DataBind(); if (verificationItem != null && verificationItem.Rows.Count > 0) { this.orderVerificationItem.Visible = true; } } this.BindInvoiceInfo(this.order); return; IL_077f: if (num != 0) { this.lkbtnSendGoods.Visible = false; } else if (this.order.GroupBuyId > 0 && this.order.SupplierId == 0) { this.lkbtnSendGoods.Visible = (this.order.GroupBuyStatus == GroupBuyStatus.Success && this.order.ItemStatus == OrderItemStatus.Nomarl); } else if (this.order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.order.FightGroupId); if (fightGroup.Status == FightGroupStatus.FightGroupSuccess) { this.lkbtnSendGoods.Visible = true; } else { this.lkbtnSendGoods.Visible = false; } } else if (this.order.SupplierId == 0) { this.lkbtnSendGoods.Visible = true; } goto IL_087d; }
protected override void AttachChildControls() { this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.fightGroupRule = (Common_FightGroupRule)this.FindControl("fightGroupRule"); this.fightGroupId = this.Page.Request["fightGroupId"].ToInt(0); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.litDescription = (Literal)this.FindControl("litDescription"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litJoinNumber = (Literal)this.FindControl("litJoinNumber"); this.litLimitedHour = (Literal)this.FindControl("litLimitedHour"); this.litEndDate = (Literal)this.FindControl("litEndDate"); this.litProductName = (Literal)this.FindControl("litProductName"); this.litFGAPrice = (Literal)this.FindControl("litFGAPrice"); this.litPPrice = (Literal)this.FindControl("litPPrice"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount"); this.imgStatus = (Image)this.FindControl("imgStatus"); this.hlProductReview = (HyperLink)this.FindControl("hlProductReview"); this.rptMemberGroupDetailsStatus = (WapTemplatedRepeater)this.FindControl("rptMemberGroupDetailsStatus"); FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.fightGroupId); if (fightGroup != null) { if (fightGroup.EndTime <= DateTime.Now && fightGroup.Status == FightGroupStatus.FightGroupIn) { VShopHelper.DealFightGroupFail(fightGroup.FightGroupId); fightGroup.Status = FightGroupStatus.FightGroupFail; } FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); this.fightGroupRule.FightGroupActivityId = fightGroup.FightGroupActivityId; FightGroupStatus status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupFail)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_fail.png"; this.imgStatus.Attributes.Add("class", "fg_fail"); } else { status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupSuccess)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_ok.png"; this.imgStatus.Attributes.Add("class", "fg_ok"); } } SiteSettings masterSettings = SettingsManager.GetMasterSettings(); IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(fightGroup.FightGroupActivityId); this.hlProductReview.NavigateUrl = $"/vshop/ProductReview.aspx?ProductId={fightGroup.ProductId}"; Literal literal = this.litJoinNumber; int num = fightGroup.JoinNumber; literal.Text = num.ToString(); Literal literal2 = this.litLimitedHour; num = fightGroupActivitieInfo.LimitedHour; literal2.Text = num.ToString(); this.litEndDate.Text = fightGroup.EndTime.ToString("yy.MM.dd"); this.litProductName.Text = fightGroup.ProductName; this.litFGAPrice.Text = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice).F2ToString("f2"); IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroup.ProductId, out dictionary, out list); if (productDetails != null) { this.litPPrice.Text = productDetails.MaxSalePrice.F2ToString("f2"); this.skuSubmitOrder.ProductInfo = productDetails; } Literal literal3 = this.litProductReviewCount; num = ProductBrowser.GetProductReviews(new ProductReviewQuery { PageIndex = 1, PageSize = 2147483647, ProductId = fightGroup.ProductId }).TotalRecords; literal3.Text = num.ToString(); IList <FightGroupUserModel> fightGroupUsers = VShopHelper.GetFightGroupUsers(fightGroup.FightGroupId); int num2 = fightGroupUsers.Count(); if (fightGroupUsers.Count < fightGroup.JoinNumber) { for (int i = 0; i < fightGroup.JoinNumber - num2; i++) { FightGroupUserModel item2 = new FightGroupUserModel(); fightGroupUsers.Add(item2); } } this.rptMemberGroupDetailsStatus.DataSource = fightGroupUsers; this.rptMemberGroupDetailsStatus.DataBind(); Literal control = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, false); control.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { this.litDescription.Text = regex.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { this.litDescription.Text = regex.Replace(productDetails.Description, ""); } } this.skuSubmitOrder.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId; if (this.rptProductImages != null) { string locationUrl = "javascript:;"; if (string.IsNullOrEmpty(productDetails.ImageUrl1) && string.IsNullOrEmpty(productDetails.ImageUrl2) && string.IsNullOrEmpty(productDetails.ImageUrl3) && string.IsNullOrEmpty(productDetails.ImageUrl4) && string.IsNullOrEmpty(productDetails.ImageUrl5)) { productDetails.ImageUrl1 = masterSettings.DefaultProductImage; } DataTable skus = ProductBrowser.GetSkus(fightGroupActivitieInfo.ProductId); List <SlideImage> list2 = new List <SlideImage>(); foreach (DataRow row in skus.Rows) { List <SlideImage> list3 = (from s in list2 where s.ImageUrl == row["ThumbnailUrl410"].ToString() select s).ToList(); if (list3.Count <= 0) { list2.Add(new SlideImage(row["ThumbnailUrl410"].ToString(), locationUrl)); } } list2.Add(new SlideImage(productDetails.ImageUrl1, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl2, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl3, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl4, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list2 where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); Literal control2 = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, false); control2.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { string text = ""; Regex regex2 = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { text = regex2.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { text = regex2.Replace(productDetails.Description, ""); } text = text.Replace("src", "data-url"); this.litDescription.Text = text; } } DataTable data = ProductBrowser.GetProductConsultations(new ProductConsultationAndReplyQuery { ProductId = productDetails.ProductId, PageIndex = 1, PageSize = 2147483647, SortOrder = SortAction.Desc, SortBy = "ConsultationId", Type = ConsultationReplyType.Replyed }).Data; for (int j = 0; j < data.Rows.Count; j++) { data.Rows[j]["UserName"] = DataHelper.GetHiddenUsername(data.Rows[j]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = data; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = data.IsNullOrEmpty(); } }
private DataGridViewModel <Dictionary <string, object> > GetOrderList(OrderQuery query) { DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >(); DbQueryResult orders = OrderHelper.GetOrders(query); dataGridViewModel.rows = DataHelper.DataTableToDictionary(orders.Data); dataGridViewModel.total = orders.TotalRecords; string[] orderIds = (from d in dataGridViewModel.rows select d["OrderId"].ToString()).ToArray(); List <RefundInfo> refundInfos = TradeHelper.GetRefundInfos(orderIds); foreach (Dictionary <string, object> row in dataGridViewModel.rows) { OrderInfo order = TradeHelper.GetOrderInfo(row["OrderId"].ToString()); row.Add("OrderStatusText", OrderHelper.GetOrderStatusText(order.OrderStatus, order.ShippingModeId, order.IsConfirm, order.Gateway, 0, order.PreSaleId, order.DepositDate, false, order.ItemStatus, OrderType.NormalOrder)); row.Add("CanConfirmOrder", order.CanConfirmOrder()); row.Add("canCheckTake", order.CanConfirmTakeCode()); row.Add("canCloseOrder", order.CanClose(base.CurrentSiteSetting.OpenMultStore, true)); row.Add("canOfflineReceipt", OrderHelper.CanConfirmOfflineReceipt(order, true)); row.Add("canSendGoods", order.CanSendGoods(base.CurrentSiteSetting.OpenMultStore)); row.Add("canFinishTrade", order.OrderStatus == OrderStatus.SellerAlreadySent && order.ItemStatus == OrderItemStatus.Nomarl); row.Add("SupplierOrderTotals", order.OrderCostPrice + order.Freight); if (order.IsStoreCollect) { row.Add("isShowCheckRefund", order.OrderStatus == OrderStatus.ApplyForRefund && order.StoreId == base.CurrentManager.StoreId); } row.Add("InvoiceTypeText", string.IsNullOrEmpty(order.InvoiceTitle) ? "" : EnumDescription.GetEnumDescription((Enum)(object)order.InvoiceType, 0)); bool flag = false; if (order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(order.FightGroupId); if (fightGroup != null) { row.Add("FightGroupActivityId", fightGroup.FightGroupActivityId); if (fightGroup.Status == FightGroupStatus.FightGroupIn && order.OrderStatus != OrderStatus.WaitBuyerPay && order.OrderStatus != OrderStatus.Closed) { flag = true; } } } row.Add("FightGrouping", flag); row.Add("isGiftOrder", order.LineItems.Count <= 0); row["IsError"] = order.IsError; row["ErrorMessage"] = order.ErrorMessage; RefundInfo refundInfo = refundInfos.FirstOrDefault((RefundInfo d) => d.OrderId == order.OrderId); if (refundInfo != null) { row.Add("RefundId", refundInfo.RefundId); } int num = 0; int num2 = 0; bool flag2 = false; string value = "订单中有商品正在进行退货/退款"; AfterSaleTypes?nullable = null; if (order.ItemStatus != 0 || order.OrderStatus == OrderStatus.ApplyForRefund) { if (order.OrderStatus == OrderStatus.ApplyForRefund) { RefundInfo refundInfo2 = TradeHelper.GetRefundInfo(order.OrderId); if (refundInfo2 != null) { flag2 = true; value = "订单已申请退款"; } } else { int num3 = 0; AfterSaleTypes afterSaleTypes = AfterSaleTypes.ReturnAndRefund; int num4 = 0; foreach (LineItemInfo value2 in order.LineItems.Values) { if (value2.ReturnInfo != null || value2.ReplaceInfo != null) { ReturnInfo returnInfo = value2.ReturnInfo; ReplaceInfo replaceInfo = value2.ReplaceInfo; if (num3 == 0 || (returnInfo != null && returnInfo.HandleStatus != ReturnStatus.Refused && returnInfo.HandleStatus != ReturnStatus.Returned) || (replaceInfo != null && (replaceInfo.HandleStatus != ReplaceStatus.Refused || replaceInfo.HandleStatus != ReplaceStatus.Replaced))) { if (value2.ReturnInfo != null) { afterSaleTypes = AfterSaleTypes.ReturnAndRefund; num4 = value2.ReturnInfo.ReturnId; } else { afterSaleTypes = AfterSaleTypes.Replace; num4 = value2.ReplaceInfo.ReplaceId; } } num3++; } } if (order.ItemStatus == OrderItemStatus.HasReturnOrReplace) { value = "订单中有商品正在退货/换货中"; } else if (order.ItemStatus == OrderItemStatus.HasReplace) { value = "订单中有商品正在进行换货"; } else if (order.ItemStatus == OrderItemStatus.HasReturn) { value = "订单中有商品在进行退货/退款操作"; } else if (order.ReturnedCount > 0) { value = "订单中有商品已退货完成"; } if (num3 > 0) { flag2 = true; nullable = afterSaleTypes; if (afterSaleTypes == AfterSaleTypes.ReturnAndRefund) { num = num4; } else { num2 = num4; } } } } row.Add("ReturnId", num); row.Add("ReplaceId", num2); row.Add("AfterSaleType", nullable); row.Add("isShowRefund", flag2); row.Add("RefundStatus", value); } return(dataGridViewModel); }
private void SetOperatorsStatus() { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (this.order.AdjustedDiscount == decimal.Zero) { this.liDiscountPrice.Visible = false; } else { this.litDisCountPrice.SetWhenIsNotNull(this.order.AdjustedDiscount.F2ToString("f2")); } if (this.order.CouponValue > decimal.Zero) { this.litCounponPrice.SetWhenIsNotNull("-" + this.order.CouponValue.F2ToString("f2")); } else { this.liCounponPrice.Visible = false; } int num; if (this.order.DeductionMoney.HasValue) { decimal?deductionMoney = this.order.DeductionMoney; num = ((deductionMoney.GetValueOrDefault() > default(decimal) && deductionMoney.HasValue) ? 1 : 0); } else { num = 0; } if (num != 0) { this.litPointsPrice.Text = this.order.DeductionMoney.Value.F2ToString("f2"); } else { this.liPointPrice.Visible = false; } if (this.order.Tax > decimal.Zero) { this.litTax.SetWhenIsNotNull(this.order.Tax.F2ToString("f2")); } else { this.liTax.Visible = false; } if (!string.IsNullOrEmpty(this.order.InvoiceTitle.Trim())) { this.liInvoiceTitle.Visible = true; this.litInvoiceTitle.SetWhenIsNotNull(this.order.InvoiceTitle); } if (!string.IsNullOrWhiteSpace(this.order.InvoiceTaxpayerNumber)) { this.liInvoiceTaxpayerNumber.Visible = true; this.litInvoiceTaxpayerNumber.SetWhenIsNotNull(this.order.InvoiceTaxpayerNumber); } if (this.order.RefundAmount > decimal.Zero) { this.divRefund.Visible = true; this.litRefundMoney.Text = this.order.RefundAmount.F2ToString("f2"); int sumRefundPoint = TradeHelper.GetSumRefundPoint(this.order.OrderId); if (sumRefundPoint > 0) { this.divRefundPoint.Visible = true; this.litRefundPoint.Text = sumRefundPoint.ToString(); } else { this.divRefundPoint.Visible = false; } } else { this.divRefund.Visible = false; this.divRefundPoint.Visible = false; } if (this.order.OrderStatus == OrderStatus.Closed) { this.dvClose.Visible = true; this.litCloseReason.SetWhenIsNotNull(this.order.CloseReason); } else { this.dvClose.Visible = false; } if (this.btnOrderClose != null && this.order.OrderStatus == OrderStatus.WaitBuyerPay) { this.btnOrderClose.Visible = true; } if (this.btnOrderRefund != null) { this.btnOrderRefund.HRef = "ApplyRefund.aspx?OrderId=" + this.order.OrderId; this.btnOrderRefund.Visible = (this.order.OrderStatus == OrderStatus.BuyerAlreadyPaid && this.order.ItemStatus == OrderItemStatus.Nomarl && this.order.LineItems.Count != 0); if (this.btnOrderRefund.Visible && this.order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.order.FightGroupId); if (fightGroup != null) { this.btnOrderRefund.Visible = (fightGroup.Status != FightGroupStatus.FightGroupIn); } } if (this.order.OrderType == OrderType.ServiceOrder && this.btnOrderRefund.Visible) { LineItemInfo value = this.order.LineItems.FirstOrDefault().Value; if (value.IsRefund) { if (value.IsOverRefund) { this.btnOrderRefund.Visible = true; } else if (value.IsValid) { this.btnOrderRefund.Visible = true; } else if (DateTime.Now >= value.ValidStartDate.Value && DateTime.Now <= value.ValidEndDate.Value) { this.btnOrderRefund.Visible = true; } else { this.btnOrderRefund.Visible = false; } } else { this.btnOrderRefund.Visible = false; } } } if (!string.IsNullOrEmpty(masterSettings.HiPOSAppId) && !string.IsNullOrEmpty(this.order.TakeCode)) { this.lookupQRCode.HRef = "ViewQRCode.aspx?orderId=" + this.order.OrderId; } }
protected override void OnInit(EventArgs e) { if (this.SkinName == null) { this.SkinName = "Skin-ServiceProductSubmitOrder.html"; } base.OnInit(e); string urlToEncode = ""; this.from = this.Page.Request.QueryString["from"].ToNullString().ToLower(); this.productSku = Globals.UrlDecode(this.Page.Request.QueryString["productSku"].ToNullString()); this.buyAmount = this.Page.Request.QueryString["buyAmount"].ToInt(0); this.storeId = this.Page.Request.QueryString["StoreId"].ToInt(0); this.chooseStoreId = this.Page.Request.QueryString["ChooseStoreId"].ToInt(0); if (this.from == "groupbuy") { this.isGroupBuy = true; } else if (this.from == "countdown") { this.isCountDown = true; } else if (this.from == "fightgroup") { this.isFightGroup = true; } else { if (this.from == "presale") { this.PresaleId = this.Page.Request.QueryString["PresaleId"].ToInt(0); this.productSku = DataHelper.CleanSearchString(this.productSku); if (this.CheckPresaleInfo()) { this.isPreSale = true; goto IL_01cd; } return; } this.from = "serviceproduct"; } goto IL_01cd; IL_01cd: if (this.storeId == 0 && !HiContext.Current.SiteSettings.OpenMultStore) { this.cart = ShoppingCartProcessor.GetShoppingCart(this.from, this.productSku, this.buyAmount, 0, true, -1, this.Page.Request["fightGroupActivityId"].ToInt(0)); } else { this.cart = ShoppingCartProcessor.GetShoppingCart(this.from, this.productSku, this.buyAmount, 0, true, this.storeId, this.Page.Request["fightGroupActivityId"].ToInt(0)); } if (this.cart == null) { string msg = "购物车无任何商品!"; this.hasError = true; this.ShowWapMessage(msg, "default.aspx"); } else { if (this.isGroupBuy) { this.groupbuyInfo = TradeHelper.GetProductGroupBuyInfo(this.cart.LineItems[0].ProductId, this.buyAmount, out urlToEncode); if (this.groupbuyInfo == null) { this.hasError = true; this.ShowWapMessage(Globals.UrlEncode(urlToEncode), "default.aspx"); return; } } if (this.isCountDown) { this.countdownInfo = TradeHelper.ProductExistsCountDown(this.cart.LineItems[0].ProductId, "", this.storeId); if (this.countdownInfo == null) { this.hasError = true; this.ShowWapMessage("该商品未进行抢购活动,或者活动已结束", "Default.aspx"); return; } if (!StoreActivityHelper.JoinActivity(this.countdownInfo.CountDownId, 2, this.storeId, this.countdownInfo.StoreType)) { this.hasError = true; this.ShowWapMessage("该门店未参与此抢购活动", "Default.aspx"); return; } this.countdownInfo = TradeHelper.CheckUserCountDown(this.cart.LineItems[0].ProductId, this.countdownInfo.CountDownId, this.cart.LineItems[0].SkuId, HiContext.Current.UserId, this.buyAmount, "", out urlToEncode, this.storeId); if (this.countdownInfo == null) { this.ShowWapMessage(Globals.UrlEncode(urlToEncode), "Default.aspx"); return; } } if (this.isFightGroup) { this.fightGroupActivitiyInfo = TradeHelper.GetFightGroupActivitieInfo(this.Page.Request["fightGroupActivityId"].ToInt(0)); if (this.fightGroupActivitiyInfo == null) { this.hasError = true; this.ShowWapMessage("拼团活动不存在", "Default.aspx"); } else { int num = this.Page.Request["fightGroupId"].ToInt(0); this.fightGroupInfo = VShopHelper.GetFightGroup(num); if (this.fightGroupInfo == null && num != 0) { this.hasError = true; this.ShowWapMessage("拼团活动不存在", "Default.aspx"); } } } } }
private void dlstOrders_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); string text = ""; if (!(DataBinder.Eval(e.Item.DataItem, "Gateway") is DBNull)) { text = (string)DataBinder.Eval(e.Item.DataItem, "Gateway"); } string orderId = DataBinder.Eval(e.Item.DataItem, "OrderId").ToString(); OrderInfo orderInfo = TradeHelper.GetOrderInfo(orderId); OrderStatus orderStatus = (OrderStatus)DataBinder.Eval(e.Item.DataItem, "OrderStatus"); int num = DataBinder.Eval(e.Item.DataItem, "ShippingModeId").ToInt(0); int num2 = (int)((DataBinder.Eval(e.Item.DataItem, "GroupBuyId") is DBNull) ? ((object)0) : DataBinder.Eval(e.Item.DataItem, "GroupBuyId")); int num3 = (int)((DataBinder.Eval(e.Item.DataItem, "CountDownBuyId") is DBNull) ? ((object)0) : DataBinder.Eval(e.Item.DataItem, "CountDownBuyId")); int num4 = (int)((DataBinder.Eval(e.Item.DataItem, "BundlingId") is DBNull) ? ((object)0) : DataBinder.Eval(e.Item.DataItem, "BundlingId")); int num5 = DataBinder.Eval(e.Item.DataItem, "ShippingModeId").ToInt(0); Label label = (Label)e.Item.FindControl("lkbtnSendGoods"); Literal literal = (Literal)e.Item.FindControl("isGiftOrder"); LinkButton linkButton = (LinkButton)e.Item.FindControl("lbtnFightGroup"); Image image = (Image)e.Item.FindControl("imgError"); HtmlInputHidden htmlInputHidden = (HtmlInputHidden)e.Item.FindControl("hidFightGroup"); HtmlAnchor htmlAnchor = (HtmlAnchor)e.Item.FindControl("aftersaleImg"); image.Visible = orderInfo.IsError; if (orderInfo.IsError) { image.Attributes.Add("title", orderInfo.ErrorMessage); image.ImageUrl = "\\Supplier\\images\\orderError.png"; } if (orderInfo.ItemStatus != 0 || orderInfo.OrderStatus == OrderStatus.ApplyForRefund) { if (orderInfo.OrderStatus == OrderStatus.ApplyForRefund) { RefundInfo refundInfo = TradeHelper.GetRefundInfo(orderInfo.OrderId); if (refundInfo != null) { htmlAnchor.Visible = true; htmlAnchor.Title = "订单已申请退款"; } } else { int num6 = 0; AfterSaleTypes afterSaleTypes = AfterSaleTypes.ReturnAndRefund; int num7 = 0; foreach (LineItemInfo value in orderInfo.LineItems.Values) { if (value.ReturnInfo != null || value.ReplaceInfo != null) { ReturnInfo returnInfo = value.ReturnInfo; ReplaceInfo replaceInfo = value.ReplaceInfo; if (num6 == 0 || (returnInfo != null && returnInfo.HandleStatus != ReturnStatus.Refused && returnInfo.HandleStatus != ReturnStatus.Returned) || (replaceInfo != null && (replaceInfo.HandleStatus != ReplaceStatus.Refused || replaceInfo.HandleStatus != ReplaceStatus.Replaced))) { if (value.ReturnInfo != null) { afterSaleTypes = AfterSaleTypes.ReturnAndRefund; num7 = value.ReturnInfo.ReturnId; } else { afterSaleTypes = AfterSaleTypes.Replace; num7 = value.ReplaceInfo.ReplaceId; } } num6++; } } if (orderInfo.ItemStatus == OrderItemStatus.HasReturnOrReplace) { htmlAnchor.Title = "订单中有商品正在退货/换货中"; } else if (orderInfo.ItemStatus == OrderItemStatus.HasReplace) { htmlAnchor.Title = "订单中有商品正在进行换货"; } else if (orderInfo.ItemStatus == OrderItemStatus.HasReturn) { htmlAnchor.Title = "订单中有商品在进行退货/退款操作"; } else if (orderInfo.ReturnedCount > 0) { htmlAnchor.Title = "订单中有商品已退货完成"; } if (num6 > 0) { htmlAnchor.Visible = true; if (afterSaleTypes == AfterSaleTypes.ReturnAndRefund) { htmlAnchor.HRef = "ReturnApplyDetail?ReturnId=" + num7; } else { htmlAnchor.HRef = "ReplaceApplyDetail?ReplaceId=" + num7; } } } } if (orderInfo.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(orderInfo.FightGroupId); if (fightGroup != null) { linkButton.PostBackUrl = "/Supplier/vshop/FightGroupDetails.aspx?fightGroupActivityId=" + fightGroup.FightGroupActivityId; if (fightGroup.Status == FightGroupStatus.FightGroupIn && orderInfo.OrderStatus != OrderStatus.WaitBuyerPay && orderInfo.OrderStatus != OrderStatus.Closed) { htmlInputHidden.Value = "1"; } else { htmlInputHidden.Value = "0"; } } } else { linkButton.Visible = false; } OrderStatusLabel orderStatusLabel = (OrderStatusLabel)e.Item.FindControl("lblOrderStatus"); if (orderStatusLabel != null) { orderStatusLabel.OrderItemStatus = orderInfo.ItemStatus; if (orderInfo.PreSaleId > 0) { orderStatusLabel.PreSaleId = orderInfo.PreSaleId; orderStatusLabel.DepositDate = orderInfo.DepositDate; } } HtmlAnchor htmlAnchor2 = (HtmlAnchor)e.Item.FindControl("lkbtnToDetail"); int num8 = (int)((DataBinder.Eval(e.Item.DataItem, "StoreId") == DBNull.Value) ? ((object)0) : DataBinder.Eval(e.Item.DataItem, "StoreId")); bool flag = (bool)((DataBinder.Eval(e.Item.DataItem, "IsStoreCollect") == DBNull.Value) ? ((object)false) : DataBinder.Eval(e.Item.DataItem, "IsStoreCollect")); if (orderInfo.LineItems.Count <= 0) { literal.Text = "(礼)"; } Literal literal2 = (Literal)e.Item.FindControl("group"); if (literal2 != null) { if (num2 > 0) { literal2.Text = "(团)"; } if (num3 > 0) { literal2.Text = "(抢)"; } if (orderInfo.PreSaleId > 0) { literal2.Text = "(预)"; } } if (num2 > 0) { string[] source = new string[1] { "hishop.plugins.payment.podrequest" }; GroupBuyStatus groupBuyStatus = (GroupBuyStatus)DataBinder.Eval(e.Item.DataItem, "GroupBuyStatus"); Label label2 = label; int visible; if (orderInfo.ItemStatus == OrderItemStatus.Nomarl) { switch (orderStatus) { case OrderStatus.WaitBuyerPay: if (source.Contains(text)) { goto case OrderStatus.BuyerAlreadyPaid; } goto default; case OrderStatus.BuyerAlreadyPaid: visible = ((groupBuyStatus == GroupBuyStatus.Success) ? 1 : 0); break; default: visible = 0; break; } } else { visible = 0; } label2.Visible = ((byte)visible != 0); } else if (num3 > 0 || num4 > 0) { Label label3 = label; int visible2; if (orderInfo.ItemStatus == OrderItemStatus.Nomarl) { switch (orderStatus) { case OrderStatus.WaitBuyerPay: visible2 = ((text == "hishop.plugins.payment.podrequest") ? 1 : 0); break; default: visible2 = 0; break; case OrderStatus.BuyerAlreadyPaid: visible2 = 1; break; } } else { visible2 = 0; } label3.Visible = ((byte)visible2 != 0); } else if (masterSettings.OpenMultStore) { Label label4 = label; int visible3; switch (orderStatus) { case OrderStatus.WaitBuyerPay: if (text == "hishop.plugins.payment.podrequest") { goto case OrderStatus.BuyerAlreadyPaid; } goto default; case OrderStatus.BuyerAlreadyPaid: if (num5 != -2) { visible3 = ((orderInfo.ItemStatus == OrderItemStatus.Nomarl) ? 1 : 0); break; } goto default; default: visible3 = 0; break; } label4.Visible = ((byte)visible3 != 0); } else { Label label5 = label; int visible4; switch (orderStatus) { case OrderStatus.WaitBuyerPay: if (text == "hishop.plugins.payment.podrequest") { goto case OrderStatus.BuyerAlreadyPaid; } goto default; case OrderStatus.BuyerAlreadyPaid: visible4 = ((orderInfo.ItemStatus == OrderItemStatus.Nomarl) ? 1 : 0); break; default: visible4 = 0; break; } label5.Visible = ((byte)visible4 != 0); } } }