示例#1
0
        protected override void AttachChildControls()
        {
            this.litSupplierName  = (Literal)this.FindControl("litSupplierName");
            this.litSupplierAbout = (Literal)this.FindControl("litSupplierAbout");
            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    = HiContext.Current.SiteSettings.WeixinAppId;
            int        storeId   = base.GetParameter("StoreId").ToInt(0);
            StoresInfo storeById = DepotHelper.GetStoreById(storeId);

            if (storeById == null)
            {
                base.GotoResourceNotFound("");
            }
            else
            {
                this.hdTitle.Value = storeById.StoreName;
                this.hdDesc.Value  = storeById.StoreName;
                string storeImages = storeById.StoreImages;
                string local       = string.IsNullOrEmpty(storeImages) ? SettingsManager.GetMasterSettings().LogoUrl : storeImages;
                this.hdImgUrl.Value = Globals.FullPath(local);
                this.hdLink.Value   = Globals.FullPath(this.Page.Request.Url.ToString());
                this.litSupplierName.SetWhenIsNotNull(storeById.StoreName);
                this.litSupplierAbout.SetWhenIsNotNull(storeById.Introduce);
            }
        }
 private void OfflinePayOder()
 {
     if (this.offlineOrder != null && this.offlineOrder.Status == 0)
     {
         if (this.offlineOrder.Status == 1)
         {
             if (this.isOfflineOrder)
             {
                 base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}</p>", this.OrderId, this.Amount.ToString("F")));
             }
         }
         else
         {
             this.offlineOrder.Status  = 1;
             this.offlineOrder.PayTime = DateTime.Now;
             if (StoresHelper.UpdateStoreCollectionInfo(this.offlineOrder) && this.isOfflineOrder)
             {
                 string     text      = "";
                 StoresInfo storeById = DepotHelper.GetStoreById(this.offlineOrder.StoreId);
                 if (storeById != null)
                 {
                     text = storeById.StoreName;
                 }
                 if (storeById != null)
                 {
                     VShopHelper.AppPsuhRecordForStore(storeById.StoreId, this.offlineOrder.OrderId, "", EnumPushStoreAction.StoreOrderPayed);
                 }
                 base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}</p>", this.OrderId, this.Amount.ToString("F")));
             }
         }
     }
 }
示例#3
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("查看提货码");
            this.hfTakeCode = (HtmlInputHidden)this.FindControl("hfTakeCode");
            string    orderId   = this.Page.Request.QueryString["orderId"].ToNullString();
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(orderId);

            if (orderInfo != null && orderInfo.UserId == HiContext.Current.UserId)
            {
                HtmlImage    htmlImage    = this.FindControl("imgProduct") as HtmlImage;
                Literal      control      = this.FindControl("litItemCount") as Literal;
                Literal      control2     = this.FindControl("litStoreName") as Literal;
                Literal      control3     = this.FindControl("litStoreAddress") as Literal;
                Literal      control4     = this.FindControl("litTel") as Literal;
                LineItemInfo lineItemInfo = orderInfo.LineItems.Values.FirstOrDefault();
                Literal      control5     = this.FindControl("litTakeCode") as Literal;
                htmlImage.Src = (string.IsNullOrEmpty(lineItemInfo.ThumbnailsUrl) ? SettingsManager.GetMasterSettings().DefaultProductImage : lineItemInfo.ThumbnailsUrl);
                control.SetWhenIsNotNull(orderInfo.LineItems.Count.ToString());
                control5.SetWhenIsNotNull(orderInfo.TakeCode);
                this.hfTakeCode.SetWhenIsNotNull(Globals.HIPOSTAKECODEPREFIX + orderInfo.TakeCode);
                StoresInfo storeById = DepotHelper.GetStoreById(orderInfo.StoreId);
                if (storeById != null)
                {
                    control2.SetWhenIsNotNull(storeById.StoreName);
                    control4.SetWhenIsNotNull(storeById.Tel);
                    control3.SetWhenIsNotNull(RegionHelper.GetFullRegion(storeById.RegionId, " ", true, 0) + " " + storeById.Address);
                }
            }
        }
        private void dataSupplier_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }
            Repeater repeater = e.Item.FindControl("rptOrderProducts") as Repeater;

            repeater.ItemDataBound += this.rptOrderProducts_ItemDataBound;
            Label label  = e.Item.FindControl("lblSupplierAmount") as Label;
            Label label2 = e.Item.FindControl("lblFreight") as Label;
            Label label3 = e.Item.FindControl("lblSupplierName") as Label;
            HtmlGenericControl htmlGenericControl  = (HtmlGenericControl)e.Item.FindControl("divSupplier");
            HtmlGenericControl htmlGenericControl2 = (HtmlGenericControl)e.Item.FindControl("divFreightAndAmount");

            if (repeater != null)
            {
                int supplierId = 0;
                int.TryParse(DataBinder.Eval(e.Item.DataItem, "SupplierId").ToString(), out supplierId);
                label3.Text = DataBinder.Eval(e.Item.DataItem, "SupplierName").ToString();
                List <ShoppingCartItemInfo> list = (from i in this.ShoppingCart.LineItems
                                                    where i.SupplierId == supplierId
                                                    select i).ToList();
                decimal num = (from i in this.ShoppingCart.LineItems
                               where i.SupplierId == supplierId
                               select i.AdjustedPrice.F2ToString("f2").ToDecimal(0) * (decimal)i.Quantity).Sum();
                repeater.DataSource = list;
                repeater.DataBind();
                label.Text = "¥" + num.F2ToString("f2");
                decimal num2 = ShoppingProcessor.CalcSupplierFreight(supplierId, this.RegionId, this.ShoppingCart);
                label2.Text = "¥" + num2.F2ToString("f2") + ((supplierId == 0 && this.ShoppingCart.LineGifts.Count() > 0) ? "(含礼品)" : "");
                if (!HiContext.Current.SiteSettings.OpenSupplier)
                {
                    htmlGenericControl2.Visible = false;
                }
                if (HiContext.Current.SiteSettings.OpenMultStore && this.StoreId > 0)
                {
                    StoresInfo storeById = DepotHelper.GetStoreById(this.StoreId);
                    if (storeById != null)
                    {
                        label3.Text = storeById.StoreName;
                        htmlGenericControl.Attributes["class"] = "mtitle";
                    }
                }
                else if (HiContext.Current.SiteSettings.OpenSupplier && supplierId > 0 && list.Count > 0)
                {
                    label3.Text = list[0].SupplierName;
                    htmlGenericControl.Attributes["class"] = "stitle";
                }
                else
                {
                    label3.Text = "平台";
                    htmlGenericControl.Attributes["class"] = "ztitle";
                }
            }
            if (HiContext.Current.SiteSettings.OpenMultStore && this.StoreId > 0)
            {
                htmlGenericControl2.Visible = false;
            }
        }
示例#5
0
        public void ExportExcel(HttpContext context)
        {
            StoreBalanceDetailQuery dataQuery = this.GetDataQuery(context);
            StoresInfo storeById = DepotHelper.GetStoreById(dataQuery.StoreId.Value);
            IList <StoreBalanceDetailInfo> balanceDetails4Report = StoreBalanceHelper.GetBalanceDetails4Report(dataQuery);
            StringBuilder stringBuilder = new StringBuilder(300);

            stringBuilder.Append("门店");
            stringBuilder.Append(",时间");
            stringBuilder.Append(",类型");
            stringBuilder.Append(",订单号");
            stringBuilder.Append(",收入");
            stringBuilder.Append(",支出");
            stringBuilder.Append(",账户余额");
            stringBuilder.Append(",备注\r\n");
            foreach (StoreBalanceDetailInfo item in balanceDetails4Report)
            {
                stringBuilder.Append(storeById.StoreName);
                stringBuilder.Append("," + item.TradeDate);
                stringBuilder.Append("," + item.TradeTypeText);
                stringBuilder.Append("," + item.TradeNo);
                stringBuilder.Append("," + item.Income);
                stringBuilder.Append("," + item.Expenses);
                stringBuilder.Append("," + item.Balance);
                stringBuilder.Append("," + item.Remark + "\r\n");
            }
            context.Response.Clear();
            context.Response.Buffer  = false;
            context.Response.Charset = "GB2312";
            context.Response.AppendHeader("Content-Disposition", "attachment;filename=BalanceDetail.csv");
            context.Response.ContentEncoding = Encoding.GetEncoding("GB2312");
            context.Response.ContentType     = "application/octet-stream";
            context.Response.Write(stringBuilder.ToString());
            context.Response.End();
        }
		private void OfflinePayOder()
		{
			if (this.offlineOrder != null && this.offlineOrder.Status == 0)
			{
				this.offlineOrder.Status = 1;
				this.offlineOrder.PayTime = DateTime.Now;
				if (StoresHelper.UpdateStoreCollectionInfo(this.offlineOrder) && this.isOfflineOrder)
				{
					string text = "";
					StoresInfo storeById = DepotHelper.GetStoreById(this.offlineOrder.StoreId);
					if (storeById != null)
					{
						text = storeById.StoreName;
						StoreBalanceDetailInfo storeBalanceDetailInfo = new StoreBalanceDetailInfo();
						storeBalanceDetailInfo.StoreId = this.offlineOrder.StoreId;
						storeBalanceDetailInfo.TradeDate = DateTime.Now;
						storeBalanceDetailInfo.TradeType = StoreTradeTypes.OfflineCashier;
						storeBalanceDetailInfo.Expenses = default(decimal);
						storeBalanceDetailInfo.Income = this.offlineOrder.PayAmount;
						storeBalanceDetailInfo.Balance = storeById.Balance + this.offlineOrder.PayAmount;
						storeBalanceDetailInfo.Remark = "线下收银(" + this.offlineOrder.OrderId + ")";
						storeBalanceDetailInfo.ManagerUserName = "";
						storeBalanceDetailInfo.TradeNo = this.offlineOrder.OrderId;
						storeBalanceDetailInfo.CreateTime = DateTime.Now;
						storeBalanceDetailInfo.PlatCommission = decimal.Zero;
						StoreBalanceHelper.AddBalanceDetailInfo(storeBalanceDetailInfo);
					}
					if (storeById != null)
					{
						VShopHelper.AppPsuhRecordForStore(storeById.StoreId, this.offlineOrder.OrderId, "", EnumPushStoreAction.StoreOrderPayed);
					}
				}
			}
		}
