protected override void OnLoad(EventArgs e)
 {
     base.ItemDataBound += this.Common_ProductCategoryList_ItemDataBound;
     if (this.IsShowSubCategory)
     {
         this.categoryId = RouteConfig.GetParameter(this.Page, "categoryId", false).ToInt(0);
     }
     this.BindList();
 }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         string parameter = RouteConfig.GetParameter(this, "UserId", false);
         Hidistro.Entities.Members.ReferralInfo referral = MemberHelper.GetReferral(parameter.ToInt(0));
         string referralExtShowInfo = MemberProcessor.GetReferralExtShowInfo(referral.RequetReason);
         this.litRefferralInfo.Text = (string.IsNullOrEmpty(referralExtShowInfo) ? "该分销员没有提交任何信息" : referralExtShowInfo);
     }
 }
Пример #3
0
        protected override void Render(HtmlTextWriter writer)
        {
            if (string.IsNullOrEmpty(base.Text))
            {
                base.Text = "我要咨询";
            }
            int num  = RouteConfig.GetParameter(this.Page, "countDownId", false).ToInt(0);
            int num2 = RouteConfig.GetParameter(this.Page, "groupBuyId", false).ToInt(0);
            int num3 = RouteConfig.GetParameter(this.Page, "PreSaleId", false).ToInt(0);

            if (num > 0)
            {
                CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(num, 0);
                if (countDownInfo != null)
                {
                    base.NavigateUrl = base.GetRouteUrl("ProductConsultations", new
                    {
                        countDownInfo.ProductId
                    });
                }
            }
            else if (num2 > 0)
            {
                GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(num2);
                if (groupBuy != null)
                {
                    base.NavigateUrl = base.GetRouteUrl("ProductConsultations", new
                    {
                        groupBuy.ProductId
                    });
                }
            }
            else if (num3 > 0)
            {
                ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(num3);
                if (productPreSaleInfo != null)
                {
                    base.NavigateUrl = base.GetRouteUrl("ProductConsultations", new
                    {
                        productPreSaleInfo.ProductId
                    });
                }
            }
            else
            {
                base.NavigateUrl = base.GetRouteUrl("ProductConsultations", new
                {
                    ProductId = RouteConfig.GetParameter(this.Page, "productId", false)
                });
            }
            base.Render(writer);
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int productId = 0;

            int.TryParse(RouteConfig.GetParameter(this, "ProductId", false), out productId);
            if (!this.Page.IsPostBack)
            {
                ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(productId);
                if (productSimpleInfo != null)
                {
                    this.BindImages(productSimpleInfo);
                    if (!string.IsNullOrEmpty(productSimpleInfo.Title))
                    {
                        PageTitle.AddSiteNameTitle(productSimpleInfo.Title + " 相册");
                    }
                    else
                    {
                        PageTitle.AddSiteNameTitle(productSimpleInfo.ProductName + " 相册");
                    }
                }
            }
        }
Пример #5
0
		protected override void AttachChildControls()
		{
			this.rp_productsales = (Repeater)this.FindControl("rp_productsales");
			if (RouteConfig.GetParameter(this.Page, "productId", false).ToInt(0) > 0)
			{
				this.ProductId = RouteConfig.GetParameter(this.Page, "productId", false).ToInt(0);
			}
			DataTable lineItems = ProductBrowser.GetLineItems(this.ProductId, this.maxNum);
			foreach (DataRow row in lineItems.Rows)
			{
				string text = (string)row["Username"];
				if (text.ToLower() == "anonymous")
				{
					row["Username"] = "******";
				}
				else
				{
					row["Username"] = text.Substring(0, 1) + "**" + text.Substring(text.Length - 1);
				}
			}
			this.rp_productsales.DataSource = lineItems;
			this.rp_productsales.DataBind();
		}
Пример #6
0
        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;
        }
