public IActionResult Upsert(ServiceOrderStatus service_order_status)
 {
     if (ModelState.IsValid)
     {
         if (service_order_status.Color == null)
         {
             service_order_status.Color = "white";
         }
         if (service_order_status.IconPicture == null)
         {
             service_order_status.IconPicture = string.Empty;
         }
         if (service_order_status.ServiceOrderStatusId == 0)
         {
             _data_repository.ServiceOrdersStatus.AddNew(service_order_status, "insert user");
         }
         else
         {
             //  _unitOfWork.Category.Update(category);
             _data_repository.ServiceOrdersStatus.Update(service_order_status, "user update");
         }
         return(RedirectToAction(nameof(Index)));
     }
     return(View(service_order_status));
 }
Esempio n. 2
0
 public ServiceOrder(Client client)
 {
     ServiceOrderId = Guid.NewGuid();
     CreationDate   = DateTime.Now;
     Client         = client;
     Status         = ServiceOrderStatus.Active;
 }
 public ServiceOrderDTO(Guid id, DateTime creationDate, ClientDTO client, ServiceOrderStatus status)
 {
     Id           = id;
     CreationDate = creationDate;
     Client       = client;
     Status       = status;
 }
Esempio n. 4
0
        private ServiceOrderStatus GetOrderStatus(OrderInfo order, IList <OrderVerificationItemInfo> orderVerificationItems = null)
        {
            ServiceOrderStatus result = ServiceOrderStatus.Finished;

            if (order.OrderStatus == OrderStatus.WaitBuyerPay)
            {
                result = ServiceOrderStatus.WaitBuyerPay;
            }
            else if (order.OrderStatus == OrderStatus.Closed)
            {
                result = ServiceOrderStatus.Closed;
            }
            else if (order.OrderStatus == OrderStatus.Finished)
            {
                result = ServiceOrderStatus.Finished;
            }
            else
            {
                IList <OrderVerificationItemInfo> source = orderVerificationItems;
                if (orderVerificationItems == null)
                {
                    source = TradeHelper.GetOrderVerificationItems(order.OrderId);
                }
                if (source.Any((OrderVerificationItemInfo d) => d.VerificationStatus == 0.GetHashCode()))
                {
                    result = ServiceOrderStatus.WaitConsumption;
                }
                else if (source.Any((OrderVerificationItemInfo d) => d.VerificationStatus == 3.GetHashCode()))
                {
                    result = ServiceOrderStatus.Expired;
                }
                else if (source.Count() > 0 && source.Count(delegate(OrderVerificationItemInfo d)
                {
                    int verificationStatus = d.VerificationStatus;
                    VerificationStatus verificationStatus2 = VerificationStatus.Refunded;
                    int result2;
                    if (verificationStatus != verificationStatus2.GetHashCode())
                    {
                        int verificationStatus3 = d.VerificationStatus;
                        verificationStatus2 = VerificationStatus.ApplyRefund;
                        result2 = ((verificationStatus3 != verificationStatus2.GetHashCode()) ? 1 : 0);
                    }
                    else
                    {
                        result2 = 0;
                    }
                    return((byte)result2 != 0);
                }) == 0)
                {
                    result = ServiceOrderStatus.Refunding;
                }
            }
            return(result);
        }
        //  Update and Insert  Action
        //  if id is null => Insert
        //        else    => Insert
        public IActionResult Upsert(int?id)
        {
            ServiceOrderStatus service_satatus = new ServiceOrderStatus();

            if (id == null)
            {
                return(View(service_satatus));
            }
            service_satatus = _data_repository.ServiceOrdersStatus.GetById(id.GetValueOrDefault());
            if (service_satatus == null)
            {
                return(NotFound());
            }
            return(View(service_satatus));
        }
        public int AddNew(ServiceOrderStatus service_order_status, string user)
        {
            Object result = db.GetValueFromSp <int>("ServiceOrderStatus_AddNew"
                                                    , new List <SqlParameter>()
            {
                new SqlParameter("@Name", System.Data.SqlDbType.VarChar, 20),
                new SqlParameter("@Color", System.Data.SqlDbType.VarChar, 20),
                new SqlParameter("@IconPicture", System.Data.SqlDbType.VarChar, 50),
                new SqlParameter("@User", System.Data.SqlDbType.VarChar, 100)
            }
                                                    , service_order_status.StatusName
                                                    , service_order_status.Color
                                                    , service_order_status.IconPicture
                                                    , user);

            return(Convert.ToInt32(result));
        }
        public bool Update(ServiceOrderStatus service_order_status, string user)
        {
            object result = db.GetValueFromSp <int>("ServiceOrderStatus_Update"
                                                    , new List <SqlParameter>()
            {
                new SqlParameter("@ServiceOrderStatusId", System.Data.SqlDbType.Int),
                new SqlParameter("@StatusName", System.Data.SqlDbType.VarChar, 20),
                new SqlParameter("@Color", System.Data.SqlDbType.VarChar, 20),
                new SqlParameter("@IconPicture", System.Data.SqlDbType.VarChar, 50),
                new SqlParameter("@User", System.Data.SqlDbType.VarChar, 100)
            }
                                                    , service_order_status.ServiceOrderStatusId
                                                    , service_order_status.StatusName
                                                    , service_order_status.Color
                                                    , service_order_status.IconPicture
                                                    , user);

            return(true);    // (result > 0);
        }
 public ChangeOrderServiceStatusRule(ServiceOrderStatus oldStatus, ServiceOrderStatus newStatus)
 {
     this.oldStatus = oldStatus;
     this.newStatus = newStatus;
 }