示例#7
0
 protected override void AttachChildControls()
 {
     PageTitle.AddSiteNameTitle("门店详情页");
     this.imgStore     = (HtmlImage)this.FindControl("imgStore");
     this.hidLatitude  = (HtmlInputHidden)this.FindControl("hidLatitude");
     this.hidLongitude = (HtmlInputHidden)this.FindControl("hidLongitude");
     this.hidTel       = (HtmlInputHidden)this.FindControl("hidTel");
     int.TryParse(this.Page.Request.QueryString["storeId"], out this.storeId);
     if (this.storeId > 0)
     {
         StoresInfo storeById = DepotHelper.GetStoreById(this.storeId);
         if (!string.IsNullOrEmpty(storeById.StoreImages))
         {
             this.imgStore.Src = storeById.StoreImages.Split(',')[0];
         }
         HtmlInputHidden htmlInputHidden = this.hidLatitude;
         double?         nullable        = storeById.Latitude;
         htmlInputHidden.Value = nullable.ToString();
         HtmlInputHidden htmlInputHidden2 = this.hidLongitude;
         nullable = storeById.Longitude;
         htmlInputHidden2.Value = nullable.ToString();
         this.hidTel.Value      = storeById.Tel;
         Literal literal = this.FindControl("ltopentime") as Literal;
         if (literal != null && !string.IsNullOrEmpty(storeById.StoreOpenTime))
         {
             literal.Text = $"<div class=\"opentime\">营业时间:{storeById.StoreOpenTime}</div>";
         }
         PageTitle.AddSiteNameTitle("周边门店-" + storeById.StoreName);
     }
     else
     {
         base.GotoResourceNotFound("参数错误");
     }
 }
示例#8
0
        private void bindShippingPaymentInfo()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();
            bool         flag           = masterSettings.OpenMultStore && !this.isPreSale;

            this.hidIsMultiStore.Value = (flag ? "1" : "0");
            if (this.storeId > 0 & flag)
            {
                StoresInfo storeById = DepotHelper.GetStoreById(this.storeId);
                if (storeById != null && this.cart.LineItems.Count > 0)
                {
                    this.hidIsSubmitInTime.Value = "1";
                    this.hidStoreName.Value      = storeById.StoreName;
                    this.hidStoreId.Value        = this.storeId.ToString();
                    if (!SettingsManager.GetMasterSettings().Store_IsOrderInClosingTime)
                    {
                        DateTime 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)
                        {
                            this.hidIsSubmitInTime.Value = "0";
                        }
                    }
                }
            }
            if (this.paymentModeId == 0)
            {
                if (TradeHelper.WapPaymentTypeCount(base.ClientType, this.isFightGroup) > 0)
                {
                    this.inputPaymentModeId.Value = this.paymentModeId.ToString();
                }
            }
            else
            {
                this.inputPaymentModeId.Value = this.paymentModeId.ToString();
            }
            if (this.isCountDown)
            {
                this.paymenttypeselect.OrderSalesPromotion = Common_WAPPaymentTypeSelect.EnumOrderSalesPromotion.CountDownBuy;
            }
            this.paymenttypeselect.IsServiceProduct = true;
            this.paymenttypeselect.IsFireGroup      = this.isFightGroup;
            this.paymenttypeselect.ClientType       = base.ClientType;
        }
        private void BindStoreInfo()
        {
            StoresInfo storeById = DepotHelper.GetStoreById(this.order.StoreId);

            if (storeById != null)
            {
                this.litStoreName.SetWhenIsNotNull(storeById.StoreName);
                this.litStoreTel.SetWhenIsNotNull(storeById.Tel);
                this.litStoreInfo.SetWhenIsNotNull(RegionHelper.GetFullRegion(storeById.RegionId, " ", true, 0) + " " + storeById.Address);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.ProductId = this.Page.Request.QueryString["ProductId"].ToInt(0);
         this.StoreId   = this.Page.Request.QueryString["StoreId"].ToInt(0);
         if (this.StoreId < 0 || this.ProductId < 0)
         {
             base.GotoResourceNotFound();
         }
         else
         {
             this.hidStoreId.Value = this.StoreId.ToString();
             ProductInfo productById = ProductHelper.GetProductById(this.ProductId);
             if (productById != null)
             {
                 this.ImgProduct.ImageUrl = productById.ThumbnailUrl40;
                 this.litProductName.Text = productById.ProductName;
             }
             StoresInfo storeById = DepotHelper.GetStoreById(this.StoreId);
             if (storeById != null)
             {
                 this.litStoreName.Text = storeById.StoreName;
                 int num;
                 if (storeById.IsModifyPrice)
                 {
                     decimal?maxPriceRate = storeById.MaxPriceRate;
                     num = ((maxPriceRate.GetValueOrDefault() > default(decimal) && maxPriceRate.HasValue) ? 1 : 0);
                 }
                 else
                 {
                     num = 0;
                 }
                 if (num != 0)
                 {
                     this.priceTip.Visible       = true;
                     this.priceTipMessage.Text   = $"可设置价格区间为商品价格的{storeById.MinPriceRate.ToNullString()}倍-{storeById.MaxPriceRate.ToNullString()}倍";
                     this.hidIsModifyPrice.Value = "1";
                     this.hidMinPriceRate.Value  = storeById.MinPriceRate.ToNullString();
                     this.hidMaxPriceRate.Value  = storeById.MaxPriceRate.ToNullString();
                 }
             }
             this.BindProduct();
         }
     }
 }
示例#11
0
 protected override void AttachChildControls()
 {
     this.imgStore      = (HtmlImage)this.FindControl("imgStore");
     this.hidLatitude   = (HtmlInputHidden)this.FindControl("hidLatitude");
     this.hidLongitude  = (HtmlInputHidden)this.FindControl("hidLongitude");
     this.hidTel        = (HtmlInputHidden)this.FindControl("hidTel");
     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 = HiContext.Current.SiteSettings.WeixinAppId;
     int.TryParse(this.Page.Request.QueryString["storeId"], out this.storeId);
     if (this.storeId > 0)
     {
         StoresInfo storeById = DepotHelper.GetStoreById(this.storeId);
         if (!string.IsNullOrEmpty(storeById.StoreImages))
         {
             this.imgStore.Src = storeById.StoreImages.Split(',')[0];
         }
         HtmlInputHidden htmlInputHidden = this.hidLatitude;
         double?         nullable        = storeById.Latitude;
         htmlInputHidden.Value = nullable.ToString();
         HtmlInputHidden htmlInputHidden2 = this.hidLongitude;
         nullable = storeById.Longitude;
         htmlInputHidden2.Value = nullable.ToString();
         this.hidTel.Value      = storeById.Tel;
         Literal literal = this.FindControl("ltopentime") as Literal;
         if (literal != null && !string.IsNullOrEmpty(storeById.StoreOpenTime))
         {
             literal.Text = $"<div class=\"opentime\">营业时间:{storeById.StoreOpenTime}</div>";
         }
         this.hdTitle.Value = storeById.StoreName;
         this.hdDesc.Value  = storeById.StoreName;
         string storeImages = storeById.StoreImages;
         string local       = string.IsNullOrEmpty(storeImages) ? SettingsManager.GetMasterSettings().LogoUrl : storeImages;
         this.hdImgUrl.Value = Globals.FullPath(local);
         this.hdLink.Value   = Globals.FullPath(this.Page.Request.Url.ToString());
         PageTitle.AddSiteNameTitle("周边门店-" + storeById.StoreName);
     }
     else
     {
         base.GotoResourceNotFound("参数错误");
     }
 }
