public System.Collections.Generic.List <Crust> GetList()
        {
            PizzaboxDBContext Context = new PizzaboxDBContext();
            CrustMapper       Mapper  = new CrustMapper();

            return(Context.PizzaCrusts.Select(Mapper.Map).ToList());
        }
        public IEnumerable <PizzaLib.Crust> PizzaReturn()
        {
            var query = from e in db.Crust
                        select CrustMapper.Map(e);

            return(query);
        }
示例#3
0
        public List <CrustDAO> getCrusts()
        {
            List <CrustDAO> crusts = new List <CrustDAO>();

            foreach (var item in data.GetCrustsList())
            {
                crusts.Add(CrustMapper.Crust_CrustDAO(item));
            }
            return(crusts);
        }
        public List <CrustDAO> GetCrusts()
        {
            var returnList = new List <CrustDAO>();

            foreach (var item in data.GetCrusts())
            {
                returnList.Add(CrustMapper.MapToCrustDAO(item));
            }

            return(returnList);
        }
示例#5
0
        public PizzaOrderDAO GetPizzaOrder(int id)
        {
            PizzaOrderDAO   po           = new PizzaOrderDAO();
            PizzaOrder      temppo       = new PizzaOrder();
            List <Order>    temporder    = new List <Order>();
            List <Pizza>    temppizzas   = new List <Pizza>();
            List <PizzaDAO> temppizzaDAO = new List <PizzaDAO>();


            temppo      = data.GetPizzaOrderByID(id);
            po.ID       = temppo.PizzaOrderID;
            po.Customer = GetCustomerByID(int.Parse(temppo.CustomerID.ToString()));
            temporder   = data.GetOrderByID(po.ID);
            temppizzas  = data.GetPizzaList(temporder);

            foreach (var item in temppizzas)
            {
                var tempToppings    = data.GetToppingsOnPizza(int.Parse(item.PizzaID.ToString()));
                var tempCheeses     = data.GetCheesesOnPizza(int.Parse(item.PizzaID.ToString()));
                var tempToppingsDAO = new List <ToppingDAO>();
                var tempCheesesDAO  = new List <CheeseDAO>();

                foreach (var i in tempToppings)
                {
                    tempToppingsDAO.Add(ToppingMapper.Topping_ToppingDAO(i));
                }
                foreach (var y in tempCheeses)
                {
                    tempCheesesDAO.Add(CheeseMapper.Cheese_CheeseDAO(y));
                }


                var t = new PizzaDAO
                {
                    ID       = item.PizzaID,
                    Crust    = CrustMapper.Crust_CrustDAO(data.GetCrustOnPizza(int.Parse(item.CrustID.ToString()))),
                    Sauce    = SauceMapper.Sauce_SauceDAO(data.GetSauceOnPizza(int.Parse(item.SauceID.ToString()))),
                    Size     = SizeMapper.Size_SizeDAO(data.GetSizeOfPizza(int.Parse(item.SizeID.ToString()))),
                    Toppings = tempToppingsDAO,
                    Cheeses  = tempCheesesDAO
                };

                temppizzaDAO.Add(t);
            }
            OrderDAO order = new OrderDAO();

            order.Pizzas = temppizzaDAO;
            po.Order     = order;

            return(po);
        }
 public bool InsertCrust(CrustDAO crust)
 {
     return(data.InsertCrust(CrustMapper.MapToCrust(crust)));
 }
 public bool ChangeCrust(CrustDAO crust)
 {
     return(data.ChangeCrust(CrustMapper.MapToCrust(crust)));
 }
 public CrustDAO GetCrust(int id)
 {
     return(CrustMapper.MapToCrustDAO(data.GetCrust(id)));
 }
 public bool DeleteCrust(CrustDAO crust)
 {
     return(data.DeleteCrust(CrustMapper.MapToCrust(crust)));
 }
 public bool InsertCrust(CrustDTO item)
 {
     return(pssc.InsertCrust(CrustMapper.MapToDAO(item)));
 }
 public bool DeleteCrust(CrustDTO item)
 {
     return(pssc.DeleteCrust(CrustMapper.MapToDAO(item)));
 }
 public bool ChangeCrust(CrustDTO item)
 {
     return(pssc.ChangeCrust(CrustMapper.MapToDAO(item)));
 }
 public CrustDTO GetCrust(int id)
 {
     return(CrustMapper.MapToDTO(pssc.GetCrust(id)));
 }