Exemple #1
0
 public Pedido(Mesa mesa, int nroPedido)
 {
     this.mesa      = mesa;
     this.nroPedido = nroPedido;
 }
        public List <DetallePedido> cargarObjetos()
        {
            Mesa m1 = new Mesa(6, "Rectangulo", 1, "Jhon Doe");
            Mesa m2 = new Mesa(8, "Rectangulo", 2, "Juan Perez");
            Mesa m3 = new Mesa(4, "Cuadrado", 3, "David Diaz");

            Producto prod1 = new Producto("Hamburguesa", 150);
            Producto prod2 = new Producto("Pizza", 250);
            Producto prod3 = new Producto("Cerveza", 100);
            Producto prod4 = new Producto("Papas Fritas", 125);

            ProductoDeCarta pdc1 = new ProductoDeCarta(prod1);
            ProductoDeCarta pdc2 = new ProductoDeCarta(prod2);
            ProductoDeCarta pdc3 = new ProductoDeCarta(prod3);
            ProductoDeCarta pdc4 = new ProductoDeCarta(prod4);

            Menu menu1 = new Menu("Menu Ejecutivo", 400);
            Menu menu2 = new Menu("Menu Estudiantil", 300);

            EnPreparacion          ed1 = new EnPreparacion();
            EnPreparacion          ed2 = new EnPreparacion();
            Cancelado              ed3 = new Cancelado();
            Cancelado              ed4 = new Cancelado();
            Notificado             ed5 = new Notificado();
            EnPreparacion          ed6 = new EnPreparacion();
            EnPreparacion          ed7 = new EnPreparacion();
            PendienteDePreparacion ea1 = new PendienteDePreparacion();
            PendienteDePreparacion ea2 = new PendienteDePreparacion();
            PendienteDePreparacion ea3 = new PendienteDePreparacion();
            PendienteDePreparacion ea4 = new PendienteDePreparacion();

            Pedido p1 = new Pedido(m1, 1);
            Pedido p2 = new Pedido(m2, 2);
            Pedido p3 = new Pedido(m3, 3);
            //DateFormat = {11/13/2020 12:00:00 AM}

            HistorialEstado h4 = new HistorialEstado(DateTime.Parse("10/13/2020 10:30:00 pm"), ea1, DateTime.Parse("11/13/2020 11:30:00 pm"));
            HistorialEstado h5 = new HistorialEstado(DateTime.Parse("10/13/2020 10:00:00 pm"), ea2, DateTime.Parse("11/13/2020 11:30:00 pm"));
            HistorialEstado h6 = new HistorialEstado(DateTime.Parse("10/13/2020 10:30:00 pm"), ea3, DateTime.Parse("11/13/2020 11:30:00 pm"));
            HistorialEstado h8 = new HistorialEstado(DateTime.Parse("10/13/2020 11:55:00 pm"), ea4, DateTime.Parse("11/13/2020 11:30:00 pm"));
            HistorialEstado h1 = new HistorialEstado(DateTime.Parse("10/13/2020 11:40:00 pm"), ed1, null);
            HistorialEstado h2 = new HistorialEstado(DateTime.Parse("10/13/2020 11:30:00 pm"), ed2, null);
            HistorialEstado h3 = new HistorialEstado(DateTime.Parse("10/13/2020 11:55:00 pm"), ed6, null);
            HistorialEstado h7 = new HistorialEstado(DateTime.Parse("10/13/2020 11:00:00 pm"), ed7, null);


            List <HistorialEstado> histD1 = new List <HistorialEstado>(); //this
            List <HistorialEstado> histD2 = new List <HistorialEstado>(); //this
            List <HistorialEstado> histD3 = new List <HistorialEstado>();
            List <HistorialEstado> histD4 = new List <HistorialEstado>();
            List <HistorialEstado> histD5 = new List <HistorialEstado>();
            List <HistorialEstado> histD6 = new List <HistorialEstado>(); //this
            List <HistorialEstado> histD7 = new List <HistorialEstado>(); //this

            histD1.Add(h4);
            histD1.Add(h1);
            histD2.Add(h5);
            histD2.Add(h2);
            histD6.Add(h6);
            histD6.Add(h3);
            histD7.Add(h8);
            histD7.Add(h7);

            DetallePedido d1 = new DetallePedido(1, 3, histD1, p1, ed1, 15, menu1, null); //prep
            DetallePedido d2 = new DetallePedido(2, 1, histD2, p1, ed2, 30, menu2, null); //prep
            DetallePedido d3 = new DetallePedido(3, 1, histD3, p1, ed3, 25, null, pdc3);
            DetallePedido d4 = new DetallePedido(4, 9, histD4, p1, ed4, 11, null, pdc1);
            DetallePedido d5 = new DetallePedido(5, 4, histD5, p1, ed5, 16, null, pdc2);
            DetallePedido d6 = new DetallePedido(6, 5, histD6, p2, ed6, 14, menu1, null); //prep
            DetallePedido d7 = new DetallePedido(7, 4, histD7, p3, ed7, 20, null, pdc4);  //prep

            List <DetallePedido> detalles1 = new List <DetallePedido>();

            detalles1.Add(d1);
            detalles1.Add(d2);
            detalles1.Add(d3);
            detalles1.Add(d4);
            detalles1.Add(d5);
            detalles1.Add(d6);
            detalles1.Add(d7);



            return(detalles1);
        }