示例#12
0
        private void ConfirmOrder(HttpContext context)
        {
            SiteSettings currentSiteSetting = base.CurrentSiteSetting;
            string       text = context.Request.Form["orderId"];

            if (string.IsNullOrWhiteSpace(text))
            {
                throw new HidistroAshxException("异常的参数:订单编号");
            }
            OrderInfo orderInfo = OrderHelper.GetOrderInfo(text);

            if (orderInfo == null)
            {
                throw new HidistroAshxException("异常的参数:订单编号");
            }
            if (orderInfo.IsConfirm || (orderInfo.OrderStatus != OrderStatus.BuyerAlreadyPaid && orderInfo.PaymentTypeId != -3))
            {
                return;
            }
            string empty = string.Empty;

            if (OrderHelper.ConfirmTakeOnStoreOrder(orderInfo, out empty, true, "", false))
            {
                StoresInfo storeById = DepotHelper.GetStoreById(orderInfo.StoreId);
                MemberInfo user      = Users.GetUser(orderInfo.UserId);
                if (user != null)
                {
                    if (!string.IsNullOrEmpty(currentSiteSetting.HiPOSAppId) && !string.IsNullOrEmpty(currentSiteSetting.HiPOSAppSecret) && !string.IsNullOrEmpty(currentSiteSetting.HiPOSMerchantId) && !string.IsNullOrEmpty(currentSiteSetting.HiPOSExpireAt) && currentSiteSetting.HiPOSExpireAt.ToDateTime() > (DateTime?)DateTime.Now)
                    {
                        string empty2  = string.Empty;
                        string siteUrl = currentSiteSetting.SiteUrl;
                        string text2   = Globals.HIPOSTAKECODEPREFIX + orderInfo.TakeCode;
                        empty2 = ((siteUrl.IndexOf("http") >= 0) ? (currentSiteSetting.SiteUrl + "/QRTakeCode.aspx?takeCode=" + text2) : ("http://" + currentSiteSetting.SiteUrl + "/QRTakeCode.aspx?takeCode=" + text2));
                        Messenger.OrderConfirmTakeOnStore(orderInfo, user, storeById, empty2);
                    }
                    else
                    {
                        Messenger.OrderConfirmTakeOnStore(orderInfo, user, storeById, "");
                    }
                    base.ReturnResult(context, true, empty, 0, true);
                }
                return;
            }
            throw new HidistroAshxException(empty);
        }
示例#13
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("门店介绍");
            this.litSupplierName  = (Literal)this.FindControl("litSupplierName");
            this.litSupplierAbout = (Literal)this.FindControl("litSupplierAbout");
            int        storeId   = HttpContext.Current.Request.QueryString["StoreId"].ToInt(0);
            StoresInfo storeById = DepotHelper.GetStoreById(storeId);

            if (storeById == null)
            {
                base.GotoResourceNotFound("");
            }
            else
            {
                this.litSupplierName.SetWhenIsNotNull(storeById.StoreName);
                this.litSupplierAbout.SetWhenIsNotNull(storeById.Introduce);
            }
        }
示例#14
0
        private void BindStoreInfo(OrderInfo order)
        {
            if (order.ShippingModeId == -2)
            {
                this.divstoreinfo.Visible = true;
                if (order.Gateway.ToLower() == "hishop.plugins.payment.payonstore")
                {
                    this.hidIsPaymentStore.Value = "1";
                }
            }
            this.litTakeCode.SetWhenIsNotNull(order.TakeCode);
            StoresInfo storeById = DepotHelper.GetStoreById(order.StoreId);

            if (storeById != null)
            {
                this.litStoreName.Text = storeById.StoreName;
                this.litStoreInfo.Text = RegionHelper.GetFullRegion(storeById.RegionId, " ", true, 0) + " " + storeById.Address;
                this.litStoreTel.Text  = storeById.Tel;
            }
        }
示例#15
0
        protected void btnSaveStock_Click(object sender, EventArgs e)
        {
            List <StoreSKUInfo>      list  = new List <StoreSKUInfo>();
            List <OperationLogEntry> list2 = new List <OperationLogEntry>();
            List <int> list3 = new List <int>();
            int        num   = 0;
            int        num2  = 0;
            decimal    num3  = default(decimal);

            if (this.grdSelectedProducts.Items.Count > 0)
            {
                StoresInfo storeById = DepotHelper.GetStoreById(this.hidStoreId.Value.ToInt(0));
                foreach (RepeaterItem item in this.grdSelectedProducts.Items)
                {
                    TextBox textBox = item.FindControl("txtStock") as TextBox;
                    num = textBox.Text.Trim().ToInt(0);
                    TextBox textBox2 = item.FindControl("txtStoreSalePrice") as TextBox;
                    num3 = textBox2.Text.Trim().ToDecimal(0);
                    TextBox textBox3 = item.FindControl("txtWarningStock") as TextBox;
                    num2 = textBox3.Text.Trim().ToInt(0);
                    if (num > 99999)
                    {
                        this.ShowMsg("允许输入的库存最大值为99999", false);
                        return;
                    }
                    if (num2 > 99999)
                    {
                        this.ShowMsg("允许输入的警戒库存最大值为99999", false);
                        return;
                    }
                    if (num >= 0 && num2 >= 0 && num3 >= decimal.Zero)
                    {
                        HiddenField hiddenField  = item.FindControl("hidProductName") as HiddenField;
                        HiddenField hiddenField2 = item.FindControl("hidSKU") as HiddenField;
                        HiddenField hiddenField3 = item.FindControl("hidSKUContent") as HiddenField;
                        HiddenField hiddenField4 = item.FindControl("HidSkuId") as HiddenField;
                        HiddenField hiddenField5 = item.FindControl("HidProductId") as HiddenField;
                        string      value        = hiddenField4.Value;
                        int         num4         = hiddenField5.Value.ToInt(0);
                        if (!list3.Contains(num4))
                        {
                            list3.Add(num4);
                        }
                        StoreSKUInfo storeSKUInfo = new StoreSKUInfo();
                        storeSKUInfo.ProductID      = num4;
                        storeSKUInfo.SkuId          = value;
                        storeSKUInfo.Stock          = num;
                        storeSKUInfo.StoreId        = this.hidStoreId.Value.ToInt(0);
                        storeSKUInfo.WarningStock   = num2;
                        storeSKUInfo.StoreSalePrice = num3;
                        storeSKUInfo.FreezeStock    = 0;
                        list.Add(storeSKUInfo);
                        OperationLogEntry operationLogEntry = new OperationLogEntry();
                        operationLogEntry.AddedTime   = DateTime.Now;
                        operationLogEntry.IPAddress   = this.Page.Request.UserHostAddress;
                        operationLogEntry.PageUrl     = "AddStoreProduct.aspx";
                        operationLogEntry.UserName    = HiContext.Current.Manager.UserName;
                        operationLogEntry.Privilege   = Privilege.AddStores;
                        operationLogEntry.Description = operationLogEntry.UserName + " 给门店" + storeById.StoreName + "上架了商品 " + hiddenField2.Value + ((hiddenField3.Value.Length <= 0) ? "" : ("[" + hiddenField3.Value + "]"));
                        OperationLogEntry operationLogEntry2 = operationLogEntry;
                        operationLogEntry2.Description = operationLogEntry2.Description + " 门店库存设置为" + num + ";";
                        operationLogEntry2             = operationLogEntry;
                        operationLogEntry2.Description = operationLogEntry2.Description + " 门店警戒库存设置为" + num2 + ";";
                        HiddenField hiddenField6 = item.FindControl("hidOldSalePrice") as HiddenField;
                        decimal     num5         = hiddenField6.Value.ToDecimal(0);
                        decimal?    minPriceRate = storeById.MinPriceRate;
                        if (minPriceRate.GetValueOrDefault() > default(decimal) && minPriceRate.HasValue)
                        {
                            decimal d             = num3;
                            decimal value2        = num5;
                            decimal?minPriceRate2 = storeById.MinPriceRate;
                            minPriceRate = (decimal?)value2 * minPriceRate2;
                            if (d < minPriceRate.GetValueOrDefault() && minPriceRate.HasValue)
                            {
                                this.ShowMsg(hiddenField.Value + "门店价格不能小于平台价格的" + storeById.MinPriceRate.Value.F2ToString("f2") + "倍!", false);
                                return;
                            }
                        }
                        minPriceRate = storeById.MaxPriceRate;
                        if (minPriceRate.GetValueOrDefault() > default(decimal) && minPriceRate.HasValue)
                        {
                            decimal d2            = num3;
                            decimal value2        = num5;
                            decimal?minPriceRate2 = storeById.MaxPriceRate;
                            minPriceRate = (decimal?)value2 * minPriceRate2;
                            if (d2 > minPriceRate.GetValueOrDefault() && minPriceRate.HasValue)
                            {
                                this.ShowMsg(hiddenField.Value + "门店价格不能大于平台价格的" + storeById.MaxPriceRate.Value.F2ToString("f2") + "倍!", false);
                                return;
                            }
                        }
                        operationLogEntry2             = operationLogEntry;
                        operationLogEntry2.Description = operationLogEntry2.Description + " 门店售价设置为" + num3 + ";";
                        list2.Add(operationLogEntry);
                    }
                }
                if (list.Count > 0)
                {
                    if (StoresHelper.AddStoreProduct(list, list2, list3))
                    {
                        base.CloseWindow(null);
                        this.ShowMsgCloseWindow("保存成功!", true);
                    }
                    else
                    {
                        this.ShowMsg("保存失败!", false);
                    }
                }
                else
                {
                    base.CloseWindow(null);
                }
            }
        }
 protected override void AttachChildControls()
 {
     this.inputPaymentModeId      = (HtmlInputHidden)this.FindControl("inputPaymentModeId");
     this.inputShippingModeId     = (HtmlInputHidden)this.FindControl("inputShippingModeId");
     this.hidPaymentId_Podrequest = (HtmlInputHidden)this.FindControl("hidPaymentId_Podrequest");
     this.hidPaymentId_Offline    = (HtmlInputHidden)this.FindControl("hidPaymentId_Offline");
     this.hidGetgoodsOnStores     = (HtmlInputHidden)this.FindControl("hidGetgoodsOnStores");
     this.hidHasStoresInCity      = (HtmlInputHidden)this.FindControl("hidHasStoresInCity");
     this.hidDeliveryTime         = (HtmlInputHidden)this.FindControl("hidDeliveryTime");
     this.hidStoreId            = (HtmlInputHidden)this.FindControl("hidStoreId");
     this.hidShipAddressId      = (HtmlInputHidden)this.FindControl("hidShipAddressId");
     this.litStoreName          = (Literal)this.FindControl("litStoreName");
     this.litAddress            = (Literal)this.FindControl("litAddress");
     this.litTel                = (Literal)this.FindControl("litTel");
     this.hidOnlinePayCount     = (HtmlInputHidden)this.FindControl("hidOnlinePayCount");
     this.hidHasSupplierProduct = (HtmlInputHidden)this.FindControl("hidHasSupplierProduct");
     if (!this.Page.IsPostBack)
     {
         this.hidHasSupplierProduct.Value   = this.hasSupplierProduct.ToString();
         this.hidOnlinePayCount.Value       = TradeHelper.WapPaymentTypeCount(base.ClientType, this.isFightGroup).ToNullString();
         this.hidGetgoodsOnStores.Value     = "false";
         this.hidHasStoresInCity.Value      = "false";
         this.hidPaymentId_Podrequest.Value = "0";
         int num  = 0;
         int num2 = 0;
         if (this.from != "countdown" && this.from != "groupbuy" && this.hasSupplierProduct != 1)
         {
             if (this.from != "presale" && SalesHelper.IsSupportPodrequest())
             {
                 num = 1;
                 this.hidPaymentId_Podrequest.Value = "1";
             }
             if (ShoppingProcessor.IsSupportOfflineRequest())
             {
                 this.hidPaymentId_Offline.Value = "2";
                 num2 = 2;
             }
         }
         if (this.paymentModeId != 0 && this.paymentModeId != num && this.paymentModeId != num2 && this.paymentModeId != -3)
         {
             this.paymentModeId = 0;
         }
         this.hidDeliveryTime.Value = this.deliveryTime;
         if (this.paymentModeId == 0)
         {
             if (TradeHelper.WapPaymentTypeCount(base.ClientType, this.isFightGroup) > 0)
             {
                 this.inputPaymentModeId.Value = this.paymentModeId.ToString();
             }
         }
         else
         {
             this.inputPaymentModeId.Value = this.paymentModeId.ToString();
         }
         this.inputShippingModeId.Value = this.shippingModeId.ToString();
         int shipAddressId = 0;
         int.TryParse(this.Page.Request.QueryString["ShipAddressId"].ToNullString(), out shipAddressId);
         IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses(false);
         int regionId = 0;
         IList <ShippingAddressInfo> list = new List <ShippingAddressInfo>();
         ShippingAddressInfo         shippingAddressInfo = null;
         if (shipAddressId > 0)
         {
             shippingAddressInfo = shippingAddresses.FirstOrDefault((ShippingAddressInfo a) => a.ShippingId == shipAddressId);
             if (shippingAddressInfo != null)
             {
                 regionId = shippingAddressInfo.RegionId;
             }
         }
         else if (shippingAddresses != null && shippingAddresses.Count > 0)
         {
             regionId = shippingAddresses.FirstOrDefault().RegionId;
         }
         this.hidShipAddressId.Value = shipAddressId.ToString();
         SiteSettings masterSettings = SettingsManager.GetMasterSettings();
         if (masterSettings.OpenMultStore)
         {
             this.hidStoreId.Value = this.storeId.ToString();
             if (this.storeId > 0)
             {
                 StoresInfo storeById = DepotHelper.GetStoreById(this.storeId);
                 this.litStoreName.Text = (string.IsNullOrEmpty(storeById.StoreOpenTime) ? storeById.StoreName : (storeById.StoreName + " [营业时间:" + storeById.StoreOpenTime + "]"));
                 this.litAddress.Text   = RegionHelper.GetFullRegion(storeById.RegionId, string.Empty, true, 0) + storeById.Address;
                 this.litTel.Text       = storeById.Tel;
             }
             if (this.from != "countdown" && this.from != "groupbuy" && this.from != "presale" && this.shoppingCart.LineItems.Count > 0)
             {
                 string str = this.productSku.Replace(",", "','");
                 str = "'" + str + "'";
                 if (ShoppingCartProcessor.CanGetGoodsOnStore(str))
                 {
                     this.hidGetgoodsOnStores.Value = "true";
                     bool flag = StoresHelper.HasStoresInCity(str, regionId);
                     this.hidHasStoresInCity.Value = (flag ? "true" : "false");
                 }
             }
             else
             {
                 this.hidGetgoodsOnStores.Value = "false";
             }
         }
     }
 }