Esempio n. 9
0
 public void CancelServiceOrder()
 {
     CheckRule(new ChangeOrderServiceStatusRule(Status, ServiceOrderStatus.Inactive));
     Status = ServiceOrderStatus.Inactive;
 }
Esempio n. 10
0
 public void UpdateServiceOrderStatus(ServiceOrderStatus serviceOrderStatus)
 {
     _db.Update(serviceOrderStatus);
 }
Esempio n. 11
0
 public void InsertServiceOrderStatus(ServiceOrderStatus serviceOrderStatus)
 {
     _db.Insert(serviceOrderStatus);
 }
Esempio n. 12
0
        private void BindOrderInfo()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            if (this.order.BalanceAmount > decimal.Zero)
            {
                this.litBalanceAmount.Text = this.order.BalanceAmount.F2ToString("f2");
            }
            else
            {
                this.liBalanceAmount.Visible = false;
            }
            DateTime?nullable;
            DateTime dateTime;

            if (this.order.PreSaleId > 0)
            {
                this.litDeposit.Text = this.order.Deposit.F2ToString("f2");
                this.litFinal.Text   = this.order.FinalPayment.F2ToString("f2");
                nullable             = this.order.DepositDate;
                if (nullable.HasValue)
                {
                    Literal literal = this.litDepositDate;
                    nullable     = this.order.DepositDate;
                    literal.Text = nullable.ToString();
                }
                DateTime payDate = this.order.PayDate;
                if (this.order.PayDate != DateTime.MinValue)
                {
                    Literal literal2 = this.litFinalDate;
                    dateTime      = this.order.PayDate;
                    literal2.Text = dateTime.ToString();
                }
            }
            if (this.order.OrderStatus == OrderStatus.SellerAlreadySent && this.order.ItemStatus == OrderItemStatus.Nomarl)
            {
                this.ensureRecieved.Visible = true;
            }
            else
            {
                this.ensureRecieved.Visible = false;
            }
            if (this.order.OrderStatus == OrderStatus.SellerAlreadySent || this.order.OrderStatus == OrderStatus.Finished)
            {
                this.divOrderBtn.Visible = false;
            }
            if (string.IsNullOrEmpty(this.order.TakeCode) || string.IsNullOrEmpty(masterSettings.HiPOSAppId) || this.order.OrderStatus == OrderStatus.Finished || this.order.OrderStatus == OrderStatus.Closed)
            {
                this.lookupQRCode.Visible = false;
            }
            ProductPreSaleInfo productPreSaleInfo = null;
            int paymentTypeId;

            if (this.order.OrderStatus == OrderStatus.WaitBuyerPay && this.order.Gateway != EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.CashOnDelivery, 1) && this.order.PaymentTypeId != -3)
            {
                if (this.order.PreSaleId > 0)
                {
                    productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(this.order.PreSaleId);
                    nullable           = this.order.DepositDate;
                    if (!nullable.HasValue)
                    {
                        if (productPreSaleInfo.PreSaleEndDate > DateTime.Now)
                        {
                            this.btnToPay.Visible = true;
                            AttributeCollection attributes = this.btnToPay.Attributes;
                            paymentTypeId = this.order.PaymentTypeId;
                            attributes.Add("PaymentTypeId", paymentTypeId.ToString());
                            this.btnToPay.Attributes.Add("OrderId", this.orderId);
                            this.btnToPay.Attributes.Add("orderTotal", (this.order.Deposit - this.order.BalanceAmount).F2ToString("f2"));
                        }
                    }
                    else if (!(productPreSaleInfo.PaymentStartDate > DateTime.Now) && !(productPreSaleInfo.PaymentEndDate < DateTime.Now))
                    {
                        this.btnToPay.Visible = true;
                        AttributeCollection attributes2 = this.btnToPay.Attributes;
                        paymentTypeId = this.order.PaymentTypeId;
                        attributes2.Add("PaymentTypeId", paymentTypeId.ToString());
                        this.btnToPay.Attributes.Add("OrderId", this.orderId);
                        this.btnToPay.Attributes.Add("orderTotal", this.order.FinalPayment.F2ToString("f2"));
                    }
                }
                else
                {
                    AttributeCollection attributes3 = this.btnToPay.Attributes;
                    paymentTypeId = this.order.PaymentTypeId;
                    attributes3.Add("PaymentTypeId", paymentTypeId.ToString());
                    this.btnToPay.Visible = true;
                    this.btnToPay.Attributes.Add("OrderId", this.orderId);
                    this.btnToPay.Attributes.Add("orderTotal", this.order.GetTotal(true).F2ToString("f2"));
                    if (HiContext.Current.SiteSettings.OpenMultStore && this.order.StoreId > 0 && !SettingsManager.GetMasterSettings().Store_IsOrderInClosingTime)
                    {
                        StoresInfo storeById = StoresHelper.GetStoreById(this.order.StoreId);
                        dateTime = DateTime.Now;
                        string str = dateTime.ToString("yyyy-MM-dd");
                        dateTime = storeById.OpenStartDate;
                        nullable = (str + " " + dateTime.ToString("HH:mm")).ToDateTime();
                        DateTime value = nullable.Value;
                        dateTime = DateTime.Now;
                        string str2 = dateTime.ToString("yyyy-MM-dd");
                        dateTime = storeById.OpenEndDate;
                        nullable = (str2 + " " + dateTime.ToString("HH:mm")).ToDateTime();
                        DateTime dateTime2 = nullable.Value;
                        if (dateTime2 <= value)
                        {
                            dateTime2 = dateTime2.AddDays(1.0);
                        }
                        if (DateTime.Now < value || DateTime.Now > dateTime2)
                        {
                            this.btnToPay.Attributes.Add("NeedNotInTimeTip", "1");
                        }
                    }
                }
                if (this.order.Gateway == EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.OfflinePay, 1))
                {
                    this.btnToPay.InnerText = "线下支付帮助";
                    this.btnToPay.HRef      = "FinishOrder.aspx?OrderId=" + this.order.OrderId + "&onlyHelp=true";
                }
            }
            if (this.order.ReducedPromotionAmount <= decimal.Zero)
            {
                this.liFullReduction.Visible = false;
            }
            LineItemInfo value2 = this.order.LineItems.FirstOrDefault().Value;
            string       text   = "长期有效";
            int          num;

            if (!value2.IsValid)
            {
                nullable = value2.ValidStartDate;
                if (nullable.HasValue)
                {
                    nullable = value2.ValidEndDate;
                    num      = (nullable.HasValue ? 1 : 0);
                    goto IL_06a5;
                }
            }
            num = 0;
            goto IL_06a5;
