示例#1
0
        protected void EgvOrders_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                OrderInfo dataItem = (OrderInfo)e.Row.DataItem;
                HyperLink link     = (HyperLink)e.Row.FindControl("HlnkOrderNum");
                Label     label    = (Label)e.Row.FindControl("LblOrderStatus");
                Label     label2   = (Label)e.Row.FindControl("LblPayStatus");
                link.NavigateUrl = base.BasePath + SiteConfig.SiteOption.ManageDir + "/Shop/OrderManage.aspx?OrderID=" + dataItem.OrderId.ToString();
                link.Enabled     = this.m_HasPermissions;
                label.Text       = BaseUserControl.EnumToHtml <OrderStatus>(dataItem.Status);
                switch (Order.GetPayStatus(dataItem))
                {
                case PayStatus.WaitForPay:
                    label2.Text = BaseUserControl.EnumToHtml <PayStatus>(PayStatus.WaitForPay);
                    return;

                case PayStatus.ReceivedEarnest:
                    label2.Text = BaseUserControl.EnumToHtml <PayStatus>(PayStatus.ReceivedEarnest);
                    return;

                case PayStatus.Payoff:
                    label2.Text = BaseUserControl.EnumToHtml <PayStatus>(PayStatus.Payoff);
                    return;

                default:
                    return;
                }
            }
        }
