Ejemplo n.º 1
0
        public static Salad GetSalad(GuestItem dbGuestItem)
        {
            var sizeOfSalad = SaladSize.None;

            switch (dbGuestItem.SelectSizeID)
            {
            case 7:
                sizeOfSalad = SaladSize.Small;
                break;

            case 8:
                sizeOfSalad = SaladSize.Large;
                break;

            case 14:
                sizeOfSalad = SaladSize.LunchSpecial;
                break;
            }
            var salad = new Salad(sizeOfSalad);

            if (dbGuestItem.Mods.Count > 0)
            {
                GetSaladToppings(dbGuestItem, ref salad);
            }
            salad.PopulateBasePrice();
            salad.PopulateDisplayName();
            salad.PopulatePricePerItem();
            salad.DbItemId         = dbGuestItem.ID;
            salad.WasSentToKitchen = dbGuestItem.OrderSent;
            salad.DbOrderId        = (int)dbGuestItem.OrderID;
            salad.ItemCount        = 1;
            return(salad);
        }