Ejemplo n.º 1
0
        //判斷飲料金額不為負值
        public static int DrinkPriceIsNotSmall(AddDrinkDetails addDks)
        {
            int Price = 0;

            foreach (var item in addDks.DrinkDetails)
            {
                if (item.DrinkPrice < 0)
                {
                    Price = -1;
                    break;
                }
                Price = 1;
            }

            return(Price);
        }
Ejemplo n.º 2
0
        //取出返回動態新增飲料細節的ViewModel
        public static AddDrinkDetails BackAddDrinkDetails(AddDrinkDetails addDks)
        {
            //取出飲料尺寸的ViewModel
            List <SelectListItem> mySize = ManagerModels.mySize(addDks.MenuID);

            //取出飲料甜度的ViewModel
            IList <SelectListItem> mySweet = ManagerModels.mySweet(addDks.MenuID);

            //取出飲料冰度的ViewModel
            IList <SelectListItem> myIce = ManagerModels.myIce(addDks.MenuID);

            //取出飲料冰度的ViewModel
            IList <SelectListItem> myAddItem = ManagerModels.myAddItem(addDks.MenuID);

            foreach (var item in addDks.DrinkDetails)
            {
                item.SizeType = mySize;
                item.Sweet    = mySweet;
                item.IceHot   = myIce;
                item.AddItem  = myAddItem;
            }

            return(addDks);
        }