示例#2
0
 private void InitSigin(int generalId, bool enableSignin)
 {
     if (enableSignin)
     {
         SignInContentInfo signInContentByGeneralId = SignInContent.GetSignInContentByGeneralId(generalId);
         if (!signInContentByGeneralId.IsNull)
         {
             this.LblSigninType.Text = BaseUserControl.EnumToHtml <SignInType>(signInContentByGeneralId.SignInType);
             this.LblEndTime.Text    = signInContentByGeneralId.EndTime.ToString();
             this.LblPriority.Text   = signInContentByGeneralId.Priority.ToString();
             this.LblStatus.Text     = BaseUserControl.EnumToHtml <SignInStatus>(signInContentByGeneralId.Status);
         }
         this.RptSigninLog.DataSource = SignInLog.GetList(generalId);
         this.RptSigninLog.DataBind();
     }
 }
 private void RadlTaxRateDataBind()
 {
     if (this.RadlTaxRateType.Items.Count == 0)
     {
         foreach (TaxRateType type in Enum.GetValues(typeof(TaxRateType)))
         {
             ListItem item = new ListItem();
             item.Text  = BaseUserControl.EnumToHtml <TaxRateType>(type);
             item.Value = ((int)type).ToString();
             if (type == TaxRateType.BarringTaxNeedInvoiceNoTax)
             {
                 item.Selected = true;
             }
             this.RadlTaxRateType.Items.Add(item);
         }
     }
 }
        private void ShowProductInfo()
        {
            Product product = new Product();

            product.GetProductAllDataById(this.m_GeneralId);
            ProductInfo             productInfoData     = product.ProductInfoData;
            IList <ProductDataInfo> productDataInfoList = product.ProductDataInfoList;

            this.LblProductKind.Text = BaseUserControl.EnumToHtml <ProductKind>(productInfoData.ProductKind);
            StringBuilder sb = new StringBuilder();

            foreach (ProductCharacter character in Enum.GetValues(typeof(ProductCharacter)))
            {
                if (Product.CharacterIsExists(productInfoData.ProductCharacter, character))
                {
                    StringHelper.AppendString(sb, BaseUserControl.EnumToHtml <ProductCharacter>(character));
                }
            }
            this.LblCharacter.Text = sb.ToString();
            this.LblUnit.Text      = productInfoData.Unit;
            switch (productInfoData.StocksProject)
            {
            case StocksProject.ActualStock:
                this.LblStocksProject.Text = "实际库存";
                break;

            case StocksProject.VirtualStock:
                this.LblStocksProject.Text = "虚拟库存";
                break;
            }
            this.EgvStocks.DataSource = productDataInfoList;
            this.EgvStocks.DataBind();
            this.LblIncludeTax.Text        = BaseUserControl.EnumToHtml <TaxRateType>(productInfoData.IncludeTax);
            this.LblTaxRate.Text           = productInfoData.TaxRate.ToString();
            this.LblWeight.Text            = productInfoData.Weight.ToString();
            this.LblServiceTerm.Text       = productInfoData.ServiceTerm.ToString() + BaseUserControl.EnumToHtml <ServiceTermUnit>(productInfoData.ServiceTermUnit);
            this.LblProductType.Text       = BaseUserControl.EnumToHtml <ProductType>(productInfoData.ProductType);
            this.LblProperties.Text        = productInfoData.Properties;
            this.LblPrice.Text             = productInfoData.PriceInfo.Price.ToString("0.00");
            this.LblPrice_Market.Text      = productInfoData.PriceMarket.ToString("0.00");
            this.LblDownloadUrl.Text       = productInfoData.DownloadUrl;
            this.LblDownloadUrlRemark.Text = productInfoData.Remark;
            if (productInfoData.PriceInfo.PriceMember > 0M)
            {
                this.LblPrice_Member.Text = productInfoData.PriceInfo.PriceMember.ToString("0.00");
            }
            else if (productInfoData.PriceInfo.PriceMember == -1M)
            {
                this.LblPrice_Member.Text = "按会员组价格计算";
            }
            else
            {
                this.LblPrice_Member.Text = "按会员组折扣率计算";
            }
            if (productInfoData.PriceInfo.PriceAgent > 0M)
            {
                this.LblPrice_Agent.Text = productInfoData.PriceInfo.PriceAgent.ToString("0.00");
            }
            else if (productInfoData.PriceInfo.PriceAgent == -1M)
            {
                this.LblPrice_Agent.Text = "按代理商组价格计算";
            }
            else
            {
                this.LblPrice_Agent.Text = "按代理商组折扣率计算";
            }
            switch (productInfoData.SalePromotionType)
            {
            case 0:
                this.LblSalePromotionType.Text = "不促销";
                break;

            case 1:
                this.LblSalePromotionType.Text = string.Concat(new object[] { "买 ", productInfoData.MinNumber, "送", productInfoData.PresentNumber, "同样商品" });
                break;

            case 2:
                this.LblSalePromotionType.Text = string.Concat(new object[] { "买 ", productInfoData.MinNumber, "送", productInfoData.PresentNumber, "其它商品" });
                break;

            case 3:
                this.LblSalePromotionType.Text = "买就送" + productInfoData.PresentNumber + "同样商品";
                break;

            case 4:
                this.LblSalePromotionType.Text = "买就送" + productInfoData.PresentNumber + "其它商品";
                break;
            }
            this.LblPresentPoint.Text = productInfoData.PresentPoint.ToString();
            this.LblPresentExp.Text   = productInfoData.PresentExp.ToString();
            this.LblPresentMoney.Text = productInfoData.PresentMoney.ToString("0.00");
            this.LblEnableSale.Text   = productInfoData.EnableSale ? "立即销售" : "停止销售";
        }
