Exemplo n.º 1
0
    public Mine()
    {
        Title = string.Format(TITLE_FORMAT, level);

        (coinPerSecLabel = Add <TextLabel>())
        .SetText(COIN_PER_SEC_FORMAT, CoinPerSec)
        .SetSize(88, 8)
        ;

        Add <Bar>()
        .SetValue(Coin)
        .SetSize(88, 12)
        .Add <ValueLabel>()
        .SetFormat("coin ({0}/{1})")
        .SetValue(Coin)
        .Center()
        ;

        (transferButton = Add <Button>())
        .SetOnPressed(() => Coin.MoveTo(Computer.Coin))
        .SetSize(88, 12)
        .Add <TextLabel>().SetText("transfer").Center();
        ;

        (upgradeButton = Add <BuyButton>())
        .SetCost(upgradeCost)
        .SetOnPressed(Upgrade)
        .SetSize(88, 12)
        .Add <TextLabel>().SetText(UPGRADE_FORMAT, upgradeCost).Center();
        ;

        Pack();
    }
        void ReleaseDesignerOutlets()
        {
            if (SellButton != null)
            {
                SellButton.Dispose();
                SellButton = null;
            }

            if (BuyPriceLabel != null)
            {
                BuyPriceLabel.Dispose();
                BuyPriceLabel = null;
            }

            if (SellPriceLabel != null)
            {
                SellPriceLabel.Dispose();
                SellPriceLabel = null;
            }

            if (BuyButton != null)
            {
                BuyButton.Dispose();
                BuyButton = null;
            }

            if (PriceLabel != null)
            {
                PriceLabel.Dispose();
                PriceLabel = null;
            }
        }
Exemplo n.º 3
0
 private void AllProducts_Load(object sender, EventArgs e)
 {
     using (UserContainer db = new UserContainer())
     {
         foreach (product product in db.productSet)
         {
             FlowLayoutPanel flowLP = new FlowLayoutPanel();
             flowLP.AutoSize = false;
             flowLP.Width    = 500;
             PictureBox pictureBox = new PictureBox();
             pictureBox.Image    = (Image)((new ImageConverter()).ConvertFrom(product.PhotoPath));
             pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
             Label title = new Label();
             title.Text = product.Name;
             Label price = new Label();
             price.Text = $"{product.Price} руб.";
             BuyButton button = new BuyButton(product.Id, currentUser, userForm);
             button.Text = "Добавить";
             flowLP.Controls.Add(pictureBox);
             flowLP.Controls.Add(title);
             flowLP.Controls.Add(price);
             flowLP.Controls.Add(button);
             flowLayoutPanel1.Controls.Add(flowLP);
         }
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (BuyButton != null)
            {
                BuyButton.Dispose();
                BuyButton = null;
            }

            if (ItemDescriptionLabel != null)
            {
                ItemDescriptionLabel.Dispose();
                ItemDescriptionLabel = null;
            }

            if (ItemImageView != null)
            {
                ItemImageView.Dispose();
                ItemImageView = null;
            }

            if (ItemPriceLabel != null)
            {
                ItemPriceLabel.Dispose();
                ItemPriceLabel = null;
            }

            if (ItemTitleLabel != null)
            {
                ItemTitleLabel.Dispose();
                ItemTitleLabel = null;
            }
        }
Exemplo n.º 5
0
    public Vault()
    {
        Title = string.Format(TITLE_FORMAT, level);

        (label = Add <TextLabel>())
        .SetText(LABEL_FORMAT, coinModifier)
        .SetSize(88, 8)
        ;

        (upgradeButton = Add <BuyButton>())
        .SetCost(upgradeCost)
        .SetSize(88, 12)
        .Add <TextLabel>().SetText(UPGRADE_FORMAT, upgradeCost).Center();
        ;

        Pack();

        upgradeButton.OnPressed += () =>
        {
            if (Computer.Coin.Pay(upgradeCost))
            {
                level++;
                Title = string.Format(TITLE_FORMAT, level);

                Computer.Coin.ModifyMax(coinModifier);
                coinModifier *= 2;
                label.SetText(LABEL_FORMAT, coinModifier);

                upgradeCost *= 2;
                upgradeButton.SetCost(upgradeCost);
                upgradeButton.Get <TextLabel>().SetText(UPGRADE_FORMAT, upgradeCost);
            }
        };
    }
Exemplo n.º 6
0
 private void Start()
 {
     if (instance != null)
     {
         instance = this;
     }
 }
Exemplo n.º 7
0
 private void Awake()
 {
     if (instance != null)
     {
         instance = this;
     }
 }
Exemplo n.º 8
0
 public SearchingTrainResultsPage BuyButtonClick()
 {
     wait.Until(e => e.FindElement(By.ClassName("preloader_light")).GetAttribute("style") == "display: none;");
     Waiter.WaitForAjax(driver);
     BuyButton.Click();
     return(this);
 }
Exemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        scrollView = GameObject.FindGameObjectWithTag("ScrollView");
        if (scrollView == null)
        {
            Debug.Log("Left Scroll button could not get the scrollview reference.");
        }
        else
        {
            scrollRect = scrollView.GetComponent <ScrollRect>();
        }

        if (scrollRect == null)
        {
            Debug.Log("Left Scroll button could not get the scroll rect reference.");
        }

        button = GetComponent <Button>();
        if (button == null)
        {
            Debug.Log("Left Scroll button script could not get a reference to the button sript.");
        }
        else
        {
            button.onClick.AddListener(ClickLeft);
        }

        audioOut = GetComponent <AudioSource>();
        if (audioOut == null)
        {
            Debug.Log("Left Scroll button couldnt get its Audio Source component.");
        }

        charCost = GameObject.FindGameObjectWithTag("uiCharCostField").GetComponent <Text>();
        if (charCost == null)
        {
            Debug.Log("Left Scroll button script could not get a reference to the Character Cost Text component.");
        }

        pScript = GameObject.FindGameObjectWithTag("PlayerController").GetComponent <PlayerController>();
        if (pScript == null)
        {
            Debug.Log("Left Scroll script could not get a reference to the player controller.");
        }

        buyButton = GameObject.FindGameObjectWithTag("uiBuyButton").GetComponent <BuyButton>();
        if (buyButton == null)
        {
            Debug.Log("Left Scroll button couldnt get a reference to the Buy Button script.");
        }

        menuButton = GameObject.FindGameObjectWithTag("MenuButton").GetComponent <MenuButton>();
        if (menuButton == null)
        {
            Debug.Log("Left Scroll button couldnt get a reference to the menu Button script.");
        }
    }
Exemplo n.º 10
0
    public void TransferItems()
    {
        Debug.Log("went through");
        if (amount != 0)
        {
            //money transfer
            currInv.money  += amount * selectedItem.cost;
            otherInv.money -= amount * selectedItem.cost;

            //item transfer
            currInv.RemoveItems(selectedItem, amount); //should never return false
            otherInv.AddItems(selectedItem, amount);

            //update item lists
            itemList  = new List <Item>(currInv.itemDict.Keys);
            itemIndex = 0;
            UpdateItemList(itemList, currInv, itemIndex);
        }

        //exit back to item scrolling
        if (itemList.Count == 0)
        {
            //inventory has no more items to display
            Debug.Log("No more items to buy/sell");

            int lastType = menuType;
            menuType = 0;
            ItemButton.GetComponent <Button>().interactable = false;
            switch (lastType)
            {
            case -1:
                BuyButton.SetActive(true);
                SellButton.GetComponent <Button>().enabled = true;
                ES.SetSelectedGameObject(SellButton);
                StartCoroutine("MoveLeft");
                break;

            case 1:
                SellButton.SetActive(true);
                BuyButton.GetComponent <Button>().enabled = true;
                ES.SetSelectedGameObject(BuyButton);
                StartCoroutine("MoveRight");
                break;
            }
        }
        else
        {
            Button button = ItemList.GetComponentInChildren <Button>();
            button.interactable = true;
            ES.SetSelectedGameObject(button.gameObject);
            itemScrolling = true;
        }

        AmountSelection.SetActive(false);
        selectedItem = null;
    }