IL_06a5:
            if (num != 0)
            {
                nullable = value2.ValidStartDate;
                dateTime = nullable.Value;
                string arg = dateTime.ToString("yyyy-MM-dd");
                nullable = value2.ValidEndDate;
                dateTime = nullable.Value;
                text     = string.Format("有效期&nbsp;&nbsp;{0} ~ {1}", arg, dateTime.ToString("yyyy-MM-dd"));
            }
            this.lit_ValidDate.Text = text;
            IList <OrderVerificationItemInfo> orderVerificationItems = TradeHelper.GetOrderVerificationItems(this.order.OrderId);
            ServiceOrderStatus serviceOrderStatus = this.GetOrderStatus(this.order, orderVerificationItems);

            this.litOrderStatus.Text = ((Enum)(object)serviceOrderStatus).ToDescription();
            this.CreateVerificationCodeQRCode(orderVerificationItems);
            this.rptVerCode.DataSource     = orderVerificationItems;
            this.rptVerCode.ItemDataBound += this.rptVerCode_ItemDataBound;
            this.rptVerCode.DataBind();
            this.litOrderId.Text = this.orderId;
            Literal literal3 = this.litOrderDate;

            dateTime      = this.order.OrderDate;
            literal3.Text = dateTime.ToString();
            this.litTotalPrice.SetWhenIsNotNull(this.order.GetAmount(false).F2ToString("f2"));
            Literal control = this.litPayTime;
            object  value3;

            if (!(this.order.PayDate != DateTime.MinValue))
            {
                value3 = "";
            }
            else
            {
                dateTime = this.order.PayDate;
                value3   = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
            }
            control.SetWhenIsNotNull((string)value3);
            HtmlInputHidden control2 = this.orderStatus;

            paymentTypeId = (int)this.order.OrderStatus;
            control2.SetWhenIsNotNull(paymentTypeId.ToString());
            this.hidOrderId.SetWhenIsNotNull(this.orderId.ToString());
            this.litPaymentMode.SetWhenIsNotNull(this.order.PaymentType);
            this.litShipToDate.SetWhenIsNotNull(this.order.ShipToDate);
            if (this.order.PreSaleId > 0)
            {
                this.litBuildPrice.SetWhenIsNotNull((this.order.Deposit + this.order.FinalPayment).F2ToString("f2"));
            }
            else
            {
                this.litBuildPrice.SetWhenIsNotNull(this.order.GetPayTotal().F2ToString("f2"));
            }
            this.litRemark.SetWhenIsNotNull(this.order.Remark);
            this.litTakeCode.SetWhenIsNotNull((this.order.ShippingModeId == -2) ? this.order.TakeCode : "");
            this.litFreight.SetWhenIsNotNull(this.order.AdjustedFreight.F2ToString("f2"));
            this.litFreight2.SetWhenIsNotNull(this.order.AdjustedFreight.F2ToString("f2"));
            this.litFullCapacityReduction.SetWhenIsNotNull("-" + this.order.ReducedPromotionAmount.F2ToString("f2"));
            if (this.order.PreSaleId > 0)
            {
                if (productPreSaleInfo == null)
                {
                    productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(this.order.PreSaleId);
                }
                nullable = this.order.DepositDate;
                if (!nullable.HasValue)
                {
                    this.hidpresaleStaut.Value = "1";
                    if (this.order.OrderStatus == OrderStatus.Closed)
                    {
                        this.hidpresaleStaut.Value = "6";
                    }
                }
                else if (productPreSaleInfo.PaymentStartDate > DateTime.Now)
                {
                    this.hidpresaleStaut.Value = "2";
                }
                else if (productPreSaleInfo.PaymentEndDate < DateTime.Now)
                {
                    if (this.order.PayDate == DateTime.MinValue)
                    {
                        this.hidpresaleStaut.Value = "5";
                    }
                    else
                    {
                        this.hidpresaleStaut.Value = "4";
                    }
                }
                else if (this.order.PayDate == DateTime.MinValue)
                {
                    this.hidpresaleStaut.Value = "3";
                }
                else
                {
                    this.hidpresaleStaut.Value = "4";
                }
            }
        }
 public ServiceOrderDTO(Guid id, DateTime creationDate, ServiceOrderStatus status)
 {
     Id           = id;
     CreationDate = creationDate;
     Status       = status;
 }
