예제 #1
0
        public static int CreateNewProductScreen(OrderDetail targetSouce, bool isAdd)
        {
            //mode true = add , false = edit,remove
            ProductScreen productScreen = new ProductScreen();

            productScreen.PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(productScreen_PreviewMouseDown);

            foreach (var p in DataManager.ProductListbyCategories(isAdd))
            {
                productScreen.panelAddr1.Children.Add(btnCreator.BtnAddProductInfo(110, 156, 25, p));
            }
            productScreen.ShowDialog();


            if (productScreen.Data == null)
            {
                return(0);
            }
            //사용자가 타이밍안에 음식을 고르지 못하고 메뉴화면이꺼졌을대 리턴0
            //2011-4-2

            targetSouce.ProductID = DataManager.GetProductID(productScreen.Data);
            if (targetSouce.ProductID != 63) //63 == 취소
            //if (productScreen.Data != "취소")
            {
                return(1);
            }
            else
            {
                return(0);
            }

            //  return selName;
        }
예제 #2
0
        public static void CreateNewNumberScreen(OrderDetail target)
        {
            ProductScreen numberScreen = new ProductScreen();

            numberScreen.PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(ProductScreen_PreviewMouseDown);

            //CreateNewNumberScreen(310, 310, 50);
            for (int i = 1; i < 30; i++)
            {
                numberScreen.panelAddr1.Children.Add(btnCreator.btnNumber(310, 310, 50, i.ToString()));
            }
            numberScreen.ShowDialog();

            if (numberScreen.Data == null)
            {
                target.Quantity = 1;
            }
            //2011-4-2 사용자가 제시간안에 못눌렀을때


            if (numberScreen.Data != "취소")
            {
                target.Quantity = Convert.ToInt32(numberScreen.Data);
            }
            else
            {
                target.Quantity = 1;
            }
            //  return selName;
        }
예제 #3
0
 protected override void Awake()
 {
     id = (int)ProductType.LUXURY;
     base.Awake();
     bssId = CollabBrowserId.LUXURYCAR;
     url   = ProductScreen.GetProductURL("016240");
     requestReplacements.Add(BaseURL + "/images/upload/custom/greencar/automotive-luxury.jpg", Directory.GetCurrentDirectory() + "/img/automotive-luxury.png");
 }
예제 #4
0
 private void AddProductToList(int id, ProductScreen p)
 {
     while (id >= products.Count)
     {
         products.Add(null);
     }
     products[id] = p;
 }
예제 #5
0
 protected override void Awake()
 {
     id = (int)ProductType.SMALL;
     base.Awake();
     bssId = CollabBrowserId.SMALLCAR;
     url   = ProductScreen.GetProductURL("5V73Ub");
     requestReplacements.Add(BaseURL + "/images/upload/custom/greencar/automotive-small.jpg", Directory.GetCurrentDirectory() + "/img/automotive-small.png");
 }
예제 #6
0
    void OnGUI()
    {
        if (Products.Count == 0)
        {
            return;
        }

        if (Event.current != null && Event.current.type == EventType.MouseUp)
        {
            GameObject    hitObject = MouseHelpers.GetCurrentGameObjectHit();
            ProductScreen product   = (hitObject != null) ? hitObject.GetComponent <ProductScreen>() : null;
            if (product != null)
            {
                product.HandleMouseUpEvent();
            }
        }
    }
예제 #7
0
        private void selectProductId_MouseUp(object sender, MouseButtonEventArgs e)
        {
            var chooseProduct = new ProductScreen();

            chooseProduct.contentBack.Content = "Edit order";
            chooseProduct.PickProductId       = (x) =>
            {
                product            = x;
                editProductId.Text = product.Product_Name;

                // Cập nhật giá cả + giá bán + tổng (xóa rồi nhập lại để gọi hàm phát sinh)
                string numberBuy = numberBuyTextBox.Text;
                numberBuyTextBox.Text = "";
                numberBuyTextBox.Text = numberBuy;
            };
            createOrdersScreen.Children.Add(chooseProduct);
        }
예제 #8
0
    private void SetupSimType(string type)
    {
        bool generic_sim = (simType != "uimx_sustain");

        for (int i = ProductScreen.GetAll().Count - 1; i >= 0; --i)
        {
            ProductScreen.GetAll()[i].gameObject.SetActive(!generic_sim);
        }
        for (int i = GenericSimScreen.GetAll().Count - 1; i >= 0; --i)
        {
            GenericSimScreen.GetAll()[i].gameObject.SetActive(generic_sim);
        }

        if (!generic_sim)
        {
            TreeDisplayManager.Inst.SetLevel(1);
            if (productMgr != null && productMgr.productDisplay != null)
            {
                productMgr.productDisplay.DisplayScreenIcons();
            }
        }
        else
        {
            // replace car specific materials:
            GameObject snowGlobe      = GameObject.Find("globe_base_tiered");
            Material   replacementMat = (Material)Resources.Load("Materials/Asphalt");
            if (snowGlobe && replacementMat)
            {
                Renderer[] r = snowGlobe.GetComponentsInChildren <Renderer>() as Renderer[];
                for (int i = 0; i < r.Length; ++i)
                {
                    MaterialHelpers.ReplaceAllMaterials(r[i], replacementMat);
                }
            }
        }
        TreeDisplayManager.Inst.Enable(!generic_sim);
    }