Exemplo n.º 11
0
 private int GetButtonIndex(BuyButton buyButton)
 {
     for (int i = 0; i < buyButtons.Length; i++)
     {
         if (buyButton == buyButtons[i])
         {
             return(i);
         }
     }
     return(0);
 }
Exemplo n.º 12
0
        public void DisplayProduct(InAppPurchaseManager purchaseManager, InAppProduct product)
        {
            // Save copy of the current product and purchase manager
            _purchaseManager = purchaseManager;
            Product          = product;

            // Set image based on the product type
            switch (product.ProductType)
            {
            case InAppProductType.NonConsumable:
                if (product.Downloadable)
                {
                    ItemImage.Image = UIImage.FromFile("Images/Downloadable.png");
                }
                else
                {
                    ItemImage.Image = UIImage.FromFile("Images/NonConsumable.png");
                }
                break;

            case InAppProductType.Consumable:
                ItemImage.Image = UIImage.FromFile("Images/Consumable.png");
                break;

            case InAppProductType.AutoRenewableSubscription:
                ItemImage.Image = UIImage.FromFile("Images/Subscription.png");
                break;

            case InAppProductType.FreeSubscription:
                ItemImage.Image = UIImage.FromFile("Images/FreeSubscription.png");
                break;

            case InAppProductType.NonRenewingSubscription:
                ItemImage.Image = UIImage.FromFile("Images/NonRenewingSubscription.png");
                break;

            case InAppProductType.Unknown:
                ItemImage.Image = UIImage.FromFile("Images/Unknown.png");
                break;
            }

            // Fill in the rest of the information
            _isRestore              = false;
            ItemTitle.Text          = product.Title;
            DownloadProgress.Hidden = true;
            ItemDescription.Text    = product.Description;
            ItemPrice.Text          = product.FormattedPrice;
            BuyButton.SetTitle("Buy", UIControlState.Normal);
            BuyButton.Hidden  = !_purchaseManager.CanMakePayments;
            BuyButton.Enabled = true;

            // Wireup Button
            WireupBuyButton();
        }
Exemplo n.º 13
0
    public void MakePurchase(GameObject buyButton)
    {
        BuyButton buyingFrom = buyButton.GetComponent <BuyButton>();

        if (coins >= buyingFrom.itemCost)
        {
            SpendCoins(buyingFrom.itemCost);
            PlayerPrefs.SetInt(buyingFrom.unlockThisBlock.name, 1);
            buyingFrom.Unlock();
        }
        EstablishAvailableCubes();
    }
Exemplo n.º 14
0
    public static void SetBuyButtonState(bool active, string cost = "")
    {
        if (BuyButton.activeSelf)
        {
            BuyButton.GetComponent <Button>().interactable = active;

            if (cost.Length > 0)
            {
                GameObject.Find("TextPrize").GetComponent <Text>().text = cost;
            }
        }
    }
Exemplo n.º 15
0
    public void Buy(BuyButton buyButton)
    {
        if (moneyHandler.money < buyButton.value)
        {
            return;
        }

        moneyHandler.ChangeMoney(-buyButton.value);

        SetButtonState();

        CmdSpawn(GetButtonIndex(buyButton));
    }
        void ReleaseDesignerOutlets()
        {
            if (BuyButton != null)
            {
                BuyButton.Dispose();
                BuyButton = null;
            }

            if (EmailInputField != null)
            {
                EmailInputField.Dispose();
                EmailInputField = null;
            }
        }
Exemplo n.º 17
0
    // Update is called once per frame
    void Update()
    {
        if (CurrentPlanet != null)
        {
            MineCostText.text     = "Add a Mine" + " - " + CurrentPlanet.MineCost.ToString();
            Lifeaddtext.text      = "Sell Life" + " +" + (CurrentPlanet.Life / 6).ToString();
            LifeSlider.value      = CurrentPlanet.Life;
            ReasourceSlider.value = CurrentPlanet.Reasource;
        }
        MoneyText.text   = Player.Currency.ToString();
        EarningText.text = "Income: " + Player.EarningRate.ToString();
        if (CurrentPlanet != null)
        {
            ToolTip.IsTooltipVisable(false);
            PlanetDislpay.SetActive(true);
            if (!changename)
            {
                NameText.text = CurrentPlanet.name;
            }
            PlanetPicture.sprite = CurrentPlanet.image;
            if (CurrentPlanet.Owned)
            {
                //button off
                BuyButton.SetActive(false);

                PlanetShopDisplay.SetActive(true);
            }
            else
            {
                //button on
                PlanetShopDisplay.SetActive(false);
                BuyButton.SetActive(true);
                NameText.text = "Purchase " + CurrentPlanet.name + " \n  " + CurrentPlanet.Cost.ToString();
            }
        }
        else
        {
            PoorText.text = " ";
            NameText.text = " ";
            PlanetDislpay.SetActive(false);
        }
        if (CurrentPlanet != null && !CurrentPlanet.Owned)
        {
            NameText.interactable = false;
        }
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            CurrentPlanet = null;
        }
    }
Exemplo n.º 18
0
        void ReleaseDesignerOutlets()
        {
            if (BuyButton != null)
            {
                BuyButton.Dispose();
                BuyButton = null;
            }

            if (MoreInfoButton != null)
            {
                MoreInfoButton.Dispose();
                MoreInfoButton = null;
            }
        }
Exemplo n.º 19
0
    public void UpdateBuyButtons()
    {
        int currenrRunnerID = MainMenuManager.mainMenuManager.CurrentRunnerID;

        for (int i = 0; i < buyButtonList.Count; i++)
        {
            BuyButton buyButtonScript = buyButtonList[i].GetComponent <BuyButton>();
            for (int j = 0; j < runnerList.Count; j++)
            {
                if (runnerList[j].runnerID == buyButtonScript.runnerID && runnerList[j].bought && runnerList[j].runnerID != currenrRunnerID)
                {
                    buyButtonScript.buttonText.text = "Select";
                }
                else if (runnerList[j].runnerID == buyButtonScript.runnerID && runnerList[j].bought && runnerList[j].runnerID == currenrRunnerID)
                {
                    buyButtonScript.buttonText.text = "Selected";
                }
            }
        }
    }
Exemplo n.º 20
0
        /// <summary>
        /// Displays the restore previous purchases item
        /// </summary>
        /// <param name="purchaseManager">Purchase manager.</param>
        /// <param name="product">Product.</param>
        public void DisplayRestore(InAppPurchaseManager purchaseManager)
        {
            // Save copy of the current product and purchase manager
            _purchaseManager = purchaseManager;
            Product          = null;

            // Fill in theg rest of the information
            _isRestore              = true;
            ItemImage.Image         = UIImage.FromFile("Images/RestorePurchases.png");
            ItemTitle.Text          = "Restore Purchases";
            ItemDescription.Text    = "Restore any previous purchases that you have made in this app.";
            DownloadProgress.Hidden = true;
            ItemPrice.Text          = "";
            BuyButton.SetTitle("Restore", UIControlState.Normal);
            BuyButton.Hidden  = !_purchaseManager.CanMakePayments;
            BuyButton.Enabled = true;

            // Wireup Button
            WireupBuyButton();
        }
