public static CheeseToppingDTO MapToDTO(CheeseToppingDAO topping)
        {
            var ct = new CheeseToppingDTO();

            ct.Id     = topping.Id;
            ct.Pizza  = PizzaMapper.MapToDTO(topping.Pizza);
            ct.Cheese = CheeseMapper.MapToDTO(topping.Cheese);
            ct.Active = topping.Active;

            return(ct);
        }
        public bool CreatePizza(SizeDTO size, CrustDTO crust, SauceDTO sauce, CheeseDTO cheese, List <CheeseDTO> cheeses, List <MeatDTO> meats, List <VegetableDTO> vegetables, int quantity)
        {
            PizzaDTO pizza = new PizzaDTO {
                Size = size, Crust = crust, Sauce = sauce, Cheese = cheese, Quantity = quantity, Active = true
            };

            if (InsertPizza(pizza))
            {
                pizza = GetPizzas().Last();
                if (cheeses != null)
                {
                    foreach (var item in cheeses)
                    {
                        CheeseToppingDTO ct = new CheeseToppingDTO {
                            Cheese = item, Pizza = pizza
                        };
                        if (InsertCheeseTopping(ct))
                        {
                            continue;
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
                if (meats != null)
                {
                    foreach (var item in meats)
                    {
                        MeatToppingDTO mt = new MeatToppingDTO {
                            Meat = item, Pizza = pizza
                        };
                        if (InsertMeatTopping(mt))
                        {
                            continue;
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
                if (vegetables != null)
                {
                    foreach (var item in vegetables)
                    {
                        VegetableToppingDTO vt = new VegetableToppingDTO {
                            Vegetable = item, Pizza = pizza
                        };
                        if (InsertVegetableTopping(vt))
                        {
                            continue;
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
 public bool DeleteCheeseTopping(CheeseToppingDTO item)
 {
     return(pssc.DeleteCheeseTopping(CheeseToppingMapper.MapToDAO(item)));
 }
 public bool InsertCheeseTopping(CheeseToppingDTO item)
 {
     return(pssc.InsertCheeseTopping(CheeseToppingMapper.MapToDAO(item)));
 }
 public bool ChangeCheeseTopping(CheeseToppingDTO item)
 {
     return(pssc.ChangeCheeseTopping(CheeseToppingMapper.MapToDAO(item)));
 }