Пример #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;
        }