Exemplo n.º 21
0
    public void OpenBuy()
    {
        menuType = 1;
        menu.transform.localPosition            = new Vector3(180, 0, 0);
        AmountSelection.transform.localPosition = new Vector3(-95, -55, 0);
        SellButton.SetActive(false);
        BuyButton.GetComponent <Button>().enabled       = false;
        ItemButton.GetComponent <Button>().interactable = true;
        ES.SetSelectedGameObject(ItemButton);

        itemList = new List <Item>(npcInv.itemDict.Keys);
        currInv  = npcInv;
        otherInv = playerInv;
        UpdateItemList(itemList, currInv, 0);
        if (itemList.Count == 0)
        {
            //the button throws exceptions when there are no items selected, this prevents that
            ItemButton.GetComponent <Button>().interactable = false;
        }

        StartCoroutine("MoveLeft");
    }
        void ReleaseDesignerOutlets()
        {
            if (BuyButton != null)
            {
                BuyButton.Dispose();
                BuyButton = null;
            }

            if (ItemDescription != null)
            {
                ItemDescription.Dispose();
                ItemDescription = null;
            }

            if (ItemImage != null)
            {
                ItemImage.Dispose();
                ItemImage = null;
            }

            if (ItemPrice != null)
            {
                ItemPrice.Dispose();
                ItemPrice = null;
            }

            if (ItemTitle != null)
            {
                ItemTitle.Dispose();
                ItemTitle = null;
            }

            if (DownloadProgress != null)
            {
                DownloadProgress.Dispose();
                DownloadProgress = null;
            }
        }
 protected override void AttachChildControls()
 {
     if (!int.TryParse(base.GetParameter("countDownId", false), out this.countDownId))
     {
         base.GotoResourceNotFound();
     }
     this.common_Location         = (Common_Location)this.FindControl("common_Location");
     this.litProductCode          = (Literal)this.FindControl("litProductCode");
     this.litProductName          = (Literal)this.FindControl("litProductName");
     this.lblSku                  = (SkuLabel)this.FindControl("lblSku");
     this.lblStock                = (StockLabel)this.FindControl("lblStock");
     this.litUnit                 = (Literal)this.FindControl("litUnit");
     this.litSurplusNumber        = (Literal)this.FindControl("litSurplusNumber");
     this.litWeight               = (Label)this.FindControl("litWeight");
     this.litBrosedNum            = (Literal)this.FindControl("litBrosedNum");
     this.litBrand                = (Literal)this.FindControl("litBrand");
     this.litmaxcount             = (Literal)this.FindControl("litMaxCount");
     this.lblSalePrice            = (FormatedMoneyLabel)this.FindControl("lblSalePrice");
     this.lblTotalPrice           = (TotalLabel)this.FindControl("lblTotalPrice");
     this.litDescription          = (Literal)this.FindControl("litDescription");
     this.litShortDescription     = (Literal)this.FindControl("litShortDescription");
     this.btnOrder                = (BuyButton)this.FindControl("btnOrder");
     this.hpkProductConsultations = (HyperLink)this.FindControl("hpkProductConsultations");
     this.ltlSaleCount            = (Literal)this.FindControl("ltlSaleCount");
     this.ltlConsultation         = (Literal)this.FindControl("ltlConsultation");
     this.ltlReviewCount          = (Literal)this.FindControl("ltlReviewCount");
     this.lblCurrentSalePrice     = (FormatedMoneyLabel)this.FindControl("lblCurrentSalePrice");
     this.litContent              = (Literal)this.FindControl("litContent");
     this.lblEndTime              = (FormatedTimeLabel)this.FindControl("lblEndTime");
     this.lblStartTime            = (FormatedTimeLabel)this.FindControl("lblStartTime");
     this.litRemainTime           = (Literal)this.FindControl("litRemainTime");
     this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
     this.rptExpandAttributes     = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
     this.skuSelector             = (SKUSelector)this.FindControl("SKUSelector");
     this.consultations           = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
     this.correlative             = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
     this.nowTime                 = (HtmlInputHidden)this.FindControl("nowTime");
     this.nowTime.SetWhenIsNotNull(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo));
     this.hidden_skus        = (HtmlInputHidden)this.FindControl("hidden_skus");
     this.hidden_skuItem     = (HtmlInputHidden)this.FindControl("hidden_skuItem");
     this.hidden_IsOver      = (HtmlInputHidden)this.FindControl("hidden_IsOver");
     this.hidden_CountDownId = (HtmlInputHidden)this.FindControl("hidden_CountDownId");
     this.hidden_productId   = (HtmlInputHidden)this.FindControl("hidden_productId");
     this.hdShareDetails     = (HtmlInputHidden)this.FindControl("hdShareDetails");
     this.hdShareIcon        = (HtmlInputHidden)this.FindControl("hdShareIcon");
     this.hdShareTitle       = (HtmlInputHidden)this.FindControl("hdShareTitle");
     if (!this.Page.IsPostBack)
     {
         CountDownInfo countDownInfo  = PromoteHelper.GetCountDownInfo(this.countDownId, 0);
         SiteSettings  masterSettings = SettingsManager.GetMasterSettings();
         if (countDownInfo != null)
         {
             HtmlInputHidden htmlInputHidden = this.hidden_CountDownId;
             int             num             = countDownInfo.CountDownId;
             htmlInputHidden.Value = num.ToString();
             HtmlInputHidden htmlInputHidden2 = this.hidden_productId;
             num = countDownInfo.ProductId;
             htmlInputHidden2.Value = num.ToString();
             int num2 = 0;
             ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(countDownInfo.ProductId, null, masterSettings.OpenMultStore, 0);
             Literal           literal           = this.ltlReviewCount;
             num          = productBrowseInfo.ReviewCount;
             literal.Text = num.ToString();
             Literal literal2 = this.ltlSaleCount;
             num           = productBrowseInfo.SaleCount;
             literal2.Text = num.ToString();
             if (productBrowseInfo.Product == null)
             {
                 this.hidden_IsOver.Value = "pullOff";
             }
             else if (!productBrowseInfo.Product.SaleStatus.Equals(ProductSaleStatus.OnSale))
             {
                 this.hidden_IsOver.Value = "pullOff";
             }
             if (!string.IsNullOrEmpty(countDownInfo.ShareDetails))
             {
                 HtmlInputHidden htmlInputHidden3 = this.hdShareDetails;
                 htmlInputHidden3.Value += countDownInfo.ShareDetails;
             }
             else if (!string.IsNullOrEmpty(countDownInfo.Content))
             {
                 this.hdShareDetails.Value = "限时抢购简单说明:";
                 HtmlInputHidden htmlInputHidden4 = this.hdShareDetails;
                 htmlInputHidden4.Value += countDownInfo.Content;
             }
             else
             {
                 this.hdShareDetails.Value = "限时抢购简单说明:";
             }
             Literal literal3 = this.ltlConsultation;
             num                     = productBrowseInfo.ConsultationCount;
             literal3.Text           = num.ToString();
             this.hdShareIcon.Value  = Globals.FullPath(countDownInfo.ShareIcon);
             this.hdShareTitle.Value = countDownInfo.ShareTitle;
             if (countDownInfo.StartDate > DateTime.Now)
             {
                 this.hidden_IsOver.Value = "AboutToBegin";
             }
             else if (countDownInfo.EndDate < DateTime.Now)
             {
                 this.hidden_IsOver.Value = "over";
             }
             else if (!countDownInfo.IsRunning)
             {
                 this.hidden_IsOver.Value = "true";
             }
             num2 = PromoteHelper.GetCountDownSurplusNumber(this.countDownId);
             num2 = ((num2 >= 0) ? num2 : 0);
             this.litSurplusNumber.Text = num2.ToString();
             Dictionary <string, SKUItem> dictionary = new Dictionary <string, SKUItem>();
             foreach (SKUItem value2 in productBrowseInfo.Product.Skus.Values)
             {
                 CountDownSkuInfo countDownSkuInfo = (from c in countDownInfo.CountDownSkuInfo
                                                      where c.SkuId == value2.SkuId
                                                      select c).FirstOrDefault();
                 if (countDownSkuInfo != null)
                 {
                     value2.Stock = ((value2.Stock < countDownSkuInfo.ActivityTotal - countDownSkuInfo.BoughtCount) ? value2.Stock : (countDownSkuInfo.ActivityTotal - countDownSkuInfo.BoughtCount));
                 }
                 dictionary.Add(value2.SkuId, value2);
             }
             IEnumerable value = from item in dictionary
                                 select item.Value;
             if (JsonConvert.SerializeObject(productBrowseInfo.DbSKUs) != null)
             {
                 this.hidden_skuItem.Value = JsonConvert.SerializeObject(productBrowseInfo.DbSKUs);
             }
             if (this.hidden_skus != null)
             {
                 this.hidden_skus.Value = JsonConvert.SerializeObject(value);
             }
             this.LoadPageSearch(productBrowseInfo.Product);
             this.hpkProductConsultations.Target      = "_blank";
             this.hpkProductConsultations.Text        = "查看全部";
             this.hpkProductConsultations.NavigateUrl = $"ProductConsultationsAndReplay.aspx?productId={countDownInfo.ProductId}";
             this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName);
             this.LoadCountDownBuyInfo(countDownInfo);
             this.btnOrder.Stock = productBrowseInfo.Product.Stock;
             if (!countDownInfo.IsJoin)
             {
                 this.hidden_IsOver.Value = "nojoin";
             }
             BrowsedProductQueue.EnQueue(countDownInfo.ProductId);
             this.images.ImageInfo = productBrowseInfo.Product;
             if (productBrowseInfo.DbAttribute != null)
             {
                 this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute;
                 this.rptExpandAttributes.DataBind();
             }
             if (productBrowseInfo.DbSKUs != null)
             {
                 this.skuSelector.ProductId  = countDownInfo.ProductId;
                 this.skuSelector.DataSource = productBrowseInfo.DbSKUs;
             }
             if (productBrowseInfo.DBConsultations != null)
             {
                 this.consultations.DataSource = productBrowseInfo.DBConsultations;
                 this.consultations.DataBind();
             }
             if (productBrowseInfo.DbCorrelatives != null)
             {
                 this.correlative.DataSource = productBrowseInfo.DbCorrelatives;
                 this.correlative.DataBind();
             }
         }
         else
         {
             base.GotoResourceNotFound();
         }
     }
 }
