예제 #1
0
 public void ShowBill()
 {
     Msgs.showMsg("Dear Customer your BillID for Order is:" + BillID + "and total Bill :" + Bill + "and your exchange is");
     exchangeCalculate(Bill);
 }
예제 #2
0
 public void box()
 {
     Msgs.showMsg("PizzaBoxed");
 }
예제 #3
0
 public void Bake()
 {
     Msgs.showMsg("PizzaBaked");
 }
예제 #4
0
        public void BuyPizza()
        {
            Double doubleVal = 0;

            Msgs.showMsg("enter money in NIS before bicking:");
            Msgs.showMsg("Total inserted money :" + total);
            var totalEntered = Console.ReadLine();

            if (Double.TryParse(totalEntered, out doubleVal))
            {
                if (ValidateCash.validateInserted(totalEntered))
                {
                    total += doubleVal;
                    if (Shared.PizzaAmount.TryGetValue(keyPadInput, out item))
                    {
                        if (item.Count > 0)
                        {
                            if (ValidateCash.validateCashInput(item.ID1, item.Price, total) == true)
                            {
                                if (item.Count > 0)
                                {
                                    Bake();
                                    Msgs.showMsg("do you want it sliced or cut");
                                    Msgs.showMsg("type y/Y for yes and n/N for no");
                                    var ans = Console.Read();
                                    if (ans == 'y' || ans == 'Y')
                                    {
                                        cut(item.ID1);
                                        Msgs.showMsg("BonApitite");
                                    }
                                    else if (ans == 'n' || ans == 'N')
                                    {
                                        Msgs.showMsg("BonApitite");
                                    }
                                    var invo = new Invoice(item.ID1, (total - item.Price).ToString());
                                    invo.ShowBill();
                                    item.Count -= 1;
                                    total       = 0;
                                    box();
                                }
                                else
                                {
                                    Msgs.showMsg("This Type of Pizza is Unavailable");
                                }
                            }
                        }
                        else
                        {
                            Msgs.showMsg("there is no Pizza of this Choice");
                        }
                    }
                    else
                    {
                        Exceptions.showError("Ivalid Choice, Chose from the vending machnie Pizza IDs");
                    }
                }
                else
                {
                    Exceptions.showError("the input is invalid");
                }
            }
            else
            {
                Exceptions.showError("the input is invalid");
            }
        }