示例#5
0
        private void BindControl(OrderInfo info)
        {
            this.LblOrderNum.Text   = info.OrderNum;
            this.HlkUserName.Text   = info.UserName;
            this.HlkAgentName.Text  = info.AgentName;
            this.HlkClientName.Text = info.ClientName;
            if (this.IsAdminPage)
            {
                this.HlkUserName.NavigateUrl   = string.Format("~/Admin/User/UserShow.aspx?UserName={0}", base.Server.UrlEncode(info.UserName));
                this.HlkClientName.NavigateUrl = string.Format("~/Admin/Crm/ClientShow.aspx?ClientId={0}", info.ClientId);
                this.HlkAgentName.NavigateUrl  = string.Format("~/Admin/User/UserShow.aspx?UserName={0}", base.Server.UrlEncode(info.AgentName));
            }
            this.CliendId = info.ClientId;
            if (info.NeedInvoice)
            {
                this.LblNeedInvoice.Text = "√";
            }
            else
            {
                this.LblNeedInvoice.Text      = "\x00d7";
                this.LblNeedInvoice.ForeColor = Color.FromArgb(0xff0000);
            }
            if (info.Invoiced)
            {
                this.LblInvoiced.Text = "√";
            }
            else
            {
                this.LblInvoiced.Text      = "\x00d7";
                this.LblInvoiced.ForeColor = Color.FromArgb(0xff0000);
            }
            this.LblStatus.Text = BaseUserControl.EnumToHtml <OrderStatus>(info.Status);
            switch (Order.GetPayStatus(info))
            {
            case PayStatus.WaitForPay:
                this.LblMoneyTotal.Text = BaseUserControl.EnumToHtml <PayStatus>(PayStatus.WaitForPay);
                break;

            case PayStatus.ReceivedEarnest:
                this.LblMoneyTotal.Text = BaseUserControl.EnumToHtml <PayStatus>(PayStatus.ReceivedEarnest);
                break;

            case PayStatus.Payoff:
                this.LblMoneyTotal.Text = BaseUserControl.EnumToHtml <PayStatus>(PayStatus.Payoff);
                break;
            }
            this.LblDeliverStatus.Text = BaseUserControl.EnumToHtml <DeliverStatus>(info.DeliverStatus);
            if (info.NeedInvoice)
            {
                this.LblInvoiceContent.Text = info.InvoiceContent;
            }
            this.LblRemark.Text            = info.Remark;
            this.LblBeginDate.Text         = info.BeginDate.ToString("yyyy-MM-dd");
            this.LblInputTime.Text         = info.InputTime.ToString("yyyy-MM-dd HH:mm:ss");
            this.LblContacterName.Text     = info.ContacterName;
            this.LblAddress.Text           = info.Address;
            this.LblZipCode.Text           = info.ZipCode;
            this.LblMobile.Text            = info.Mobile;
            this.LblPhone.Text             = info.Phone;
            this.LblEmail.Text             = info.Email;
            this.LblPaymentType.Text       = PaymentType.GetPaymentTypeById(info.PaymentType).TypeName;
            this.LblDeliverType.Text       = DeliverType.GetDeliverTypeById(info.DeliverType).TypeName;
            this.LblOutOfStockProject.Text = BaseUserControl.EnumToHtml <OutOfStockProject>(info.OutOfStockProject);
            this.LblDeliverTime.Text       = info.DeliveryTime;
            if (this.IsAdminPage)
            {
                this.LblMemo.Text            = info.Memo;
                this.LblMemo.Visible         = true;
                this.LtrMemoTitle.Visible    = true;
                this.ShowFunctionary.Visible = true;
                this.LblFunctionary.Text     = info.Functionary;
                this.LblOrderType.Text       = Choiceset.GetDataText("PE_Orders", "OrderType", info.OrderType);
            }
            else
            {
                this.LblMemo.Visible         = false;
                this.LtrMemoTitle.Visible    = false;
                this.ShowFunctionary.Visible = false;
            }
        }