Пример #7
0
        private void DoValidate()
        {
            NameValueCollection nameValueCollection = new NameValueCollection
            {
                this.Page.Request.Form,
                this.Page.Request.QueryString
            };

            if (!this.isBackRequest)
            {
                nameValueCollection.Add("IsReturn", "true");
            }
            this.Gateway = RouteConfig.GetParameter(this.Page, "HIGW", false);
            this.Gateway = this.Gateway.Replace("_", ".");
            this.Gateway = this.Gateway.Replace("ws.wappay", "ws_wappay");
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
            if (this.Notify == null)
            {
                this.ResponseStatus(false, "verifyfaild");
                Globals.AppendLog(nameValueCollection, "获取支付通知信息失败", this.Page.Request.Url.ToString(), "", "WapInpourPage");
            }
            else
            {
                if (this.isBackRequest)
                {
                    string hIGW = this.Gateway.Replace(".", "_");
                    this.Notify.ReturnUrl = Globals.FullPath(base.GetRouteUrl("WapInpourNotify", new
                    {
                        HIGW = hIGW
                    })) + "?" + this.Page.Request.Url.Query;
                }
                this.InpourId      = this.Notify.GetOrderId();
                this.Amount        = this.Notify.GetOrderAmount();
                this.InpourRequest = MemberProcessor.GetInpourBlance(this.InpourId);
                if (this.InpourRequest == null)
                {
                    if (this.isBackRequest)
                    {
                        Globals.AppendLog(nameValueCollection, "未找到相应的充值记录...Amount:" + this.Notify.GetOrderAmount(), this.Page.Request.Url.ToString(), "", "WapInpourPage");
                        this.ResponseStatus(true, "fail");
                    }
                    else
                    {
                        BalanceDetailInfo balanceDetailInfoOfInpurId = MemberProcessor.GetBalanceDetailInfoOfInpurId(this.InpourId);
                        if (balanceDetailInfoOfInpurId == null)
                        {
                            Globals.AppendLog(nameValueCollection, "未找到相应的明细记录...InpourId:" + this.InpourId, this.Page.Request.Url.ToString(), "", "WapInpourPage");
                            this.ResponseStatus(true, "fail");
                        }
                        else
                        {
                            if (balanceDetailInfoOfInpurId.Income.HasValue)
                            {
                                this.Amount = balanceDetailInfoOfInpurId.Income.Value.ToDecimal(0);
                            }
                            else
                            {
                                this.Amount = default(decimal);
                            }
                            this.ResponseStatus(true, "success");
                        }
                    }
                }
                else
                {
                    if (this.InpourRequest != null)
                    {
                        this.Amount = this.InpourRequest.InpourBlance;
                    }
                    this.paymode = TradeHelper.GetPaymentMode(this.Gateway);
                    if (this.paymode == null)
                    {
                        Globals.AppendLog(nameValueCollection, "未获取到支付方式信息", this.Page.Request.Url.ToString(), "", "WapInpourPage");
                        this.ResponseStatus(true, "gatewaynotfound");
                    }
                    else
                    {
                        this.Notify.Finished          += this.Notify_Finished;
                        this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
                        this.Notify.Payment           += this.Notify_Payment;
                        this.Notify.VerifyNotify(30000, HiCryptographer.Decrypt(this.paymode.Settings));
                    }
                }
            }
        }
Пример #8
0
        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);
                }
            }
        }
Пример #9
0
 protected string GetParameter(string name, bool getCookie = false)
 {
     return(RouteConfig.GetParameter(this.Page, name, false));
 }
Пример #10
0
        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.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)
                {
                    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.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.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 = "<span>定金时间:</span>" + 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 = "<span>尾款时间:</span>" + 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 = "<span>付款时间:</span>" + 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 = "<span>发货时间:</span>" + dateTime.ToString("yyyy-MM-dd HH:mm:ss");
                    }
                    if (this.order.OrderStatus == OrderStatus.Finished)
                    {
                        Literal literal4 = this.litFinishTime;
                        dateTime      = this.order.FinishDate;
                        literal4.Text = "<span>完成时间:</span>" + 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.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 = true;
                        }
                    }
                    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.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;
                    }
                    this.BindInvoiceInfo(this.order);
                }
            }
        }