Exemplo n.º 24
0
 public static void ShowBuyButton(bool show)
 {
     BuyButton.GetComponent <Button>().interactable = false;
     BuyButton.SetActive(show);
 }
Exemplo n.º 25
0
        protected override void AttachChildControls()
        {
            if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"]))
            {
                this.Page.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString() + "&ReferralUserId=" + HiContext.Current.User.UserId);
                return;
            }
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound();
            }
            this.hiddenpid         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddenpid");
            this.hiddeSkuId        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeSkuId");
            this.hiddeCategoryId   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeCategoryId");
            this.hiddeCategoryName = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeCategoryName");
            this.hidCartQuantity   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txCartQuantity");
            this.hiddeProductCode  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeProductCode");
            this.hiddeUserId       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeUserId");
            this.hiddeProductName  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeProductName");
            this.buyCardinality    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("buyCardinality");
            this.hiddenpid.Value   = this.productId.ToString();
            this.promote           = (ProductPromote)this.FindControl("ProductPromote");
            this.common_Location   = (Common_Location)this.FindControl("common_Location");
            this.litProductName    = (System.Web.UI.WebControls.Literal) this.FindControl("litProductName");
            this.lblProductCode    = (System.Web.UI.WebControls.Literal) this.FindControl("lblProductCode");
            this.lblSku            = (SkuLabel)this.FindControl("lblSku");
            this.lblStock          = (StockLabel)this.FindControl("lblStock");
            this.litUnit           = (System.Web.UI.WebControls.Literal) this.FindControl("litUnit");
            this.litBuyCardinality = (System.Web.UI.WebControls.Literal) this.FindControl("litBuyCardinality");
            this.litWeight         = (System.Web.UI.WebControls.Label) this.FindControl("litWeight");
            this.litBrosedNum      = (System.Web.UI.WebControls.Literal) this.FindControl("litBrosedNum");
            this.litBrand          = (System.Web.UI.WebControls.Literal) this.FindControl("litBrand");
            this.litSaleCounts     = (System.Web.UI.WebControls.Literal) this.FindControl("litSaleCounts");
            this.lblMarkerPrice    = (FormatedMoneyLabel)this.FindControl("lblMarkerPrice");
            this.lblBuyPrice       = (System.Web.UI.WebControls.Label) this.FindControl("lblBuyPrice");
            this.lblsmalltitle     = (System.Web.UI.WebControls.Label) this.FindControl("lblsmalltitle");

            this.lblTotalPrice       = (TotalLabel)this.FindControl("lblTotalPrice");
            this.litDescription      = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
            this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.btnBuy                  = (BuyButton)this.FindControl("btnBuy");
            this.btnaddgouwu             = (AddCartButton)this.FindControl("btnaddgouwu");
            this.hpkProductConsultations = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductConsultations");
            this.hpkProductReviews       = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductReviews");
            this.hpkProductSales         = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductSales");
            this.litReviewCount          = (System.Web.UI.WebControls.Literal) this.FindControl("litReviewCount");
            this.litItemNumber           = (System.Web.UI.WebControls.Literal) this.FindControl("litItemNumber");
            this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
            //this.rptExpandAttributes = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
            this.expandAttributes   = (Common_ExpandAttributes1)this.FindControl("expandAttributes");
            this.skuSelector        = (SKUSelector)this.FindControl("SKUSelector");
            this.reviews            = (Common_ProductReview)this.FindControl("list_Common_ProductReview");
            this.consultations      = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
            this.correlative        = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
            this.lbUserProductRefer = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.hidden_skus        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skus");
            this.hidden_skuItem     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skuItem");
            this.litTaxRate         = (System.Web.UI.WebControls.Literal) this.FindControl("litTaxRate");
            this.imgIcon            = (HiImage)this.FindControl("imgIcon");
            this.litCnArea          = (System.Web.UI.WebControls.Literal) this.FindControl("litCnArea");
            this.litShipping        = (System.Web.UI.WebControls.Literal) this.FindControl("litShipping");
            this.hotSale            = (Common_GoodsList_HotSale)this.FindControl("list_Common_GoodsList_HotSale"); //销售排行
            this.litCategoryNotes3  = (System.Web.UI.WebControls.Literal) this.FindControl("litCategoryNotes3");
            this.productImg         = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("productImg");       //二维码图片
            this.nowBuyBtn          = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("nowBuyBtn");
            this.litviewcount       = (System.Web.UI.WebControls.Literal) this.FindControl("litviewcount");
            this.hiddensupplierid   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddensupplierid");
            this.litMarkPrice       = (System.Web.UI.WebControls.Literal) this.FindControl("litMarkPrice");
            this.txtBuyAmount       = (BuyAmountBox)this.FindControl("txtBuyAmount");
            if (!this.Page.IsPostBack)
            {
                ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, new int?(this.reviews.MaxNum), new int?(this.consultations.MaxNum));
                if (productBrowseInfo.Product == null || productBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件商品已经被管理员删除"));
                    return;
                }
                if (this.hidCartQuantity != null)
                {
                    this.hidCartQuantity.Value = this.GetQuantity_Product(productBrowseInfo.Product.ProductId);
                }
                System.Collections.IEnumerable value =
                    from item in productBrowseInfo.Product.Skus
                    select item.Value;
                if (JsonConvert.SerializeObject(productBrowseInfo.DbSKUs) != null)
                {
                    this.hidden_skuItem.Value = JsonConvert.SerializeObject(productBrowseInfo.DbSKUs);
                }
                if (this.hidden_skus != null)
                {
                    this.hidden_skus.Value = JsonConvert.SerializeObject(value);
                }
                if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale)
                {
                    this.Page.Response.Redirect(Globals.GetSiteUrls().UrlData.FormatUrl("unproductdetails", new object[]
                    {
                        this.Page.Request.QueryString["productId"]
                    }));
                }
                if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnStock)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该商品已入库"));
                    return;
                }

                if (productBrowseInfo.cIsDisable == 1)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该商品已入库"));
                    return;
                }


                this.LoadPageSearch(productBrowseInfo.Product);
                if (this.lbUserProductRefer != null)
                {
                    this.lbUserProductRefer.product = productBrowseInfo.Product;
                }
                this.hpkProductReviews.Text       = "查看全部" + productBrowseInfo.ReviewCount.ToString() + "条评论";
                this.litviewcount.Text            = productBrowseInfo.ReviewCount.ToString();
                this.hpkProductConsultations.Text = "查看全部" + productBrowseInfo.ConsultationCount.ToString() + "条咨询";
                string count = ProductBrowser.GetLineItemNumber(this.productId).ToString();
                //this.hpkProductSales.Text = "查看全部" + count + "条成交记录";

                int countt = ProductBrowser.GetLineItemCount(this.productId);
                if (countt > 0)
                {
                    this.hpkProductSales.Text        = "查看全部" + countt + "条成交记录";
                    this.hpkProductSales.NavigateUrl = string.Format("LookLineItems.aspx?productId={0}", this.productId);
                }
                else
                {
                    this.hpkProductSales.Text = "暂无成交记录";
                }

                this.litReviewCount.Text = productBrowseInfo.ReviewCount.ToString();
                this.litItemNumber.Text  = countt.ToString();
                this.hpkProductConsultations.NavigateUrl = string.Format("ProductConsultationsAndReplay.aspx?productId={0}", this.productId);
                this.hpkProductReviews.NavigateUrl       = string.Format("LookProductReviews.aspx?productId={0}", this.productId);
                //this.hpkProductSales.NavigateUrl = string.Format("LookLineItems.aspx?productId={0}", this.productId);
                this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName);

                this.hiddeCategoryId.Value   = productBrowseInfo.CategoryId;
                this.hiddeCategoryName.Value = productBrowseInfo.CategoryName;
                this.hiddeProductName.Value  = productBrowseInfo.Product.ProductName;
                this.hiddeProductCode.Value  = productBrowseInfo.Product.ProductCode;
                this.hiddeUserId.Value       = HiContext.Current.User.UserId.ToString();
                this.btnBuy.Stock            = productBrowseInfo.Product.Stock;
                this.txtBuyAmount.Quantity   = productBrowseInfo.Product.BuyCardinality;
                this.btnaddgouwu.Stock       = productBrowseInfo.Product.Stock;
                BrowsedProductQueue.EnQueue(this.productId);
                this.images.ImageInfo = productBrowseInfo.Product;
                if (this.promote != null)
                {
                    this.promote.ProductId = this.productId;
                }
                if (productBrowseInfo.DbAttribute != null)
                {
                    this.expandAttributes.DbAttribute = productBrowseInfo.DbAttribute;//商品扩展属性
                    //this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute;
                    //this.rptExpandAttributes.DataBind();
                }
                if (productBrowseInfo.DbSKUs != null)
                {
                    this.skuSelector.ProductId  = this.productId;
                    this.skuSelector.DataSource = productBrowseInfo.DbSKUs;
                }
                if (productBrowseInfo.DBReviews != null)
                {
                    this.reviews.DataSource = productBrowseInfo.DBReviews;
                    this.reviews.DataBind();
                }
                if (productBrowseInfo.DBConsultations != null)
                {
                    this.consultations.DataSource = productBrowseInfo.DBConsultations;
                    this.consultations.DataBind();
                }
                if (productBrowseInfo.DbCorrelatives != null)
                {
                    this.correlative.DataSource = productBrowseInfo.DbCorrelatives;//推荐 ,捆绑或同类型下的商品
                    this.correlative.DataBind();
                }
                if (productBrowseInfo.DBHotSale != null)
                {
                    this.hotSale.DataSource = productBrowseInfo.DBHotSale;
                    this.hotSale.DataBind();
                }
                if (this.productImg != null)
                {
                    if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.QRcode))
                    {
                        this.productImg.Src = productBrowseInfo.Product.QRcode;
                    }
                    //else
                    //{
                    //    //this.productImg.Attributes.Add("display", "none");
                    //}
                }
                this.litCategoryNotes3.Text = productBrowseInfo.CategoryNote3;
            }
        }