示例#17
0
        private void SaveNewStock()
        {
            List <StoreSKUInfo> list = new List <StoreSKUInfo>();
            int storeId = HiContext.Current.Manager.StoreId;
            List <StoreStockLogInfo> list2 = new List <StoreStockLogInfo>();
            decimal num = default(decimal);

            if (this.grdSelectedProducts.Items.Count > 0)
            {
                StoresInfo storeById = DepotHelper.GetStoreById(HiContext.Current.Manager.StoreId);
                foreach (RepeaterItem item in this.grdSelectedProducts.Items)
                {
                    TextBox textBox = item.FindControl("txtStoreSalePrice") as TextBox;
                    num = textBox.Text.Trim().ToDecimal(0);
                    if (num >= decimal.Zero)
                    {
                        HiddenField hiddenField = item.FindControl("txtOldStoreSalePrice") as HiddenField;
                        if (num != hiddenField.Value.ToDecimal(0))
                        {
                            HiddenField  hiddenField2 = item.FindControl("hidSKUContent") as HiddenField;
                            TextBox      textBox2     = item.FindControl("txtRemark") as TextBox;
                            HiddenField  hiddenField3 = item.FindControl("HidSkuId") as HiddenField;
                            HiddenField  hiddenField4 = item.FindControl("HidProductId") as HiddenField;
                            string       value        = hiddenField3.Value;
                            int          num2         = hiddenField4.Value.ToInt(0);
                            StoreSKUInfo storeSKUInfo = new StoreSKUInfo();
                            storeSKUInfo.ProductID      = num2;
                            storeSKUInfo.SkuId          = value;
                            storeSKUInfo.StoreId        = storeId;
                            storeSKUInfo.StoreSalePrice = num;
                            list.Add(storeSKUInfo);
                            HiddenField hiddenField5 = item.FindControl("hidOldSalePrice") as HiddenField;
                            decimal     num3         = hiddenField5.Value.ToDecimal(0);
                            decimal?    minPriceRate = storeById.MinPriceRate;
                            if (minPriceRate.GetValueOrDefault() > default(decimal) && minPriceRate.HasValue)
                            {
                                decimal d             = num;
                                decimal value2        = num3;
                                decimal?minPriceRate2 = storeById.MinPriceRate;
                                minPriceRate = (decimal?)value2 * minPriceRate2;
                                if (d < minPriceRate.GetValueOrDefault() && minPriceRate.HasValue)
                                {
                                    this.ShowMsg("门店价格不能小于平台价格的" + storeById.MinPriceRate.Value.F2ToString("f2") + "倍!", false);
                                    return;
                                }
                            }
                            minPriceRate = storeById.MaxPriceRate;
                            if (minPriceRate.GetValueOrDefault() > default(decimal) && minPriceRate.HasValue)
                            {
                                decimal d2            = num;
                                decimal value2        = num3;
                                decimal?minPriceRate2 = storeById.MaxPriceRate;
                                minPriceRate = (decimal?)value2 * minPriceRate2;
                                if (d2 > minPriceRate.GetValueOrDefault() && minPriceRate.HasValue)
                                {
                                    this.ShowMsg("门店价格不能大于平台价格的" + storeById.MaxPriceRate.Value.F2ToString("f2") + "倍!", false);
                                    return;
                                }
                            }
                            StoreStockLogInfo storeStockLogInfo = new StoreStockLogInfo();
                            storeStockLogInfo.ProductId  = num2;
                            storeStockLogInfo.Remark     = DataHelper.CleanSearchString(string.IsNullOrEmpty(textBox2.Text.Trim()) ? this.txtComment.Text.Trim() : textBox2.Text.Trim());
                            storeStockLogInfo.SkuId      = value;
                            storeStockLogInfo.Operator   = HiContext.Current.Manager.UserName;
                            storeStockLogInfo.StoreId    = storeId;
                            storeStockLogInfo.ChangeTime = DateTime.Now;
                            storeStockLogInfo.Content    = hiddenField2.Value + "售价由【" + hiddenField.Value.ToDecimal(0).F2ToString("f2") + "】修改为【" + num.F2ToString("f2") + "】";
                            list2.Add(storeStockLogInfo);
                        }
                    }
                }
                if (list.Count > 0)
                {
                    if (StoresHelper.SaveStoreStock(list, list2, 3))
                    {
                        base.CloseWindow(null);
                        this.BindProduct();
                    }
                    else
                    {
                        this.ShowMsg("保存失败!", false);
                    }
                }
                else
                {
                    base.CloseWindow(null);
                }
            }
        }
