private void OrderDetail(string orderId, DateTime orderDate) { DistributorOrderingProfile distributorOrderingProfile = null; var membershipUser = (MembershipUser <DistributorProfileModel>)Membership.GetUser(); if (membershipUser != null && membershipUser.Value != null) { distributorOrderingProfile = MyHerbalife3.Ordering.Providers.DistributorOrderingProfileProvider.GetProfile(DistributorID, "CN"); } var obj = new MyHerbalife3.Ordering.Providers.MyHLShoppingCartView(); var orderDetails = obj.GetOrdersWithDetail(DistributorID, distributorOrderingProfile.CNCustomorProfileID, "zh-CN", orderDate.AddDays(-1), orderDate.AddDays(1), MyHerbalife3.Ordering.Providers.China.OrderStatusFilterType.All, "", "", false, false, orderId); if (orderDetails != null && orderDetails.Any() && orderDetails.FirstOrDefault().DonationAmount > 0) { Donation.Visible = true; DonationGrd.DataSource = orderDetails; DonationGrd.DataBind(); } if (orderDetails != null) { view = orderDetails.FirstOrDefault(); } if (view != null && membershipUser != null && distributorOrderingProfile != null) { lblOrdernumber.Text = view.OrderNumber ?? string.Empty; lblOrderMonth.Text = view.OrderMonth ?? string.Empty; lblOrderStatus.Text = view.OrderStatus ?? string.Empty; lblShipStore.Text = view.StoreInfo ?? string.Empty; lblCustomerName.Text = membershipUser.Value.FirstNameLocal ?? string.Empty; lblCustomerNumber.Text = membershipUser.UserName ?? string.Empty; lblSalesChannels.Text = view.ChannelInfo ?? string.Empty; lblShippingAddress.Text = view.Address ?? String.Empty; DateTime Recivedate = view.DateTimeForOrder; lbldeliverydate.Text = Recivedate.ToString("yyyy-MM-dd"); if (membershipUser.IsOnline == true) { lblProcessingStore.Text = "在线订购"; lblReceivingMode.Text = "送货上门"; } var modifiedcartItems = new List <MyHerbalife3.Ordering.Providers.MyHLProductItemView>(); foreach (var cartitem in view.CartItems) { var sku = Providers.CatalogProvider.GetCatalogItem(cartitem.SKU, "CN"); if (sku.ProductCategory == "ETO" && view.OrderHeaderId != 0) { var Tickets = new MyHerbalife3.Ordering.Providers.MyHLShoppingCart.Ticket { quantity = cartitem.Quantity, ticketSKU = cartitem.SKU }; TicketDetails.Add(Tickets); } if (sku != null) { cartitem.RetailPrice = sku.ListPrice * cartitem.Quantity; modifiedcartItems.Add(cartitem); } } view.CartItems = modifiedcartItems; ProductList.DataSource = view.CartItems; ProductList.DataBind(); if (view.OrderStatus == "取消订单") { btnQRcodeDownload.Visible = false; } if (view.OrderHeaderId != 0) { var orderHeaderList = new List <int>(); orderHeaderList.Add(view.OrderHeaderId); var paymentDetails = MyHerbalife3.Ordering.Providers.China.OrderProvider.GetPaymentDetails(orderHeaderList); if (paymentDetails != null) { paymentDetails.PaymentDetails.ForEach(c => { c.PaymentDate = c.PaymentDate.AddHours(8); c.Amount = c.Amount + view.DonationAmount; }); DateTime ChinaTime = Convert.ToDateTime(paymentDetails.PaymentDetails[0].PaymentDate); lblNTSdate.Text = ChinaTime.ToString("yyyy-MM-dd"); lblPaymentTime.Text = ChinaTime.ToString("yyyy-MM-dd HH:mm:ss"); PaymentDetail.DataSource = paymentDetails.PaymentDetails; PaymentDetail.DataBind(); } else { btnQRcodeDownload.Visible = false; } } else { btnQRcodeDownload.Visible = false; } } }