Exemplo n.º 26
0
    public void SelectChar()
    {
        if (bPanel.IsPanelMovedIn())
        {
            watchAdsBut = GameObject.FindGameObjectWithTag("uiWatchAds").GetComponent <WatchAdsButton>();
            if (watchAdsBut == null)
            {
                Debug.Log("Character Button script couldnt get reference to the watch ads button.");
            }
            watchAdsBut.SetWiggle(false);


            if (!IsInCenter())
            {
                ForceToCenter();

                charSelectHighLight.SetActive(true);

                //playSound = false;
            }
            else
            {
                playSound = true;
            }


            // save the scroll position to saved data
            GameSaver.gSaver.scrollViewPosition = scrollRect.horizontalNormalizedPosition;

            if (!pScript.GetCharPurchased(charIndex))
            {
                Button btn = buyButton.GetComponent <Button>();
                if (btn == null)
                {
                    Debug.Log("Character Button couldnt get a reference to the Buy Button Button Script");
                }
                btn.enabled = true;

                BuyButton bbtn = buyButton.GetComponent <BuyButton>();
                if (btn == null)
                {
                    Debug.Log("Menu Button couldnt get a reference to the Buy Button Button component.");
                }
                else
                {
                    bbtn.SetWiggle(true);
                    Sprite img = gameObject.GetComponent <Image>().sprite;
                    bbtn.SetCharIndex(charIndex, img);
                }



                audioOut.PlayOneShot(acClickSelect, 0.9f);

                //get rid of arrow
                daScript.UnPop();

                menuButton.ShowCharFields();
                charCost.text = "" + pScript.GetCharCost(charIndex).ToString();
                charDist.text = "" + pScript.GetCharDistance(charIndex).ToString();
                charJump.text = "" + pScript.GetCharJumpTimes(charIndex).ToString();
            }
            else
            {
                Button btn = buyButton.GetComponent <Button>();
                if (btn == null)
                {
                    Debug.Log("Character Button couldnt get a reference to the Buy Button");
                }
                btn.enabled = false;
                BuyButton bbtn = buyButton.GetComponent <BuyButton>();
                if (btn == null)
                {
                    Debug.Log("Menu Button couldnt get a reference to the Buy Button Button component.");
                }
                else
                {
                    bbtn.SetWiggle(false);
                }



                audioOut.PlayOneShot(acClickOn, 0.8f);

                //make the arrow pop
                daScript.Pop();

                menuButton.ClearCharFields();
                charCost.text = "";
                charDist.text = "";
                charJump.text = "";

                Sprite img = gameObject.GetComponentInChildren <Image>().sprite;
                menuButton.SetCharSelected(charIndex, img);
            }
        }
    }