示例#18
0
        public void bindReplaceInfo()
        {
            int         replaceId   = this.Page.Request["replaceId"].ToInt(0);
            ReplaceInfo replaceInfo = TradeHelper.GetReplaceInfo(replaceId);

            if (replaceInfo == null)
            {
                this.ShowMsg("换货信息错误!", false);
            }
            else
            {
                OrderInfo   orderInfo   = TradeHelper.GetOrderInfo(replaceInfo.OrderId);
                HiddenField hiddenField = this.hidReplaceStatus;
                int         num         = (int)replaceInfo.HandleStatus;
                hiddenField.Value = num.ToString();
                if (orderInfo == null)
                {
                    this.ShowMsg("错误的订单信息!", false);
                }
                else
                {
                    if (string.IsNullOrEmpty(replaceInfo.SkuId))
                    {
                        this.listPrducts.DataSource = orderInfo.LineItems.Values;
                    }
                    else
                    {
                        Dictionary <string, LineItemInfo> dictionary = new Dictionary <string, LineItemInfo>();
                        foreach (LineItemInfo value in orderInfo.LineItems.Values)
                        {
                            if (value.SkuId == replaceInfo.SkuId)
                            {
                                dictionary.Add(value.SkuId, value);
                            }
                        }
                        this.listPrducts.DataSource = dictionary.Values;
                    }
                    this.txtAdminRemark.Text = replaceInfo.AdminRemark;
                    this.listPrducts.DataBind();
                    this.litOrderId.Text      = orderInfo.PayOrderId;
                    this.litOrderTotal.Text   = orderInfo.GetTotal(false).F2ToString("f2");
                    this.litRefundReason.Text = replaceInfo.ReplaceReason;
                    this.litRemark.Text       = replaceInfo.UserRemark;
                    Literal literal = this.litReturnQuantity;
                    num          = replaceInfo.Quantity;
                    literal.Text = num.ToString();
                    string userCredentials = replaceInfo.UserCredentials;
                    if (!string.IsNullOrEmpty(userCredentials))
                    {
                        string[] array = userCredentials.Split('|');
                        userCredentials = "";
                        string[] array2 = array;
                        foreach (string str in array2)
                        {
                            userCredentials += string.Format(this.credentialsImgHtml, Globals.GetImageServerUrl() + str);
                        }
                        this.litImageList.Text = userCredentials;
                    }
                    else
                    {
                        this.divCredentials.Visible = false;
                    }
                    if (orderInfo.StoreId <= 0)
                    {
                        if (replaceInfo.HandleStatus == ReplaceStatus.Applied)
                        {
                            this.btnAcceptReplace.Visible = true;
                            this.btnRefuseReplace.Visible = true;
                        }
                        else if (replaceInfo.HandleStatus == ReplaceStatus.UserDelivery)
                        {
                            this.btnGetAndSendGoods.Visible = true;
                        }
                    }
                    if (replaceInfo.HandleStatus != 0)
                    {
                        this.txtAdminCellPhone.Visible   = false;
                        this.txtAdminShipAddress.Visible = false;
                        this.txtAdminShipTo.Visible      = false;
                        this.litAdminCellPhone.Visible   = true;
                        this.litAdminShipAddrss.Visible  = true;
                        this.litAdminShipTo.Visible      = true;
                        this.litAdminCellPhone.Text      = replaceInfo.AdminCellPhone;
                        this.litAdminShipTo.Text         = replaceInfo.AdminShipTo;
                        this.litAdminShipAddrss.Text     = replaceInfo.AdminShipAddress;
                    }
                    else if (orderInfo.SupplierId > 0)
                    {
                        ShippersInfo defaultGetGoodsShipperBysupplierId = SalesHelper.GetDefaultGetGoodsShipperBysupplierId(orderInfo.SupplierId);
                        if (defaultGetGoodsShipperBysupplierId != null)
                        {
                            Literal literal2 = this.litAdminShipAddrss;
                            TextBox textBox  = this.txtAdminShipAddress;
                            string  text3    = literal2.Text = (textBox.Text = RegionHelper.GetFullRegion(defaultGetGoodsShipperBysupplierId.RegionId, " ", true, 0) + " " + defaultGetGoodsShipperBysupplierId.Address);
                            Literal literal3 = this.litAdminShipTo;
                            TextBox textBox2 = this.txtAdminShipTo;
                            text3 = (literal3.Text = (textBox2.Text = defaultGetGoodsShipperBysupplierId.ShipperName));
                            Literal literal4 = this.litAdminCellPhone;
                            TextBox textBox3 = this.txtAdminCellPhone;
                            text3 = (literal4.Text = (textBox3.Text = defaultGetGoodsShipperBysupplierId.CellPhone));
                        }
                    }
                    else if (orderInfo.StoreId > 0)
                    {
                        StoresInfo storeById = DepotHelper.GetStoreById(orderInfo.StoreId);
                        if (storeById != null)
                        {
                            Literal literal5 = this.litAdminShipAddrss;
                            TextBox textBox4 = this.txtAdminShipAddress;
                            string  text3    = literal5.Text = (textBox4.Text = RegionHelper.GetFullRegion(storeById.RegionId, " ", true, 0) + " " + storeById.Address);
                            Literal literal6 = this.litAdminShipTo;
                            TextBox textBox5 = this.txtAdminShipTo;
                            text3 = (literal6.Text = (textBox5.Text = storeById.ContactMan));
                            Literal literal7 = this.litAdminCellPhone;
                            TextBox textBox6 = this.txtAdminCellPhone;
                            text3 = (literal7.Text = (textBox6.Text = storeById.Tel));
                        }
                    }
                    else
                    {
                        ShippersInfo defaultOrFirstGetGoodShipper = TradeHelper.GetDefaultOrFirstGetGoodShipper();
                        if (defaultOrFirstGetGoodShipper != null)
                        {
                            Literal literal8 = this.litAdminShipAddrss;
                            TextBox textBox7 = this.txtAdminShipAddress;
                            string  text3    = literal8.Text = (textBox7.Text = RegionHelper.GetFullRegion(defaultOrFirstGetGoodShipper.RegionId, " ", true, 0) + " " + defaultOrFirstGetGoodShipper.Address);
                            Literal literal9 = this.litAdminShipTo;
                            TextBox textBox8 = this.txtAdminShipTo;
                            text3 = (literal9.Text = (textBox8.Text = defaultOrFirstGetGoodShipper.ShipperName));
                            Literal literal10 = this.litAdminCellPhone;
                            TextBox textBox9  = this.txtAdminCellPhone;
                            text3 = (literal10.Text = (textBox9.Text = defaultOrFirstGetGoodShipper.CellPhone));
                        }
                    }
                    if (replaceInfo.HandleStatus == ReplaceStatus.UserDelivery)
                    {
                        this.btnViewUserLogistic.Visible = true;
                        AttributeCollection attributes = this.btnViewUserLogistic.Attributes;
                        num = replaceInfo.ReplaceId;
                        attributes.Add("replaceid", num.ToString());
                        this.btnViewUserLogistic.Attributes.Add("expresscompanyname", replaceInfo.UserExpressCompanyName.ToString());
                        this.btnViewUserLogistic.Attributes.Add("shipordernumber", replaceInfo.UserShipOrderNumber.ToString());
                    }
                    if (replaceInfo.HandleStatus == ReplaceStatus.MerchantsDelivery || replaceInfo.HandleStatus == ReplaceStatus.Replaced)
                    {
                        this.btnViewMallLogistic.Visible = true;
                        AttributeCollection attributes2 = this.btnViewMallLogistic.Attributes;
                        num = replaceInfo.ReplaceId;
                        attributes2.Add("replaceid", num.ToString());
                        this.btnViewMallLogistic.Attributes.Add("expresscompanyname", replaceInfo.ExpressCompanyName.ToString());
                        this.btnViewMallLogistic.Attributes.Add("shipordernumber", replaceInfo.ShipOrderNumber.ToString());
                    }
                    string str2 = string.IsNullOrEmpty(orderInfo.RealName) ? "" : (orderInfo.RealName.Replace("\n\r", "").Replace("\n", "").Replace("\r", "") + " (" + (string.IsNullOrEmpty(orderInfo.CellPhone) ? orderInfo.TelPhone : orderInfo.CellPhone) + ")");
                    str2 = str2 + orderInfo.ShippingRegion + " " + orderInfo.Address;
                    this.litUserAddress.Text = str2;
                    this.txtStatus.Text      = EnumDescription.GetEnumDescription((Enum)(object)replaceInfo.HandleStatus, 0);
                    Literal literal11 = this.txtAfterSaleId;
                    num            = replaceInfo.ReplaceId;
                    literal11.Text = num.ToString();
                    if (orderInfo.SupplierId > 0)
                    {
                        this.btnGetAndSendGoods.Visible = false;
                    }
                }
            }
        }