Esempio n. 14
0
 private void rptOrders_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         HtmlAnchor         htmlAnchor           = (HtmlAnchor)e.Item.FindControl("lkbtnCouponCode");
         HtmlAnchor         htmlAnchor2          = (HtmlAnchor)e.Item.FindControl("lkbtnApplyForRefund");
         HtmlAnchor         htmlAnchor3          = (HtmlAnchor)e.Item.FindControl("lnkClose");
         HtmlAnchor         htmlAnchor4          = (HtmlAnchor)e.Item.FindControl("lkbtnViewMessage");
         HtmlAnchor         htmlAnchor5          = (HtmlAnchor)e.Item.FindControl("lkbtnProductReview");
         Literal            literal              = (Literal)e.Item.FindControl("ltlOrderItems");
         Literal            literal2             = (Literal)e.Item.FindControl("ltlOrderGifts");
         HtmlGenericControl htmlGenericControl   = e.Item.FindControl("panelOperaters") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl2  = e.Item.FindControl("divToDetail") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl3  = e.Item.FindControl("divOrderStatus") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl4  = e.Item.FindControl("divOrderError") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl5  = e.Item.FindControl("divOrderGifts") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl6  = e.Item.FindControl("divOrderItems") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl7  = (HtmlGenericControl)e.Item.FindControl("OrderIdSpan");
         HtmlGenericControl htmlGenericControl8  = (HtmlGenericControl)e.Item.FindControl("PayMoneySpan");
         HtmlGenericControl htmlGenericControl9  = (HtmlGenericControl)e.Item.FindControl("TakeCodeDIV");
         HtmlAnchor         htmlAnchor6          = (HtmlAnchor)e.Item.FindControl("lnkViewLogistics");
         HtmlAnchor         htmlAnchor7          = (HtmlAnchor)e.Item.FindControl("lnkToPay");
         HtmlAnchor         htmlAnchor8          = (HtmlAnchor)e.Item.FindControl("lnkHelpLink");
         HtmlAnchor         htmlAnchor9          = (HtmlAnchor)e.Item.FindControl("lnkFinishOrder");
         HtmlAnchor         htmlAnchor10         = (HtmlAnchor)e.Item.FindControl("lnkViewTakeCodeQRCode");
         HtmlAnchor         htmlAnchor11         = (HtmlAnchor)e.Item.FindControl("lnkCertification");
         HtmlGenericControl htmlGenericControl10 = (HtmlGenericControl)e.Item.FindControl("divSendRedEnvelope");
         OrderStatus        orderStatus          = (OrderStatus)DataBinder.Eval(e.Item.DataItem, "OrderStatus");
         Repeater           repeater             = (Repeater)e.Item.FindControl("Repeater1");
         Repeater           repeater2            = (Repeater)e.Item.FindControl("rptPointGifts");
         this.paymenttypeselect = (Common_WAPPaymentTypeSelect)this.FindControl("paymenttypeselect");
         Literal   literal3  = (Literal)e.Item.FindControl("litGiftTitle");
         string    text      = DataBinder.Eval(e.Item.DataItem, "OrderId").ToString();
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(text);
         if (orderInfo != null)
         {
             if (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid || orderInfo.OrderStatus == OrderStatus.Finished || orderInfo.OrderStatus == OrderStatus.WaitReview || orderInfo.OrderStatus == OrderStatus.History)
             {
                 WeiXinRedEnvelopeInfo openedWeiXinRedEnvelope = WeiXinRedEnvelopeProcessor.GetOpenedWeiXinRedEnvelope();
                 bool visible = false;
                 if (openedWeiXinRedEnvelope != null && openedWeiXinRedEnvelope.EnableIssueMinAmount <= orderInfo.GetPayTotal() && orderInfo.OrderDate >= openedWeiXinRedEnvelope.ActiveStartTime && orderInfo.OrderDate <= openedWeiXinRedEnvelope.ActiveEndTime)
                 {
                     visible = true;
                 }
                 if (htmlGenericControl10 != null)
                 {
                     htmlGenericControl10.Visible = visible;
                     if (this.isVShop)
                     {
                         htmlGenericControl10.InnerHtml = "<a href=\"/vshop/SendRedEnvelope.aspx?OrderId=" + orderInfo.OrderId + "\"></a>";
                     }
                     else
                     {
                         htmlGenericControl10.InnerHtml = "";
                         string text2 = Globals.HttpsFullPath("/vshop/SendRedEnvelope.aspx?OrderId=" + orderInfo.OrderId);
                         htmlGenericControl10.Attributes.Add("onclick", string.Format("ShowMsg('{0}','{1}')", "代金红包请前往微信端领取!", "false"));
                     }
                 }
             }
             this.paymenttypeselect.ClientType = base.ClientType;
             htmlGenericControl4.Visible       = (orderInfo.IsError && orderInfo.CloseReason != "订单已退款完成");
             htmlGenericControl3.Visible       = !orderInfo.IsError;
             htmlGenericControl5.Visible       = (orderInfo.LineItems.Count() == 0);
             htmlGenericControl6.Visible       = (orderInfo.LineItems.Count() > 0);
             htmlAnchor2.HRef   = "ApplyRefund.aspx?OrderId=" + text;
             htmlAnchor.Visible = false;
             htmlAnchor.HRef    = "MemberOrdersVCode?OrderId=" + text;
             HtmlGenericControl htmlGenericControl11 = (HtmlGenericControl)e.Item.FindControl("OrderSupplierH3");
             string             text3 = string.Empty;
             if (htmlGenericControl11 != null)
             {
                 text3 = htmlGenericControl11.Attributes["class"];
                 text3 = ((!string.IsNullOrEmpty(text3)) ? text3.Replace(" ztitle", "").Replace("stitle", "") : "");
             }
             if (orderInfo.OrderStatus != OrderStatus.WaitBuyerPay || !(orderInfo.ParentOrderId == "-1") || !orderInfo.OrderId.Contains("P"))
             {
                 if (HiContext.Current.SiteSettings.OpenMultStore && orderInfo.StoreId > 0 && !string.IsNullOrWhiteSpace(orderInfo.StoreName))
                 {
                     htmlGenericControl7.InnerText = orderInfo.StoreName;
                     text3 += " mtitle";
                 }
                 else if (orderInfo.StoreId == 0 && HiContext.Current.SiteSettings.OpenSupplier && orderInfo.SupplierId > 0)
                 {
                     htmlGenericControl7.InnerText = orderInfo.ShipperName;
                     text3 += " stitle";
                 }
                 else
                 {
                     htmlGenericControl7.InnerText = "平台";
                     text3 += " ztitle";
                 }
                 htmlGenericControl11.Attributes["class"] = text3;
                 if (orderInfo.LineItems.Count <= 0)
                 {
                     literal3.Text = "(礼)";
                 }
             }
             else
             {
                 htmlGenericControl7.InnerText            = orderInfo.OrderId;
                 htmlGenericControl11.Attributes["class"] = text3;
             }
             if (orderInfo.PreSaleId > 0)
             {
                 htmlGenericControl8.InnerText = (orderInfo.Deposit + orderInfo.FinalPayment).F2ToString("f2");
             }
             else
             {
                 htmlGenericControl8.InnerText = Convert.ToDecimal(DataBinder.Eval(e.Item.DataItem, "OrderTotal")).F2ToString("f2");
             }
             if (htmlGenericControl2 != null)
             {
                 if (orderInfo.OrderType == OrderType.ServiceOrder)
                 {
                     htmlGenericControl2.Attributes.Add("onclick", "window.location.href='ServiceMemberOrderDetails.aspx?orderId=" + orderInfo.OrderId + "'");
                 }
                 else
                 {
                     htmlGenericControl2.Attributes.Add("onclick", "window.location.href='MemberOrderDetails.aspx?orderId=" + orderInfo.OrderId + "'");
                 }
             }
             if (htmlAnchor6 != null)
             {
                 if (orderInfo.OrderStatus == OrderStatus.SellerAlreadySent || orderInfo.OrderStatus == OrderStatus.Finished)
                 {
                     if (!string.IsNullOrEmpty(orderInfo.ExpressCompanyAbb) && !string.IsNullOrEmpty(orderInfo.ShipOrderNumber))
                     {
                         htmlAnchor6.HRef = "MyLogistics.aspx?OrderId=" + text;
                     }
                     else if (orderInfo.ExpressCompanyName == "同城物流配送")
                     {
                         htmlAnchor6.HRef = "MyLogistics.aspx?OrderId=" + text;
                     }
                     else
                     {
                         htmlAnchor6.Visible = false;
                     }
                 }
                 else
                 {
                     htmlAnchor6.Visible = false;
                 }
             }
             if (htmlAnchor10 != null)
             {
                 htmlAnchor10.HRef = "ViewQRCode.aspx?orderId=" + orderInfo.OrderId;
             }
             int num4;
             if (htmlAnchor5 != null && ((orderStatus == OrderStatus.Finished && orderInfo.LineItems.Count > 0) || (orderStatus == OrderStatus.Closed && orderInfo.OnlyReturnedCount == orderInfo.LineItems.Count && orderInfo.LineItems.Count > 0)))
             {
                 htmlAnchor5.Visible = true;
                 htmlAnchor5.HRef    = "MemberSubmitProductReview.aspx?orderId=" + text;
                 DataTable    productReviewAll = ProductBrowser.GetProductReviewAll(text);
                 LineItemInfo lineItemInfo     = new LineItemInfo();
                 int          num  = 0;
                 int          num2 = 0;
                 int          num3 = 0;
                 bool         flag = false;
                 foreach (KeyValuePair <string, LineItemInfo> lineItem in orderInfo.LineItems)
                 {
                     flag         = false;
                     lineItemInfo = lineItem.Value;
                     for (int i = 0; i < productReviewAll.Rows.Count; i++)
                     {
                         num4 = lineItemInfo.ProductId;
                         if (num4.ToString() == productReviewAll.Rows[i][0].ToString() && lineItemInfo.SkuId.ToString().Trim() == productReviewAll.Rows[i][1].ToString().Trim())
                         {
                             flag = true;
                         }
                     }
                     if (!flag)
                     {
                         num2++;
                     }
                     else
                     {
                         num3++;
                     }
                 }
                 if (num + num2 == orderInfo.LineItems.Count)
                 {
                     htmlAnchor5.InnerText = "查看评论";
                 }
                 else
                 {
                     SiteSettings masterSettings = SettingsManager.GetMasterSettings();
                     if (masterSettings != null)
                     {
                         if (masterSettings.ProductCommentPoint <= 0)
                         {
                             htmlAnchor5.InnerText = "评价";
                         }
                         else
                         {
                             htmlAnchor5.InnerText = $"评价得{num3 * masterSettings.ProductCommentPoint}积分";
                         }
                     }
                 }
             }
             if (htmlAnchor3 != null && orderStatus == OrderStatus.WaitBuyerPay)
             {
                 if (orderInfo.PreSaleId == 0 || (orderInfo.PreSaleId > 0 && !orderInfo.DepositDate.HasValue))
                 {
                     htmlAnchor3.Visible = true;
                 }
                 htmlAnchor3.Attributes.Add("onclick", $"closeOrder('{text}')");
             }
             DateTime dateTime;
             if (htmlAnchor7 != null)
             {
                 if (orderStatus == OrderStatus.WaitBuyerPay && orderInfo.ItemStatus == OrderItemStatus.Nomarl && orderInfo.PaymentTypeId != -3 && orderInfo.Gateway != "hishop.plugins.payment.bankrequest" && orderInfo.Gateway != "hishop.plugins.payment.podrequest")
                 {
                     htmlAnchor7.Attributes.Add("IsServiceOrder", (orderInfo.OrderType == OrderType.ServiceOrder).ToString().ToLower());
                     if (orderInfo.PreSaleId > 0)
                     {
                         ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(orderInfo.PreSaleId);
                         if (!orderInfo.DepositDate.HasValue)
                         {
                             htmlGenericControl8.InnerText = orderInfo.Deposit.F2ToString("f2");
                             (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "定金:¥";
                             if (productPreSaleInfo.PreSaleEndDate > DateTime.Now)
                             {
                                 AttributeCollection attributes = htmlAnchor7.Attributes;
                                 num4 = orderInfo.PaymentTypeId;
                                 attributes.Add("PaymentTypeId", num4.ToString());
                                 htmlAnchor7.Attributes.Add("OrderId", orderInfo.OrderId);
                                 htmlAnchor7.Attributes.Add("OrderTotal", orderInfo.Deposit.F2ToString("f2"));
                                 AttributeCollection attributes2 = htmlAnchor7.Attributes;
                                 num4 = orderInfo.FightGroupId;
                                 attributes2.Add("FightGroupId", num4.ToString());
                             }
                             else
                             {
                                 htmlAnchor7.Visible = false;
                                 (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "定金:¥";
                             }
                         }
                         else if (productPreSaleInfo.PaymentStartDate > DateTime.Now || productPreSaleInfo.PaymentEndDate < DateTime.Now)
                         {
                             (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "尾款:¥";
                             htmlGenericControl8.InnerText = orderInfo.FinalPayment.F2ToString("f2");
                             htmlAnchor7.Visible           = false;
                             htmlAnchor3.Visible           = false;
                             if (productPreSaleInfo.PaymentEndDate < DateTime.Now)
                             {
                                 (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "尾款支付结束";
                                 htmlGenericControl8.Visible = false;
                             }
                         }
                         else
                         {
                             AttributeCollection attributes3 = htmlAnchor7.Attributes;
                             num4 = orderInfo.PaymentTypeId;
                             attributes3.Add("PaymentTypeId", num4.ToString());
                             htmlAnchor7.Attributes.Add("OrderId", orderInfo.OrderId);
                             htmlAnchor7.Attributes.Add("OrderTotal", orderInfo.FinalPayment.F2ToString("f2"));
                             AttributeCollection attributes4 = htmlAnchor7.Attributes;
                             num4 = orderInfo.FightGroupId;
                             attributes4.Add("FightGroupId", num4.ToString());
                             htmlGenericControl8.InnerText = orderInfo.FinalPayment.F2ToString("f2");
                             (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "尾款:¥";
                             htmlAnchor3.Visible = false;
                         }
                     }
                     else
                     {
                         AttributeCollection attributes5 = htmlAnchor7.Attributes;
                         num4 = orderInfo.PaymentTypeId;
                         attributes5.Add("PaymentTypeId", num4.ToString());
                         htmlAnchor7.Attributes.Add("OrderId", orderInfo.OrderId);
                         htmlAnchor7.Attributes.Add("OrderTotal", orderInfo.GetTotal(false).F2ToString("f2"));
                         AttributeCollection attributes6 = htmlAnchor7.Attributes;
                         num4 = orderInfo.FightGroupId;
                         attributes6.Add("FightGroupId", num4.ToString());
                         if (HiContext.Current.SiteSettings.OpenMultStore && orderInfo.StoreId > 0 && !SettingsManager.GetMasterSettings().Store_IsOrderInClosingTime)
                         {
                             StoresInfo storeById = StoresHelper.GetStoreById(orderInfo.StoreId);
                             dateTime = DateTime.Now;
                             string str = dateTime.ToString("yyyy-MM-dd");
                             dateTime = storeById.OpenStartDate;
                             DateTime value = (str + " " + dateTime.ToString("HH:mm")).ToDateTime().Value;
                             dateTime = DateTime.Now;
                             string str2 = dateTime.ToString("yyyy-MM-dd");
                             dateTime = storeById.OpenEndDate;
                             DateTime dateTime2 = (str2 + " " + dateTime.ToString("HH:mm")).ToDateTime().Value;
                             if (dateTime2 <= value)
                             {
                                 dateTime2 = dateTime2.AddDays(1.0);
                             }
                             if (DateTime.Now < value || DateTime.Now > dateTime2)
                             {
                                 htmlAnchor7.Attributes.Add("NeedNotInTimeTip", "1");
                             }
                         }
                     }
                 }
                 else
                 {
                     htmlAnchor7.Visible = false;
                 }
             }
             if (htmlAnchor8 != null)
             {
                 if (orderInfo.Gateway == "hishop.plugins.payment.bankrequest" && orderInfo.OrderStatus == OrderStatus.WaitBuyerPay)
                 {
                     htmlAnchor8.HRef = "FinishOrder.aspx?OrderId=" + text + "&onlyHelp=true";
                 }
                 else
                 {
                     htmlAnchor8.Visible = false;
                 }
             }
             if (htmlAnchor9 != null)
             {
                 if (orderInfo.OrderStatus == OrderStatus.SellerAlreadySent && orderInfo.ItemStatus == OrderItemStatus.Nomarl)
                 {
                     htmlAnchor9.Attributes.Add("onclick", $"FinishOrder('{text}','{orderInfo.PaymentType}',{orderInfo.LineItems.Count})");
                 }
                 else
                 {
                     htmlAnchor9.Visible = false;
                 }
             }
             if (htmlAnchor11 != null)
             {
                 if (HiContext.Current.SiteSettings.IsOpenCertification && orderInfo.IDStatus == 0 && orderInfo.IsincludeCrossBorderGoods)
                 {
                     htmlAnchor11.Attributes.Add("orderId", orderInfo.OrderId);
                     htmlAnchor11.Attributes.Add("onclick", "Certification(this)");
                     htmlAnchor11.Visible = true;
                 }
                 else
                 {
                     htmlAnchor11.Visible = false;
                 }
             }
             if (literal != null)
             {
                 Literal literal4 = literal;
                 num4          = this.GetGoodsNum(orderInfo);
                 literal4.Text = num4.ToString();
             }
             if (literal2 != null)
             {
                 Literal literal5 = literal2;
                 num4          = this.GetGiftsNum(orderInfo);
                 literal5.Text = num4.ToString();
             }
             if (orderInfo.OrderType == OrderType.ServiceOrder)
             {
                 Label label = (Label)e.Item.FindControl("OrderStatusLabel2");
                 IList <OrderVerificationItemInfo> orderVerificationItems = TradeHelper.GetOrderVerificationItems(orderInfo.OrderId);
                 ServiceOrderStatus orderStatus2 = this.GetOrderStatus(orderInfo, orderVerificationItems);
                 label.Text    = ((Enum)(object)orderStatus2).ToDescription();
                 label.Visible = true;
             }
             else
             {
                 OrderStatusLabel orderStatusLabel = (OrderStatusLabel)e.Item.FindControl("OrderStatusLabel1");
                 orderStatusLabel.OrderItemStatus    = ((orderInfo.ItemStatus != 0) ? OrderItemStatus.HasReturnOrReplace : OrderItemStatus.Nomarl);
                 orderStatusLabel.Gateway            = orderInfo.Gateway;
                 orderStatusLabel.OrderStatusCode    = orderInfo.OrderStatus;
                 orderStatusLabel.ShipmentModelId    = orderInfo.ShippingModeId;
                 orderStatusLabel.IsConfirm          = orderInfo.IsConfirm;
                 orderStatusLabel.ShipmentModelId    = orderInfo.ShippingModeId;
                 orderStatusLabel.PaymentTypeId      = orderInfo.PaymentTypeId;
                 orderStatusLabel.PreSaleId          = orderInfo.PreSaleId;
                 orderStatusLabel.DepositDate        = orderInfo.DepositDate;
                 orderStatusLabel.OrderType          = orderInfo.OrderType;
                 orderStatusLabel.ExpressCompanyName = orderInfo.ExpressCompanyName;
                 orderStatusLabel.DadaStatus         = orderInfo.DadaStatus;
                 orderStatusLabel.Visible            = true;
             }
             Dictionary <string, LineItemInfo> lineItems = orderInfo.LineItems;
             foreach (string key in lineItems.Keys)
             {
                 lineItems[key].IsValid = (orderInfo.OrderType == OrderType.ServiceOrder);
             }
             repeater.DataSource     = lineItems.Values;
             repeater.ItemDataBound += this.Repeater1_ItemDataBound;
             repeater.DataBind();
             if (orderInfo.LineItems.Count == 0)
             {
                 IEnumerable <OrderGiftInfo> enumerable = from a in orderInfo.Gifts
                                                          where a.PromoteType == 0 || a.PromoteType == 15
                                                          select a;
                 foreach (OrderGiftInfo item in enumerable)
                 {
                     item.NeedPoint = ((orderInfo.OrderType == OrderType.ServiceOrder) ? 1 : 0);
                 }
                 repeater2.DataSource     = enumerable;
                 repeater2.ItemDataBound += this.rptPointGifts_ItemDataBound;
                 repeater2.DataBind();
             }
             OrderItemStatus itemStatus = orderInfo.ItemStatus;
             DateTime        obj;
             if (DataBinder.Eval(e.Item.DataItem, "FinishDate") != DBNull.Value)
             {
                 obj = (DateTime)DataBinder.Eval(e.Item.DataItem, "FinishDate");
             }
             else
             {
                 dateTime = DateTime.Now;
                 obj      = dateTime.AddYears(-1);
             }
             DateTime dateTime3 = obj;
             string   text4     = "";
             if (DataBinder.Eval(e.Item.DataItem, "Gateway") != null && !(DataBinder.Eval(e.Item.DataItem, "Gateway") is DBNull))
             {
                 text4 = (string)DataBinder.Eval(e.Item.DataItem, "Gateway");
             }
             RefundInfo refundInfo = TradeHelper.GetRefundInfo(text);
             if (htmlAnchor2 != null)
             {
                 if (orderInfo.OrderType == OrderType.ServiceOrder)
                 {
                     htmlAnchor2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid && orderInfo.ItemStatus == OrderItemStatus.Nomarl && orderInfo.LineItems.Count != 0);
                     if (htmlAnchor2.Visible)
                     {
                         LineItemInfo value2 = orderInfo.LineItems.FirstOrDefault().Value;
                         if (value2.IsRefund)
                         {
                             if (value2.IsOverRefund)
                             {
                                 htmlAnchor2.Visible = true;
                             }
                             else if (value2.IsValid)
                             {
                                 htmlAnchor2.Visible = true;
                             }
                             else if (DateTime.Now >= value2.ValidStartDate.Value && DateTime.Now <= value2.ValidEndDate.Value)
                             {
                                 htmlAnchor2.Visible = true;
                             }
                             else
                             {
                                 htmlAnchor2.Visible = false;
                             }
                         }
                         else
                         {
                             htmlAnchor2.Visible = false;
                         }
                     }
                 }
                 else
                 {
                     htmlAnchor2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid && orderInfo.ItemStatus == OrderItemStatus.Nomarl && orderInfo.LineItems.Count != 0 && orderInfo.GetPayTotal() > decimal.Zero);
                 }
             }
             if (htmlAnchor != null)
             {
                 htmlAnchor.Visible = (orderInfo.OrderType == OrderType.ServiceOrder && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid);
             }
             SiteSettings masterSettings2 = SettingsManager.GetMasterSettings();
             if (!string.IsNullOrEmpty(orderInfo.TakeCode) && (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid || orderInfo.OrderStatus == OrderStatus.WaitBuyerPay))
             {
                 htmlAnchor10.Visible = true;
             }
             if (!htmlAnchor2.Visible && !htmlAnchor4.Visible && !htmlAnchor10.Visible && !htmlAnchor6.Visible && !htmlAnchor3.Visible && !htmlAnchor7.Visible && !htmlAnchor8.Visible && !htmlAnchor9.Visible && !htmlAnchor5.Visible && !htmlAnchor.Visible)
             {
                 htmlGenericControl.Visible = false;
             }
             if (orderInfo.FightGroupId > 0)
             {
                 FightGroupInfo fightGroup = VShopHelper.GetFightGroup(orderInfo.FightGroupId);
                 if (fightGroup != null)
                 {
                     htmlAnchor2.Visible = (fightGroup.Status != 0 && orderInfo.GetPayTotal() > decimal.Zero && (refundInfo == null || refundInfo.HandleStatus == RefundStatus.Refused) && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid);
                 }
             }
         }
     }
 }