Exemplo n.º 27
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.common_Location         = (Common_Location)this.FindControl("common_Location");
     this.litProductName          = (System.Web.UI.WebControls.Literal) this.FindControl("litProductName");
     this.lblSku                  = (SkuLabel)this.FindControl("lblSku");
     this.lblStock                = (StockLabel)this.FindControl("lblStock");
     this.litUnit                 = (System.Web.UI.WebControls.Literal) this.FindControl("litUnit");
     this.litWeight               = (System.Web.UI.WebControls.Label) this.FindControl("litWeight");
     this.litBrosedNum            = (System.Web.UI.WebControls.Literal) this.FindControl("litBrosedNum");
     this.litBrand                = (System.Web.UI.WebControls.Literal) this.FindControl("litBrand");
     this.litContent              = (System.Web.UI.WebControls.Literal) this.FindControl("litContent");
     this.lblSalePrice            = (FormatedMoneyLabel)this.FindControl("lblSalePrice");
     this.lblTotalPrice           = (TotalLabel)this.FindControl("lblTotalPrice");
     this.litDescription          = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
     this.litShortDescription     = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
     this.btnOrder                = (BuyButton)this.FindControl("btnOrder");
     this.hpkProductConsultations = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductConsultations");
     this.hpkProductReviews       = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductReviews");
     this.txtMaxCount             = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtMaxCount");
     this.txtSoldCount            = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtSoldCount");
     this.lblCurrentSalePrice     = (FormatedMoneyLabel)this.FindControl("lblCurrentSalePrice");
     this.litCount                = (System.Web.UI.WebControls.Label) this.FindControl("litCount");
     this.lblNeedPrice            = (FormatedMoneyLabel)this.FindControl("lblNeedPrice");
     this.lblEndTime              = (FormatedTimeLabel)this.FindControl("lblEndTime");
     this.lblStartTime            = (FormatedTimeLabel)this.FindControl("lblStartTime");
     this.litRemainTime           = (System.Web.UI.WebControls.Literal) this.FindControl("litRemainTime");
     this.litNeedCount            = (System.Web.UI.WebControls.Literal) this.FindControl("litNeedCount");
     this.litMaxCount             = (System.Web.UI.WebControls.Label) this.FindControl("litMaxCount");
     this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
     this.rptExpandAttributes     = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
     this.skuSelector             = (SKUSelector)this.FindControl("SKUSelector");
     this.reviews                 = (Common_ProductReview)this.FindControl("list_Common_ProductReview");
     this.consultations           = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
     this.correlative             = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
     this.nowTime                 = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("nowTime");
     this.nowTime.SetWhenIsNotNull(System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo));
     this.hidden_skus    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skus");
     this.hidden_skuItem = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skuItem");
     if (!this.Page.IsPostBack)
     {
         ProductBrowseInfo productBrowseInfo   = ProductBrowser.GetProductBrowseInfo(this.productId, new int?(this.reviews.MaxNum), new int?(this.consultations.MaxNum));
         GroupBuyInfo      productGroupBuyInfo = ProductBrowser.GetProductGroupBuyInfo(this.productId);
         if (productBrowseInfo.Product == null || productGroupBuyInfo == null)
         {
             this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件商品参与的团购活动已经结束;或已被管理员删除"));
             return;
         }
         System.Collections.IEnumerable value =
             from item in productBrowseInfo.Product.Skus
             select item.Value;
         if (JsonConvert.SerializeObject(productBrowseInfo.DbSKUs) != null)
         {
             this.hidden_skuItem.Value = JsonConvert.SerializeObject(productBrowseInfo.DbSKUs);
         }
         if (this.hidden_skus != null)
         {
             this.hidden_skus.Value = JsonConvert.SerializeObject(value);
         }
         this.LoadPageSearch(productBrowseInfo.Product);
         this.hpkProductReviews.Text              = "查看全部" + productBrowseInfo.ReviewCount.ToString() + "条评论";
         this.hpkProductConsultations.Text        = "查看全部" + productBrowseInfo.ConsultationCount.ToString() + "条咨询";
         this.hpkProductConsultations.NavigateUrl = string.Format("ProductConsultationsAndReplay.aspx?productId={0}", this.productId);
         this.hpkProductReviews.NavigateUrl       = string.Format("LookProductReviews.aspx?productId={0}", this.productId);
         this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName);
         this.LoadProductGroupBuyInfo(productGroupBuyInfo);
         this.btnOrder.Stock = productBrowseInfo.Product.Stock;
         BrowsedProductQueue.EnQueue(this.productId);
         this.images.ImageInfo = productBrowseInfo.Product;
         this.litContent.Text  = productGroupBuyInfo.Content;
         if (productBrowseInfo.DbAttribute != null)
         {
             this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute;
             this.rptExpandAttributes.DataBind();
         }
         if (productBrowseInfo.DbSKUs != null)
         {
             this.skuSelector.ProductId  = this.productId;
             this.skuSelector.DataSource = productBrowseInfo.DbSKUs;
         }
         if (productBrowseInfo.DBReviews != null)
         {
             this.reviews.DataSource = productBrowseInfo.DBReviews;
             this.reviews.DataBind();
         }
         if (productBrowseInfo.DBConsultations != null)
         {
             this.consultations.DataSource = productBrowseInfo.DBConsultations;
             this.consultations.DataBind();
         }
         if (productBrowseInfo.DbCorrelatives != null)
         {
             this.correlative.DataSource = productBrowseInfo.DbCorrelatives;
             this.correlative.DataBind();
         }
     }
 }