示例#19
0
        public void bindReturnInfo()
        {
            int        returnId   = this.Page.Request["ReturnId"].ToInt(0);
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(returnId);

            if (returnInfo == null)
            {
                this.ShowMsg("退货信息错误!", false);
            }
            else
            {
                HiddenField hiddenField = this.hidReturnStatus;
                int         num         = (int)returnInfo.HandleStatus;
                hiddenField.Value = num.ToString();
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(returnInfo.OrderId);
                if (orderInfo == null)
                {
                    this.ShowMsg("错误的订单信息!", false);
                }
                else
                {
                    if (string.IsNullOrEmpty(returnInfo.SkuId))
                    {
                        this.listPrducts.DataSource = orderInfo.LineItems.Values;
                    }
                    else
                    {
                        Dictionary <string, LineItemInfo> dictionary = new Dictionary <string, LineItemInfo>();
                        foreach (LineItemInfo value in orderInfo.LineItems.Values)
                        {
                            if (value.SkuId == returnInfo.SkuId)
                            {
                                dictionary.Add(value.SkuId, value);
                            }
                        }
                        this.listPrducts.DataSource = dictionary.Values;
                    }
                    this.listPrducts.DataBind();
                    this.litOrderId.Text      = orderInfo.PayOrderId;
                    this.litOrderTotal.Text   = orderInfo.GetTotal(false).F2ToString("f2");
                    this.litRefundReason.Text = returnInfo.ReturnReason;
                    this.litRefundTotal.Text  = returnInfo.RefundAmount.F2ToString("f2");
                    this.litRemark.Text       = returnInfo.UserRemark;
                    Literal literal = this.litReturnQuantity;
                    num          = returnInfo.Quantity;
                    literal.Text = num.ToString();
                    if (returnInfo.RefundType == RefundTypes.InBankCard)
                    {
                        this.litType.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.RefundType, 0) + "(" + returnInfo.BankName + "  " + returnInfo.BankAccountName + "  " + returnInfo.BankAccountNo + ")";
                    }
                    else
                    {
                        this.litType.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.RefundType, 0);
                    }
                    string userCredentials = returnInfo.UserCredentials;
                    if (!string.IsNullOrEmpty(userCredentials))
                    {
                        string[] array = userCredentials.Split('|');
                        userCredentials = "";
                        string[] array2 = array;
                        foreach (string str in array2)
                        {
                            userCredentials += string.Format(this.credentialsImgHtml, Globals.GetImageServerUrl() + str);
                        }
                        this.litImageList.Text = userCredentials;
                    }
                    else
                    {
                        this.divCredentials.Visible = false;
                    }
                    if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
                    {
                        this.btnAcceptReturn.Text = "确认退款";
                        this.btnRefuseReturn.Text = "拒绝退款";
                        this.AfterSaleType        = "退款";
                    }
                    if (returnInfo.HandleStatus == ReturnStatus.Applied && !orderInfo.IsStoreCollect)
                    {
                        this.btnAcceptReturn.Visible = true;
                        this.btnRefuseReturn.Visible = true;
                    }
                    if (returnInfo.HandleStatus == ReturnStatus.Deliverying && this.UserStoreId > 0 && !orderInfo.IsStoreCollect)
                    {
                        this.btnGetGoods.Visible = true;
                    }
                    if ((orderInfo.StoreId == this.UserStoreId || orderInfo.StoreId <= 0 || (!orderInfo.IsStoreCollect && this.UserStoreId == 0)) && (returnInfo.HandleStatus == ReturnStatus.GetGoods || (returnInfo.HandleStatus == ReturnStatus.Deliverying && orderInfo.StoreId <= 0)))
                    {
                        if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
                        {
                            this.btnFinishReturn.Text = "确认收货并完成退款";
                        }
                        this.btnFinishReturn.Visible = true;
                    }
                    if (returnInfo.HandleStatus != ReturnStatus.Refused && returnInfo.HandleStatus != ReturnStatus.Returned)
                    {
                        this.inputPanel.Visible = true;
                        this.showPanel.Visible  = false;
                    }
                    else
                    {
                        this.inputPanel.Visible = false;
                        this.showPanel.Visible  = true;
                    }
                    if (returnInfo.HandleStatus != 0)
                    {
                        this.txtAdminCellPhone.Visible   = false;
                        this.txtAdminShipAddress.Visible = false;
                        this.txtAdminShipTo.Visible      = false;
                        this.litAdminCellPhone.Visible   = true;
                        this.litAdminShipAddrss.Visible  = true;
                        this.litAdminShipTo.Visible      = true;
                        this.litAdminCellPhone.Text      = returnInfo.AdminCellPhone;
                        this.litAdminShipTo.Text         = returnInfo.AdminShipTo;
                        this.litAdminShipAddrss.Text     = returnInfo.AdminShipAddress;
                    }
                    else if (orderInfo.SupplierId > 0)
                    {
                        ShippersInfo defaultGetGoodsShipperBysupplierId = SalesHelper.GetDefaultGetGoodsShipperBysupplierId(orderInfo.SupplierId);
                        if (defaultGetGoodsShipperBysupplierId != null)
                        {
                            Literal literal2 = this.litAdminShipAddrss;
                            TextBox textBox  = this.txtAdminShipAddress;
                            string  text3    = literal2.Text = (textBox.Text = RegionHelper.GetFullRegion(defaultGetGoodsShipperBysupplierId.RegionId, " ", true, 0) + " " + defaultGetGoodsShipperBysupplierId.Address);
                            Literal literal3 = this.litAdminShipTo;
                            TextBox textBox2 = this.txtAdminShipTo;
                            text3 = (literal3.Text = (textBox2.Text = defaultGetGoodsShipperBysupplierId.ShipperName));
                            Literal literal4 = this.litAdminCellPhone;
                            TextBox textBox3 = this.txtAdminCellPhone;
                            text3 = (literal4.Text = (textBox3.Text = defaultGetGoodsShipperBysupplierId.CellPhone));
                        }
                    }
                    else if (orderInfo.StoreId > 0)
                    {
                        StoresInfo storeById = DepotHelper.GetStoreById(orderInfo.StoreId);
                        if (storeById != null)
                        {
                            Literal literal5 = this.litAdminShipAddrss;
                            TextBox textBox4 = this.txtAdminShipAddress;
                            string  text3    = literal5.Text = (textBox4.Text = RegionHelper.GetFullRegion(storeById.RegionId, " ", true, 0) + " " + storeById.Address);
                            Literal literal6 = this.litAdminShipTo;
                            TextBox textBox5 = this.txtAdminShipTo;
                            text3 = (literal6.Text = (textBox5.Text = storeById.ContactMan));
                            Literal literal7 = this.litAdminCellPhone;
                            TextBox textBox6 = this.txtAdminCellPhone;
                            text3 = (literal7.Text = (textBox6.Text = storeById.Tel));
                        }
                    }
                    else
                    {
                        ShippersInfo defaultOrFirstGetGoodShipper = TradeHelper.GetDefaultOrFirstGetGoodShipper();
                        if (defaultOrFirstGetGoodShipper != null)
                        {
                            Literal literal8 = this.litAdminShipAddrss;
                            TextBox textBox7 = this.txtAdminShipAddress;
                            string  text3    = literal8.Text = (textBox7.Text = RegionHelper.GetFullRegion(defaultOrFirstGetGoodShipper.RegionId, " ", true, 0) + " " + defaultOrFirstGetGoodShipper.Address);
                            Literal literal9 = this.litAdminShipTo;
                            TextBox textBox8 = this.txtAdminShipTo;
                            text3 = (literal9.Text = (textBox8.Text = defaultOrFirstGetGoodShipper.ShipperName));
                            Literal literal10 = this.litAdminCellPhone;
                            TextBox textBox9  = this.txtAdminCellPhone;
                            text3 = (literal10.Text = (textBox9.Text = defaultOrFirstGetGoodShipper.CellPhone));
                        }
                    }
                    this.litRefundMoney.Text = returnInfo.RefundAmount.F2ToString("f2") + "元";
                    this.txtAdminRemark.Text = returnInfo.AdminRemark;
                    if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
                    {
                        this.txtStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 3);
                    }
                    else
                    {
                        this.txtStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 0);
                    }
                    this.litRefundMoney.Text = returnInfo.RefundAmount.F2ToString("f2") + "元";
                    Literal literal11 = this.txtAfterSaleId;
                    num                      = returnInfo.ReturnId;
                    literal11.Text           = num.ToString();
                    this.txtPayMoney.Text    = orderInfo.GetTotal(false).F2ToString("f2");
                    this.txtRefundMoney.Text = returnInfo.RefundAmount.F2ToString("f2");
                    HiddenField hiddenField2 = this.hidAfterSaleType;
                    num = (int)returnInfo.AfterSaleType;
                    hiddenField2.Value            = num.ToString();
                    this.hidRefundMaxAmount.Value = orderInfo.GetCanRefundAmount(returnInfo.SkuId, null, 0).F2ToString("f2");
                    if (returnInfo.AfterSaleType == AfterSaleTypes.ReturnAndRefund && (returnInfo.HandleStatus == ReturnStatus.Deliverying || returnInfo.HandleStatus == ReturnStatus.GetGoods || returnInfo.HandleStatus == ReturnStatus.Returned))
                    {
                        this.btnViewLogistic.Visible = true;
                        AttributeCollection attributes = this.btnViewLogistic.Attributes;
                        num = returnInfo.ReturnId;
                        attributes.Add("returnsid", num.ToString());
                        AttributeCollection attributes2 = this.btnViewLogistic.Attributes;
                        num = returnInfo.ReturnId;
                        attributes2.Add("returnsid", num.ToString());
                        this.btnViewLogistic.Attributes.Add("expresscompanyname", returnInfo.ExpressCompanyName.ToString());
                        this.btnViewLogistic.Attributes.Add("shipordernumber", returnInfo.ShipOrderNumber.ToString());
                    }
                    if (orderInfo.SupplierId > 0)
                    {
                        this.btnGetGoods.Visible = false;
                    }
                }
            }
        }