Пример #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string parameter = RouteConfig.GetParameter(this, "orderId", false);

            this.order = TradeHelper.GetOrderInfo(parameter);
            this.ChoiceBankDIV.Visible = false;
            if (this.order == null)
            {
                this.RedirectToPayDIV.InnerHtml = "您要付款的订单已经不存在,请联系管理员确定";
            }
            else if (this.order.OrderStatus != OrderStatus.WaitBuyerPay)
            {
                this.RedirectToPayDIV.InnerHtml = "订单当前状态不能支付";
            }
            else
            {
                if (this.order.CountDownBuyId > 0)
                {
                    string empty = string.Empty;
                    foreach (KeyValuePair <string, LineItemInfo> lineItem in this.order.LineItems)
                    {
                        CountDownInfo countDownInfo = TradeHelper.CheckUserCountDown(lineItem.Value.ProductId, this.order.CountDownBuyId, lineItem.Value.SkuId, HiContext.Current.UserId, this.order.GetAllQuantity(true), this.order.OrderId, out empty, this.order.StoreId);
                        if (countDownInfo == null)
                        {
                            this.RedirectToPayDIV.InnerHtml = empty;
                            return;
                        }
                    }
                }
                this.paymode = TradeHelper.GetPaymentMode(this.order.PaymentTypeId);
                if (this.paymode == null)
                {
                    this.RedirectToPayDIV.InnerHtml = "您之前选择的支付方式已经不存在,请联系管理员修改支付方式";
                }
                else
                {
                    Dictionary <string, LineItemInfo> lineItems = this.order.LineItems;
                    foreach (LineItemInfo value in lineItems.Values)
                    {
                        int          productId         = value.ProductId;
                        SiteSettings masterSettings    = SettingsManager.GetMasterSettings();
                        ProductInfo  productSimpleInfo = ProductBrowser.GetProductSimpleInfo(productId);
                        if (productSimpleInfo == null || productSimpleInfo.SaleStatus == ProductSaleStatus.Delete)
                        {
                            base.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("订单内商品已经被管理员删除"));
                            return;
                        }
                        if (productSimpleInfo.SaleStatus == ProductSaleStatus.OnStock)
                        {
                            base.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("订单内商品已入库"));
                            return;
                        }
                        if (!productSimpleInfo.Skus.ContainsKey(value.SkuId))
                        {
                            base.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("订单中有商品规格不存在"));
                            return;
                        }
                    }
                    string str = "";
                    if (this.order == null || !TradeHelper.CheckOrderStockBeforePay(this.order, out str))
                    {
                        base.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlDecode(str + ",库存不足,不能进行支付"));
                    }
                    else if (!this.Page.IsPostBack)
                    {
                        string showUrl = "/user/UserOrders";
                        if (this.paymode.Gateway.ToLower() != "hishop.plugins.payment.podrequest")
                        {
                            showUrl = ((!(this.order.ParentOrderId == "-1")) ? base.Server.UrlEncode($"http://{base.Request.Url.Host}/user/OrderDetails.aspx?OrderId={this.order.OrderId}") : base.Server.UrlEncode($"http://{base.Request.Url.Host}/user/UserOrders.aspx?ParentOrderId={this.order.OrderId}"));
                        }
                        if (string.Compare(this.paymode.Gateway, "Hishop.Plugins.Payment.BankRequest", true) == 0)
                        {
                            base.Response.Redirect(Globals.FullPath(base.GetRouteUrl("bank_pay", new
                            {
                                orderId = this.order.OrderId
                            })));
                        }
                        if (string.Compare(this.paymode.Gateway, "Hishop.Plugins.Payment.AdvanceRequest", true) == 0)
                        {
                            base.Response.Redirect(Globals.FullPath(base.GetRouteUrl("advance_pay", new
                            {
                                orderId = this.order.OrderId
                            })));
                        }
                        string     attach     = "";
                        HttpCookie httpCookie = HiContext.Current.Context.Request.Cookies["Token_" + HiContext.Current.UserId.ToString()];
                        if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
                        {
                            attach = httpCookie.Value;
                        }
                        if (this.paymode.Gateway.ToLower() == "hishop.plugins.payment.alipay_bank.bankrequest")
                        {
                            this.RedirectToPayDIV.Visible = false;
                            this.ChoiceBankDIV.Visible    = true;
                        }
                        else
                        {
                            parameter += this.order.PayRandCode;
                            try
                            {
                                string         hIGW           = this.paymode.Gateway.Replace(".", "_");
                                PaymentRequest paymentRequest = PaymentRequest.CreateInstance(this.paymode.Gateway, HiCryptographer.Decrypt(this.paymode.Settings), parameter, this.GetPayMoney(this.order), "订单支付", "订单号-" + this.order.OrderId, this.order.EmailAddress, this.order.OrderDate, showUrl, Globals.FullPath(base.GetRouteUrl("PaymentReturn_url", new
                                {
                                    HIGW = hIGW
                                })), Globals.FullPath(base.GetRouteUrl("PaymentNotify_url", new
                                {
                                    HIGW = hIGW
                                })), attach);
                                paymentRequest.SendRequest();
                            }
                            catch (Exception ex)
                            {
                                if (!(ex is ThreadAbortException))
                                {
                                    base.Response.Write("<h2>支付配置错误,请联系管理员.(" + ex.Message + ")<h2>");
                                }
                            }
                        }
                    }
                }
            }
        }