Exemplo n.º 28
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(base.GetParameter("productId", false), out this.productId))
            {
                base.GotoResourceNotFound();
            }
            this.hiddenpid               = (HtmlInputHidden)this.FindControl("hiddenpid");
            this.hidCartQuantity         = (HtmlInputHidden)this.FindControl("txCartQuantity");
            this.hiddenpid.Value         = this.productId.ToString();
            this.common_Location         = (Common_Location)this.FindControl("common_Location");
            this.litProductName          = (Literal)this.FindControl("litProductName");
            this.lblStock                = (StockLabel)this.FindControl("lblStock");
            this.litUnit                 = (Literal)this.FindControl("litUnit");
            this.litSaleCounts           = (Literal)this.FindControl("litSaleCounts");
            this.lblMarkerPrice          = (FormatedMoneyLabel)this.FindControl("lblMarkerPrice");
            this.lblBuyPrice             = (Label)this.FindControl("lblBuyPrice");
            this.lblTotalPrice           = (TotalLabel)this.FindControl("lblTotalPrice");
            this.lblSku                  = (SkuLabel)this.FindControl("lblSku");
            this.litDescription          = (Literal)this.FindControl("litDescription");
            this.litShortDescription     = (Literal)this.FindControl("litShortDescription");
            this.btnBuy                  = (BuyButton)this.FindControl("btnBuy");
            this.btnaddgouwu             = (AddCartButton)this.FindControl("btnaddgouwu");
            this.hpkProductConsultations = (HyperLink)this.FindControl("hpkProductConsultations");
            this.ltlSaleCount            = (Literal)this.FindControl("ltlSaleCount");
            this.ltlReviewCount          = (Literal)this.FindControl("ltlReviewCount");
            this.litReviewCount          = (Literal)this.FindControl("litReviewCount");
            this.ltlConsultation         = (Literal)this.FindControl("ltlConsultation");
            this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
            this.rptExpandAttributes     = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
            this.rptOnlineService        = (ThemedTemplatedRepeater)this.FindControl("rptOnlineService");
            this.skuSelector             = (SKUSelector)this.FindControl("SKUSelector");
            this.consultations           = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
            this.correlative             = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
            this.lbUserProductRefer      = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.hidden_skus             = (HtmlInputHidden)this.FindControl("hidden_skus");
            this.hidden_skuItem          = (HtmlInputHidden)this.FindControl("hidden_skuItem");
            this.hidIsOpenMultiStore     = (HtmlInputHidden)this.FindControl("hidIsOpenMultiStore");
            this.aCountDownUrl           = (HyperLink)this.FindControl("aCountDownUrl");
            this.imgQrCode               = (Image)this.FindControl("imgQrCode");
            this.phonePriceQrCode        = (Image)this.FindControl("phonePriceQrCode");
            this.liCode                  = (HtmlGenericControl)this.FindControl("liCode");
            this.hidden_productId        = (HtmlInputHidden)this.FindControl("hidden_productId");
            this.hidHasStores            = (HtmlInputHidden)this.FindControl("hidHasStores");
            this.divGift                 = (HtmlGenericControl)this.FindControl("divGift");
            this.ltlGiftName             = (Literal)this.FindControl("ltlGiftName");
            this.ltlGiftNum              = (Literal)this.FindControl("ltlGiftNum");
            this.aBrand                  = (HtmlAnchor)this.FindControl("aBrand");
            this.imgBrand                = (HiImage)this.FindControl("imgBrand");
            this.imgCustomerService      = (HtmlImage)this.FindControl("imgCustomerService");
            this.ltlOrderPromotion       = (Literal)this.FindControl("ltlOrderPromotion");
            this.divOrderPromotions      = (HtmlGenericControl)this.FindControl("divOrderPromotions");
            this.divPhonePrice           = (HtmlGenericControl)this.FindControl("divPhonePrice");
            this.litPhonePrice           = (Literal)this.FindControl("litPhonePrice");
            this.litPhonePriceEndDate    = (Literal)this.FindControl("litPhonePriceEndDate");
            this.divCuxiao               = (HtmlGenericControl)this.FindControl("divCuxiao");
            this.ltlUnit                 = (Literal)this.FindControl("ltlUnit");
            this.divProductReferral      = (HtmlGenericControl)this.FindControl("divProductReferral");
            this.ltlProductSendGifts     = (Literal)this.FindControl("ltlProductSendGifts");
            this.setDeliverRegion        = (Common_SetDeliveryRegion)this.FindControl("setDeliverRegion");
            this.hidShowCombinationBuy   = (HtmlInputHidden)this.FindControl("hidShowCombinationBuy");
            this.hidCombinationId        = (HtmlInputHidden)this.FindControl("hidCombinationId");
            this.imgMainPic              = (HtmlImage)this.FindControl("imgMainPic");
            this.divqq = (HtmlGenericControl)this.FindControl("divqq");
            HtmlAnchor htmlAnchor = (HtmlAnchor)this.FindControl("aMainName");

            this.lblMainPrice = (Label)this.FindControl("lblMainPrice");
            ThemedTemplatedRepeater themedTemplatedRepeater = (ThemedTemplatedRepeater)this.FindControl("rptOtherProducts");

            this.aCountDownUrl.Visible = false;
            if (this.Page.IsPostBack)
            {
                return;
            }
            if (this.imgQrCode != null)
            {
                string text = "/Storage/master/QRCode/" + HttpContext.Current.Request.Url.Host + "_" + this.productId + ".png";
                Globals.CreateQRCode(HttpContext.Current.Request.Url.ToString(), text, false, ImageFormats.Png);
                this.imgQrCode.ImageUrl = text;
            }
            if (this.phonePriceQrCode != null)
            {
                string text2 = "/Storage/master/QRCode/" + HttpContext.Current.Request.Url.Host + "_" + this.productId + ".png";
                Globals.CreateQRCode(HttpContext.Current.Request.Url.ToString(), text2, false, ImageFormats.Png);
                this.phonePriceQrCode.ImageUrl = text2;
            }
            if (this.liCode != null && HiContext.Current.SiteSettings.OpenAliho == 0 && HiContext.Current.SiteSettings.OpenVstore == 0 && HiContext.Current.SiteSettings.OpenWap == 0 && HiContext.Current.SiteSettings.OpenMobbile == 0)
            {
                this.liCode.Visible = false;
            }
            ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, null, this.sitesettings.OpenMultStore, 0);

            if (productBrowseInfo.Product == null || productBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
            {
                this.Page.Response.Redirect("/ProductDelete.aspx");
                return;
            }
            if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnSale && productBrowseInfo.Product.AuditStatus == ProductAuditStatus.Pass)
            {
                this.Page.Response.Redirect(base.GetRouteUrl("productdetails", new
                {
                    ProductId = this.productId
                }));
            }
            this.setDeliverRegion.ShippingTemplateId = productBrowseInfo.Product.ShippingTemplateId;
            this.setDeliverRegion.Volume             = productBrowseInfo.Product.Weight;
            this.setDeliverRegion.Weight             = productBrowseInfo.Product.Weight;
            if (this.hidCartQuantity != null)
            {
                this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(productBrowseInfo.Product.ProductId);
            }
            IEnumerable value = from item in productBrowseInfo.Product.Skus
                                select item.Value;

            if (JsonConvert.SerializeObject(productBrowseInfo.DbSKUs) != null)
            {
                this.hidden_skuItem.Value = JsonConvert.SerializeObject(productBrowseInfo.DbSKUs);
            }
            if (this.hidden_skus != null)
            {
                this.hidden_skus.Value = JsonConvert.SerializeObject(value);
            }
            this.hidden_productId.Value = this.productId.ToString();
            this.LoadPageSearch(productBrowseInfo.Product);
            if (this.lbUserProductRefer != null && this.sitesettings.OpenReferral == 1 && this.sitesettings.ShowDeductInProductPage)
            {
                this.lbUserProductRefer.product = productBrowseInfo.Product;
            }
            HyperLink hyperLink = this.hpkProductConsultations;
            int       num       = productBrowseInfo.ConsultationCount;

            hyperLink.Text = "查看全部" + num.ToString() + "条咨询";
            Literal literal = this.ltlConsultation;

            num          = productBrowseInfo.ConsultationCount;
            literal.Text = num.ToString();
            Literal literal2 = this.ltlSaleCount;

            num           = productBrowseInfo.SaleCount;
            literal2.Text = num.ToString();
            Literal literal3 = this.ltlReviewCount;

            num           = productBrowseInfo.ReviewCount;
            literal3.Text = num.ToString();
            Literal literal4 = this.litReviewCount;

            num           = productBrowseInfo.ReviewCount;
            literal4.Text = num.ToString();
            this.hpkProductConsultations.NavigateUrl = $"ProductConsultationsAndReplay.aspx?productId={this.productId}";
            this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName);
            this.btnBuy.Stock   = (this.sitesettings.OpenMultStore ? productBrowseInfo.Product.DefaultSku.MaxStock : productBrowseInfo.Product.Stock);
            this.btnBuy.Visible = false;
            this.ltlUnit.Text   = productBrowseInfo.Product.Unit;
            this.divqq.Visible  = (this.sitesettings.ServiceIsOpen == "1");
            MemberInfo user = HiContext.Current.User;

            if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || productBrowseInfo.Product.SubMemberDeduct.HasValue))
            {
                if (!productBrowseInfo.Product.SubMemberDeduct.HasValue)
                {
                    goto IL_0acd;
                }
                decimal?subMemberDeduct = productBrowseInfo.Product.SubMemberDeduct;
                if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue)
                {
                    goto IL_0acd;
                }
            }
            goto IL_0af3;
IL_0af3:
            int num2 = 1;

            goto IL_0af4;