示例#6
0
        protected void RptOrderItem_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            ShopConfig shopConfig = SiteConfig.ShopConfig;

            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                OrderItemInfo dataItem = (OrderItemInfo)e.Item.DataItem;
                Literal       literal  = e.Item.FindControl("LtrServiceTerm") as Literal;
                HyperLink     link     = e.Item.FindControl("LnkProduct") as HyperLink;
                if (this.IsAdminPage)
                {
                    if (!string.IsNullOrEmpty(dataItem.TableName))
                    {
                        link.NavigateUrl = string.Concat(new object[] { "../", SiteConfig.SiteOption.ManageDir, "/Shop/ProductView.aspx?GeneralID=", dataItem.ProductId });
                    }
                    else
                    {
                        link.NavigateUrl = string.Concat(new object[] { "../", SiteConfig.SiteOption.ManageDir, "/Shop/PresentView.aspx?presentId=", dataItem.ProductId });
                    }
                }
                else
                {
                    link.NavigateUrl = new InsideStaticLabel().GetInfoPath(dataItem.ProductId.ToString());
                    link.Target      = "_Blank";
                }
                if (dataItem.ServiceTerm != 0)
                {
                    DateTime time;
                    if (dataItem.ServiceTermUnit == ServiceTermUnit.Year)
                    {
                        time = dataItem.BeginDate.AddYears(dataItem.ServiceTerm);
                    }
                    else if (dataItem.ServiceTermUnit == ServiceTermUnit.Month)
                    {
                        time = dataItem.BeginDate.AddMonths(dataItem.ServiceTerm);
                    }
                    else
                    {
                        time = dataItem.BeginDate.AddDays((double)dataItem.ServiceTerm);
                    }
                    if (DateTime.Compare(time, DateTime.Now) > 0)
                    {
                        literal.Text = dataItem.ServiceTerm.ToString() + BaseUserControl.EnumToHtml <ServiceTermUnit>(dataItem.ServiceTermUnit);
                    }
                    else
                    {
                        literal.Text = "<font color='red'>" + dataItem.ServiceTerm.ToString() + BaseUserControl.EnumToHtml <ServiceTermUnit>(dataItem.ServiceTermUnit) + "</font>";
                    }
                }
                else
                {
                    literal.Text = dataItem.ServiceTerm.ToString() + BaseUserControl.EnumToHtml <ServiceTermUnit>(dataItem.ServiceTermUnit);
                }
                if (!string.IsNullOrEmpty(dataItem.Remark))
                {
                    ((Label)e.Item.FindControl("LblItemRemark")).Text    = "查看";
                    ((Label)e.Item.FindControl("LblItemRemark")).ToolTip = dataItem.Remark;
                }
                if ((!this.m_HaveCard && Product.CharacterIsExists(dataItem.ProductCharacter, ProductCharacter.Card)) && Cards.GetCardByOrderItemId(dataItem.ProductId, dataItem.TableName, dataItem.ItemId).IsNull)
                {
                    this.m_HaveCard = true;
                }
                if (!this.m_HaveSoft && Product.CharacterIsExists(dataItem.ProductCharacter, ProductCharacter.Download))
                {
                    this.m_HaveSoft = true;
                }
                if (!this.m_HavePracticality && Product.CharacterIsExists(dataItem.ProductCharacter, ProductCharacter.Practicality))
                {
                    this.m_HavePracticality = true;
                }
                if (!this.m_HaveService && Product.CharacterIsExists(dataItem.ProductCharacter, ProductCharacter.Service))
                {
                    this.m_HaveService = true;
                }
                ExtendedImage image   = (ExtendedImage)e.Item.FindControl("extendedImage");
                Control       control = e.Item.FindControl("ProductImage");
                if (!shopConfig.IsOrderProductListShowThumb)
                {
                    image.Visible   = false;
                    control.Visible = false;
                }
                else
                {
                    if (!string.IsNullOrEmpty(dataItem.TableName))
                    {
                        ProductInfo productById = Product.GetProductById(dataItem.ProductId);
                        if (!string.IsNullOrEmpty(productById.ProductThumb))
                        {
                            image.Src = productById.ProductThumb;
                        }
                        else
                        {
                            image.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif";
                        }
                    }
                    else
                    {
                        PresentInfo presentById = Present.GetPresentById(dataItem.ProductId);
                        if (!string.IsNullOrEmpty(presentById.PresentThumb))
                        {
                            image.Src = presentById.PresentThumb;
                        }
                        else
                        {
                            image.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif";
                        }
                    }
                    if (shopConfig.OrderProductListThumbsHeight != 0)
                    {
                        image.ImageHeight = shopConfig.OrderProductListThumbsHeight;
                    }
                    else if (shopConfig.OrderProductListThumbsWidth != 0)
                    {
                        image.ImageWidth = shopConfig.OrderProductListThumbsWidth;
                    }
                }
                this.m_SubTotal          += dataItem.Amount * dataItem.TruePrice;
                this.m_TotalPresentExp   += dataItem.Amount * dataItem.PresentExp;
                this.m_TotalPresentMoney += dataItem.Amount * dataItem.PresentMoney;
                this.m_TotalPresentPoint += dataItem.Amount * dataItem.PresentPoint;
            }
            if (e.Item.ItemType == ListItemType.Header)
            {
                Control control2 = e.Item.FindControl("ProductImageTitle");
                if (!shopConfig.IsOrderProductListShowThumb)
                {
                    control2.Visible = false;
                }
            }
        }