示例#20
0
 private void UserPayOrder()
 {
     if (this.Order != null && this.Order.OrderStatus == OrderStatus.Closed)
     {
         OrderHelper.SetExceptionOrder(this.Order.OrderId, "支付异常,请联系买家退款");
         Messenger.OrderException(Users.GetUser(this.Order.UserId), this.Order, "订单支付异常,请联系卖家退款.订单号:" + this.Order.OrderId);
         this.ResponseReturn(true, "");
     }
     else if ((this.Order != null && this.Order.OrderStatus == OrderStatus.BuyerAlreadyPaid) || (this.offlineOrder != null && this.offlineOrder.Status == 1))
     {
         this.ResponseReturn(true, "");
     }
     else
     {
         try
         {
             int maxCount        = 0;
             int yetOrderNum     = 0;
             int currentOrderNum = 0;
             if (this.Order != null)
             {
                 if (this.Order.GroupBuyId > 0)
                 {
                     GroupBuyInfo groupBuy = TradeHelper.GetGroupBuy(this.Order.GroupBuyId);
                     if (groupBuy == null || groupBuy.Status != GroupBuyStatus.UnderWay)
                     {
                         return;
                     }
                     yetOrderNum     = TradeHelper.GetOrderCount(this.Order.GroupBuyId);
                     currentOrderNum = this.Order.GetGroupBuyOerderNumber();
                     maxCount        = groupBuy.MaxCount;
                     if (maxCount < yetOrderNum + currentOrderNum)
                     {
                         return;
                     }
                 }
                 if (this.Order.CheckAction(OrderActions.BUYER_PAY) && TradeHelper.UpdateOrderStatus(this.Order))
                 {
                     Task.Factory.StartNew(delegate
                     {
                         TradeHelper.UserPayOrder(this.Order, false, true);
                         try
                         {
                             if (this.offlineOrder != null)
                             {
                                 OrderHelper.UpdateOrderPaymentTypeOfAPI(this.Order);
                                 OrderHelper.ConfirmTakeGoods(this.Order, true);
                             }
                             if (this.Order.GroupBuyId > 0 && maxCount == yetOrderNum + currentOrderNum)
                             {
                                 TradeHelper.SetGroupBuyEndUntreated(this.Order.GroupBuyId);
                             }
                             if (this.Order.UserId != 0 && this.Order.UserId != 1100)
                             {
                                 string verificationPasswords = "";
                                 if (this.Order.OrderType == OrderType.ServiceOrder)
                                 {
                                     verificationPasswords = OrderHelper.GetVerificationPasswordsOfOrderId(this.Order.OrderId);
                                 }
                                 Hidistro.Entities.Members.MemberInfo user = Users.GetUser(this.Order.UserId);
                                 if (user != null)
                                 {
                                     Messenger.OrderPayment(user, this.Order, this.Order.GetTotal(true), verificationPasswords);
                                 }
                             }
                             StoresInfo storesInfo2 = null;
                             if (this.Order.StoreId > 0)
                             {
                                 storesInfo2 = DepotHelper.GetStoreById(this.Order.StoreId);
                             }
                             if (storesInfo2 != null)
                             {
                                 VShopHelper.AppPsuhRecordForStore(storesInfo2.StoreId, this.Order.OrderId, "", EnumPushStoreAction.StoreOrderPayed);
                                 if (this.offlineOrder == null)
                                 {
                                     if (this.Order.ShippingModeId == -2)
                                     {
                                         VShopHelper.AppPsuhRecordForStore(storesInfo2.StoreId, this.Order.OrderId, "", EnumPushStoreAction.TakeOnStoreOrderWaitConfirm);
                                     }
                                     else
                                     {
                                         VShopHelper.AppPsuhRecordForStore(storesInfo2.StoreId, this.Order.OrderId, "", EnumPushStoreAction.StoreOrderWaitSendGoods);
                                     }
                                 }
                             }
                             if (this.offlineOrder == null)
                             {
                                 ShippersInfo defaultOrFirstShipper = SalesHelper.GetDefaultOrFirstShipper(0);
                                 Messenger.OrderPaymentToShipper(defaultOrFirstShipper, storesInfo2, null, this.Order, this.Order.GetTotal(true));
                             }
                             this.Order.OnPayment();
                         }
                         catch (Exception ex2)
                         {
                             IDictionary <string, string> dictionary2 = new Dictionary <string, string>();
                             dictionary2.Add("ErrorMessage", ex2.Message);
                             dictionary2.Add("StackTrace", ex2.StackTrace);
                             if (ex2.InnerException != null)
                             {
                                 dictionary2.Add("InnerException", ex2.InnerException.ToString());
                             }
                             if (ex2.GetBaseException() != null)
                             {
                                 dictionary2.Add("BaseException", ex2.GetBaseException().Message);
                             }
                             if (ex2.TargetSite != (MethodBase)null)
                             {
                                 dictionary2.Add("TargetSite", ex2.TargetSite.ToString());
                             }
                             dictionary2.Add("ExSource", ex2.Source);
                             Globals.AppendLog(dictionary2, "支付更新订单收款记录或者消息通知时出错:" + ex2.Message, "", "", "UserPay");
                         }
                         this.Order.OnPayment();
                         this.ResponseReturn(true, "");
                     });
                 }
                 if (this.Order.FightGroupId > 0)
                 {
                     VShopHelper.SetFightGroupSuccess(this.Order.FightGroupId);
                 }
             }
             if (this.offlineOrder != null && this.offlineOrder.Status == 0)
             {
                 this.offlineOrder.Status  = 1;
                 this.offlineOrder.PayTime = DateTime.Now;
                 if (StoresHelper.UpdateStoreCollectionInfo(this.offlineOrder) && this.isOfflineOrder)
                 {
                     string     text      = "";
                     StoresInfo storeById = DepotHelper.GetStoreById(this.offlineOrder.StoreId);
                     if (storeById != null)
                     {
                         text = storeById.StoreName;
                         StoreBalanceDetailInfo storeBalanceDetailInfo = new StoreBalanceDetailInfo();
                         storeBalanceDetailInfo.StoreId         = this.offlineOrder.StoreId;
                         storeBalanceDetailInfo.TradeDate       = DateTime.Now;
                         storeBalanceDetailInfo.TradeType       = StoreTradeTypes.OfflineCashier;
                         storeBalanceDetailInfo.Expenses        = default(decimal);
                         storeBalanceDetailInfo.Income          = this.offlineOrder.PayAmount;
                         storeBalanceDetailInfo.Balance         = storeById.Balance + this.offlineOrder.PayAmount;
                         storeBalanceDetailInfo.Remark          = "线下收银(" + this.offlineOrder.OrderId + ")";
                         storeBalanceDetailInfo.ManagerUserName = "";
                         storeBalanceDetailInfo.TradeNo         = this.offlineOrder.OrderId;
                         storeBalanceDetailInfo.CreateTime      = DateTime.Now;
                         storeBalanceDetailInfo.PlatCommission  = decimal.Zero;
                         if (StoreBalanceHelper.AddBalanceDetailInfo(storeBalanceDetailInfo))
                         {
                             StoresInfo storesInfo = storeById;
                             storesInfo.Balance += this.offlineOrder.PayAmount;
                             StoresHelper.UpdateStore(storeById);
                         }
                     }
                     if (storeById != null)
                     {
                         VShopHelper.AppPsuhRecordForStore(storeById.StoreId, this.offlineOrder.OrderId, "", EnumPushStoreAction.StoreOrderPayed);
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             IDictionary <string, string> dictionary = new Dictionary <string, string>();
             dictionary.Add("ErrorMessage", ex.Message);
             dictionary.Add("StackTrace", ex.StackTrace);
             if (ex.InnerException != null)
             {
                 dictionary.Add("InnerException", ex.InnerException.ToString());
             }
             if (ex.GetBaseException() != null)
             {
                 dictionary.Add("BaseException", ex.GetBaseException().Message);
             }
             if (ex.TargetSite != (MethodBase)null)
             {
                 dictionary.Add("TargetSite", ex.TargetSite.ToString());
             }
             dictionary.Add("ExSource", ex.Source);
             Globals.AppendLog(dictionary, "支付更新订单收款记录或者消息通知时出错:" + ex.Message, "", "", "UserPay1");
         }
         this.ResponseReturn(true, "");
     }
 }
 private void UserPayOrder()
 {
     if (this.Order.OrderStatus == OrderStatus.Closed)
     {
         OrderHelper.SetExceptionOrder(this.Order.OrderId, "支付异常,请联系买家退款");
         Messenger.OrderException(Users.GetUser(this.Order.UserId), this.Order, "订单支付异常,请联系卖家退款.订单号:" + this.Order.OrderId);
     }
     else if (this.Order.OrderStatus == OrderStatus.BuyerAlreadyPaid)
     {
         base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}<br><a href=\"{2}\">查看订单</a></p>", this.OrderId, this.Amount.ToString("F"), this.GetReturnLink(this.Order.OrderSource)));
     }
     else
     {
         int maxCount        = 0;
         int yetOrderNum     = 0;
         int currentOrderNum = 0;
         if (this.Order.GroupBuyId > 0)
         {
             GroupBuyInfo groupBuy = TradeHelper.GetGroupBuy(this.Order.GroupBuyId);
             if (groupBuy == null || groupBuy.Status != GroupBuyStatus.UnderWay)
             {
                 base.Response.Write($"<p style=\"font-size:16px;\">订单为团购订单,团购活动已结束,支付失败<br><a href=\"{this.GetReturnLink(this.Order.OrderSource)}\">查看订单</a></p>");
                 return;
             }
             yetOrderNum     = TradeHelper.GetOrderCount(this.Order.GroupBuyId);
             currentOrderNum = this.Order.GetGroupBuyOerderNumber();
             maxCount        = groupBuy.MaxCount;
             if (maxCount < yetOrderNum + currentOrderNum)
             {
                 base.Response.Write($"<p style=\"font-size:16px;\">订单为团购订单,订购数量超过订购总数,支付失败<br><a href=\"{this.GetReturnLink(this.Order.OrderSource)}\">查看订单</a></p>");
                 return;
             }
         }
         if (this.Order.CheckAction(OrderActions.BUYER_PAY) && TradeHelper.UpdateOrderStatus(this.Order))
         {
             Task.Factory.StartNew(delegate
             {
                 TradeHelper.UserPayOrder(this.Order, false, true);
                 try
                 {
                     if (this.offlineOrder != null)
                     {
                         OrderHelper.UpdateOrderPaymentTypeOfAPI(this.Order);
                         OrderHelper.ConfirmTakeGoods(this.Order, true);
                     }
                     if (this.Order.GroupBuyId > 0 && maxCount == yetOrderNum + currentOrderNum)
                     {
                         TradeHelper.SetGroupBuyEndUntreated(this.Order.GroupBuyId);
                     }
                     if (this.Order.UserId != 0 && this.Order.UserId != 1100)
                     {
                         Hidistro.Entities.Members.MemberInfo user = Users.GetUser(this.Order.UserId);
                         string verificationPasswords = "";
                         if (this.Order.OrderType == OrderType.ServiceOrder)
                         {
                             verificationPasswords = OrderHelper.GetVerificationPasswordsOfOrderId(this.Order.OrderId);
                         }
                         if (user != null)
                         {
                             Messenger.OrderPayment(user, this.Order, this.Order.GetTotal(false), verificationPasswords);
                         }
                     }
                     StoresInfo storesInfo = null;
                     if (this.Order.StoreId > 0)
                     {
                         storesInfo = DepotHelper.GetStoreById(this.Order.StoreId);
                     }
                     if (storesInfo != null)
                     {
                         VShopHelper.AppPsuhRecordForStore(storesInfo.StoreId, this.Order.OrderId, "", EnumPushStoreAction.StoreOrderPayed);
                         if (this.offlineOrder == null)
                         {
                             if (this.Order.ShippingModeId == -2)
                             {
                                 VShopHelper.AppPsuhRecordForStore(storesInfo.StoreId, this.Order.OrderId, "", EnumPushStoreAction.TakeOnStoreOrderWaitConfirm);
                             }
                             else
                             {
                                 VShopHelper.AppPsuhRecordForStore(storesInfo.StoreId, this.Order.OrderId, "", EnumPushStoreAction.StoreOrderWaitSendGoods);
                             }
                         }
                     }
                     if (this.offlineOrder == null)
                     {
                         ShippersInfo defaultOrFirstShipper = SalesHelper.GetDefaultOrFirstShipper(0);
                         Messenger.OrderPaymentToShipper(defaultOrFirstShipper, storesInfo, null, this.Order, this.Order.GetTotal(false));
                     }
                     this.Order.OnPayment();
                 }
                 catch (Exception ex)
                 {
                     IDictionary <string, string> dictionary = new Dictionary <string, string>();
                     dictionary.Add("ErrorMessage", ex.Message);
                     dictionary.Add("StackTrace", ex.StackTrace);
                     if (ex.InnerException != null)
                     {
                         dictionary.Add("InnerException", ex.InnerException.ToString());
                     }
                     if (ex.GetBaseException() != null)
                     {
                         dictionary.Add("BaseException", ex.GetBaseException().Message);
                     }
                     if (ex.TargetSite != (MethodBase)null)
                     {
                         dictionary.Add("TargetSite", ex.TargetSite.ToString());
                     }
                     dictionary.Add("ExSource", ex.Source);
                     Globals.AppendLog(dictionary, "支付更新订单收款记录或者消息通知时出错:" + ex.Message, "", "", "UserPay");
                 }
                 this.Order.OnPayment();
             });
             base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}<br><a href=\"{2}\">查看订单</a></p>", this.OrderId, this.Amount.ToString("F"), this.GetReturnLink(this.Order.OrderSource)));
         }
         else
         {
             base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}<br><a href=\"{2}\">查看订单</a></p>", this.OrderId, this.Amount.ToString("F"), this.GetReturnLink(this.Order.OrderSource)));
         }
     }
 }
		private void UserPayOrder()
		{
			if (this.Order != null && this.Order.OrderStatus == OrderStatus.Closed)
			{
				OrderHelper.SetExceptionOrder(this.Order.OrderId, "支付异常,请联系买家退款");
				Messenger.OrderException(Users.GetUser(this.Order.UserId), this.Order, "订单支付异常,请联系卖家退款.订单号:" + this.Order.OrderId);
				base.Response.Write("success");
			}
			else if (this.Order.OrderStatus == OrderStatus.BuyerAlreadyPaid)
			{
				Globals.WriteLog(new NameValueCollection
				{
					this.Page.Request.Form,
					this.Page.Request.QueryString
				}, "订单状态为已支付", "", "", "alipay");
				base.Response.Write("success");
			}
			else
			{
				int maxCount = 0;
				int yetOrderNum = 0;
				int currentOrderNum = 0;
				if (this.Order.GroupBuyId > 0)
				{
					GroupBuyInfo groupBuy = TradeHelper.GetGroupBuy(this.Order.GroupBuyId);
					if (groupBuy == null || groupBuy.Status != GroupBuyStatus.UnderWay)
					{
						Globals.WriteLog(new NameValueCollection
						{
							this.Page.Request.Form,
							this.Page.Request.QueryString
						}, "错误的团购信息或者状态", "", "", "alipay");
						base.Response.Write("success");
						return;
					}
					yetOrderNum = TradeHelper.GetOrderCount(this.Order.GroupBuyId);
					currentOrderNum = this.Order.GetGroupBuyOerderNumber();
					maxCount = groupBuy.MaxCount;
					if (maxCount < yetOrderNum + currentOrderNum)
					{
						Globals.WriteLog(new NameValueCollection
						{
							this.Page.Request.Form,
							this.Page.Request.QueryString
						}, "团购数量已超过指定数量错", "", "", "alipay");
						base.Response.Write("success");
						return;
					}
				}
				if (this.Order.CheckAction(OrderActions.BUYER_PAY) && TradeHelper.UpdateOrderStatus(this.Order))
				{
					Task.Factory.StartNew(delegate
					{
						TradeHelper.UserPayOrder(this.Order, false, true);
						try
						{
							if (this.offlineOrder != null)
							{
								OrderHelper.UpdateOrderPaymentTypeOfAPI(this.Order);
								OrderHelper.ConfirmTakeGoods(this.Order, true);
							}
							if (this.Order.GroupBuyId > 0 && maxCount == yetOrderNum + currentOrderNum)
							{
								TradeHelper.SetGroupBuyEndUntreated(this.Order.GroupBuyId);
							}
							if (this.Order.UserId != 0 && this.Order.UserId != 1100)
							{
								Hidistro.Entities.Members.MemberInfo user = Users.GetUser(this.Order.UserId);
								string verificationPasswords = "";
								if (this.Order.OrderType == OrderType.ServiceOrder)
								{
									verificationPasswords = OrderHelper.GetVerificationPasswordsOfOrderId(this.Order.OrderId);
								}
								if (user != null)
								{
									Messenger.OrderPayment(user, this.Order, this.Order.GetTotal(false), verificationPasswords);
								}
							}
							StoresInfo storesInfo = null;
							if (this.Order.StoreId > 0)
							{
								storesInfo = DepotHelper.GetStoreById(this.Order.StoreId);
							}
							if (storesInfo != null)
							{
								VShopHelper.AppPsuhRecordForStore(storesInfo.StoreId, this.Order.OrderId, "", EnumPushStoreAction.StoreOrderPayed);
								if (this.offlineOrder == null)
								{
									if (this.Order.ShippingModeId == -2)
									{
										VShopHelper.AppPsuhRecordForStore(storesInfo.StoreId, this.Order.OrderId, "", EnumPushStoreAction.TakeOnStoreOrderWaitConfirm);
									}
									else
									{
										VShopHelper.AppPsuhRecordForStore(storesInfo.StoreId, this.Order.OrderId, "", EnumPushStoreAction.StoreOrderWaitSendGoods);
									}
								}
							}
							if (this.offlineOrder == null)
							{
								ShippersInfo defaultOrFirstShipper = SalesHelper.GetDefaultOrFirstShipper(0);
								Messenger.OrderPaymentToShipper(defaultOrFirstShipper, storesInfo, null, this.Order, this.Order.GetTotal(false));
							}
							this.Order.OnPayment();
						}
						catch (Exception ex)
						{
							IDictionary<string, string> dictionary = new Dictionary<string, string>();
							dictionary.Add("ErrorMessage", ex.Message);
							dictionary.Add("StackTrace", ex.StackTrace);
							if (ex.InnerException != null)
							{
								dictionary.Add("InnerException", ex.InnerException.ToString());
							}
							if (ex.GetBaseException() != null)
							{
								dictionary.Add("BaseException", ex.GetBaseException().Message);
							}
							if (ex.TargetSite != (MethodBase)null)
							{
								dictionary.Add("TargetSite", ex.TargetSite.ToString());
							}
							dictionary.Add("ExSource", ex.Source);
							Globals.AppendLog(dictionary, "支付更新订单收款记录或者消息通知时出错:" + ex.Message, "", "", "UserPay");
						}
					});
					base.Response.Write("success");
				}
				else
				{
					Globals.WriteLog(new NameValueCollection
					{
						this.Page.Request.Form,
						this.Page.Request.QueryString
					}, "订单不是待支付状态,或者更新订单状态失败", "", "", "alipay");
					base.Response.Write("success");
				}
			}
		}