IL_0acd:
            if (HiContext.Current.SiteSettings.OpenReferral == 1)
            {
                num2 = ((!HiContext.Current.SiteSettings.ShowDeductInProductPage) ? 1 : 0);
                goto IL_0af4;
            }
            goto IL_0af3;
IL_0af4:
            if (num2 != 0)
            {
                this.divProductReferral.Visible = false;
            }
            this.btnaddgouwu.Stock   = (this.sitesettings.OpenMultStore ? productBrowseInfo.Product.DefaultSku.MaxStock : productBrowseInfo.Product.Stock);
            this.btnaddgouwu.Visible = false;
            BrowsedProductQueue.EnQueue(this.productId);
            this.images.ImageInfo = productBrowseInfo.Product;
            if (productBrowseInfo.DbAttribute != null)
            {
                this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute;
                this.rptExpandAttributes.DataBind();
            }
            if (productBrowseInfo.DbSKUs != null)
            {
                this.skuSelector.ProductId  = this.productId;
                this.skuSelector.DataSource = productBrowseInfo.DbSKUs;
            }
            if (productBrowseInfo.Product.BrandId.HasValue)
            {
                BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value);
                if (brandCategory != null && !string.IsNullOrEmpty(brandCategory.Logo))
                {
                    this.imgBrand.ImageUrl = brandCategory.Logo;
                    this.aBrand.HRef       = base.GetRouteUrl("branddetails", new
                    {
                        brandId = brandCategory.BrandId
                    });
                }
            }
            if (productBrowseInfo.DBConsultations != null)
            {
                this.consultations.DataSource = productBrowseInfo.DBConsultations;
                this.consultations.DataBind();
            }
            if (productBrowseInfo.DbCorrelatives != null)
            {
                this.correlative.DataSource = productBrowseInfo.DbCorrelatives;
                this.correlative.DataBind();
            }
            this.BindOrderPromotions();
            string productPromotionsInfo = this.GetProductPromotionsInfo();

            this.ltlProductSendGifts.Text = productPromotionsInfo;
            if (!this.divOrderPromotions.Visible && productPromotionsInfo == string.Empty)
            {
                this.divCuxiao.Style.Add("display", "none");
            }
            if (this.rptOnlineService != null)
            {
                IList <OnlineServiceInfo> allOnlineService  = OnlineServiceHelper.GetAllOnlineService(0, 1);
                IList <OnlineServiceInfo> allOnlineService2 = OnlineServiceHelper.GetAllOnlineService(0, 2);
                if (allOnlineService2 != null)
                {
                    foreach (OnlineServiceInfo item in allOnlineService2)
                    {
                        allOnlineService.Add(item);
                    }
                }
                this.rptOnlineService.DataSource = allOnlineService;
                this.rptOnlineService.DataBind();
            }
        }
Exemplo n.º 29
0
 private void SetupUI()
 {
     HeaderPrice.AddShadow(2);
     BuyButton.AddShadow(-2);
     SetupListHeight();
 }
Exemplo n.º 30
0
    public void OpenMenu()
    {
        if (scrollView != null && !gScript.IsRoundNewTime())
        {
            if (disableMenuButton == false)
            {
                if (scrollIsActive == false)
                {
                    gScript.PauseGame(true);

                    buyPanelActive = true;

                    panel.SetActive(true);

                    audioOut.PlayOneShot(acClickOn, 0.8f);
                    backGroundFade.SetActive(true);

                    buyButton.SetActive(true);

                    BackButton blarg = backButton.GetComponentInParent <BackButton>();
                    if (roundOver == true)
                    {
                        backButton.enabled = false;
                        if (blarg != null)
                        {
                            blarg.SetAlpha(0f);
                        }
                    }
                    else
                    {
                        backButton.enabled = true;
                        if (blarg != null)
                        {
                            blarg.SetAlpha(255f);
                        }
                    }

                    // move the canvas in
                    bPanel.SetMovePanelIn();

                    watchAdsBut = GameObject.FindGameObjectWithTag("uiWatchAds").GetComponent <WatchAdsButton>();
                    if (watchAdsBut == null)
                    {
                        Debug.Log("Menu Button script couldnt get reference to the watch ads button.");
                    }
                    watchAdsBut.SetWiggle(false);

                    Button btn = buyButton.GetComponent <Button>();
                    if (btn == null)
                    {
                        Debug.Log("Menu Button couldnt get a reference to the Buy Button Button component.");
                    }
                    else
                    {
                        btn.enabled = false;
                    }

                    BuyButton bbtn = buyButton.GetComponent <BuyButton>();
                    if (btn == null)
                    {
                        Debug.Log("Menu Button couldnt get a reference to the Buy Button Button component.");
                    }
                    else
                    {
                        bbtn.SetWiggle(false);
                    }



                    // get reference to the text that shows the coin bank and update
                    Text coinB = GameObject.FindGameObjectWithTag("uiTotalCoins").GetComponent <Text>();
                    if (coinB != null)
                    {
                        string str = "" + gScript.GetBigCoinBank().ToString();
                        coinB.text = str;
                    }

                    // update current lerper character fields
                    currentName.text     = "" + pScript.GetCharName(charIndex);
                    currentJump.text     = "" + pScript.GetCharJumpTimes(charIndex).ToString();
                    currentDistance.text = "" + pScript.GetCharDistance(charIndex).ToString();
                    currentLevel.text    = "" + pScript.GetCharLevel(charIndex).ToString();

                    // close the winpanel
                    //winPanel.SetActive(false);

                    playButton.enabled = true;
                    scrollView.SetActive(true);
                    scrollIsActive = true;


                    GameSaver.gSaver.SaveData();
                    Debug.Log("bugger");
                }
                else
                {
                    if (roundOver == false)
                    {
                        CloseMenu();
                    }
                }
            }
        }
    }
    public virtual void SetHoverState(GameObject hoverObject)
    {
        unit = hoverObject.transform.root.GetComponent<Unit>();
        building = hoverObject.transform.root.GetComponent<Building>();
        button = hoverObject.transform.root.GetComponent<BuyButton>();

        if (player.SelectedObject)
        {
            // nur verarbeiten wenn besitzt von einem menschlichen spieler und zurzeit selected
            if ((player.SelectedObject.team == player.team) && player.human && currentlySelected)
            {
                if (hoverObject.name != "Ground" && hoverObject.name != "wall" && hoverObject.name != "table")
                {
                    Unit unit_loc = hoverObject.transform.root.GetComponent<Unit>();
                    Building building_loc = hoverObject.transform.root.GetComponent<Building>();
                    BuyButton button_loc = hoverObject.transform.root.GetComponent<BuyButton>();

                    if (unit_loc)
                    {
                        CanAttack(unit_loc, null, null);

                        if (unit_loc.team == player.team)
                        {
                            player.hud.SetCursorState(CursorState.Select);
                        }

                        else if (canAttack == true)
                        {
                            player.hud.SetCursorState(CursorState.Attack);
                        }
                    }

                    else if (building_loc)
                    {
                        CanAttack(null, building_loc, null);

                        if (building_loc.team == player.team)
                        {
                            player.hud.SetCursorState(CursorState.Select);
                        }

                        else if (canAttack == true)
                        {
                            player.hud.SetCursorState(CursorState.Attack);
                        }
                    }

                    else if (button_loc)
                    {
                        if (button_loc.team == player.team)
                        {
                            player.hud.SetCursorState(CursorState.Select);
                        }
                    }
                }

                else
                {
                    player.hud.SetCursorState(CursorState.Default);
                }
            }

            if (hoverObject.GetComponent<Ammo>())
            {
                player.hud.SetCursorState(CursorState.Select);
            }

            //else
            //{
            //    player.hud.SetCursorState(CursorState.Default);
            //}
        }
    }