示例#1
0
        public System.Collections.Generic.List <Size> GetList()
        {
            PizzaboxDBContext Context = new PizzaboxDBContext();
            SizeMapper        Mapper  = new SizeMapper();

            return(Context.PizzaSizes.Select(Mapper.Map).ToList());
        }
示例#2
0
        public List <SizeDAO> getSizes()
        {
            List <SizeDAO> sizes = new List <SizeDAO>();

            foreach (var item in data.GetSizesList())
            {
                sizes.Add(SizeMapper.Size_SizeDAO(item));
            }
            return(sizes);
        }
        public List <SizeDAO> GetSizes()
        {
            var returnList = new List <SizeDAO>();

            foreach (var item in data.GetSizes())
            {
                returnList.Add(SizeMapper.MapToSizeDAO(item));
            }

            return(returnList);
        }
        public List <SizeDTO> GetSizes()
        {
            var returnList = new List <SizeDTO>();

            foreach (var item in pssc.GetSizes())
            {
                returnList.Add(SizeMapper.MapToDTO(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);
        }
示例#6
0
 public static int SizeOfArray <T>(T[] value)
 {
     return(value.Sum(v => SizeMapper <T> .ValueSizeFunc(v)));
 }
示例#7
0
 public static int SizeOfMessage <T>(T value, bool includeHeader = false)
 {
     return(SizeMapper <T> .MessageSizeFunc(value, includeHeader));
 }
示例#8
0
 public static int SizeOf <T>(T value)
 {
     return(SizeMapper <T> .ValueSizeFunc(value));
 }
 public bool ChangeSize(SizeDAO size)
 {
     return(data.ChangeSize(SizeMapper.MapToSize(size)));
 }
 public bool InsertSize(SizeDAO size)
 {
     return(data.InsertSize(SizeMapper.MapToSize(size)));
 }
 public SizeDAO GetSize(int id)
 {
     return(SizeMapper.MapToSizeDAO(data.GetSize(id)));
 }
 public bool DeleteSize(SizeDAO size)
 {
     return(data.DeleteSize(SizeMapper.MapToSize(size)));
 }
 public bool InsertSize(SizeDTO item)
 {
     return(pssc.InsertSize(SizeMapper.MapToDAO(item)));
 }
 public bool DeleteSize(SizeDTO item)
 {
     return(pssc.DeleteSize(SizeMapper.MapToDAO(item)));
 }
 public bool ChangeSize(SizeDTO item)
 {
     return(pssc.ChangeSize(SizeMapper.MapToDAO(item)));
 }
 public SizeDTO GetSize(int id)
 {
     return(SizeMapper.MapToDTO(pssc.GetSize(id)));
 }