Ejemplo n.º 1
0
        public promocion agregarPromocion(producto prod, int descuento)
        {
            promocion promocion = new promocion(prod, descuento);

            ListaPromociones.Add(promocion);
            prod.AgregarPromo(promocion);
            return(promocion);
        }
Ejemplo n.º 2
0
        static void AgregarPromocion(tienda tienda)
        {
            int numProd;
            int descuento;

            try {
                Console.WriteLine("Seleccione un producto para la promo:");
                ListarProductos(tienda);
                numProd = int.Parse(Console.ReadLine());
                Console.WriteLine("Indique porcentaje de descuento");
                descuento = int.Parse(Console.ReadLine());
                producto  prod  = tienda.EncontrarProducto(numProd);
                promocion promo = tienda.agregarPromocion(prod, descuento);
                Console.WriteLine("\nPromocion Agregada.");
                Console.ReadKey();
            }
            catch
            {
                Console.WriteLine("Error al ingresar datos. Por favor reintente la operacion.");
                Console.ReadKey();
            }
        }
Ejemplo n.º 3
0
 public void AgregarPromo(promocion promo)
 {
     this.promocion = promo;
 }
Ejemplo n.º 4
0
        static void Main(string[] args)

        {
            tienda tienda = new tienda();
            string select;

            //CARGAMOS PRODUCTOS Y TARJETAS INICIALES
            tienda.agregarProducto("remera", "Adidas", "M", 500);
            tienda.agregarProducto("pantalon", "Adidas", "L", 800);
            tienda.agregarProducto("short", "Nike", "S", 750);
            promocion prom = tienda.agregarPromocion(tienda.EncontrarProducto(1), 10);

            tienda.agregarCliente(38369636, "Santiago", "Ponce de Leon", (DateTime.Parse("10/06/1994")));
            tienda.agregarCliente(38254179, "Martin", "Venturino", (DateTime.Parse("28/04/1992")));

            tarjeta Tar1 = tienda.agregarTarjeta("VISA", "Galicia");

            Tar1.AgregarFormaPago(6, 20);
            Tar1.AgregarFormaPago(12, 30);

            tarjeta Tar2 = tienda.agregarTarjeta("MasterCard", "Santander");

            Tar2.AgregarFormaPago(3, 10);
            Tar2.AgregarFormaPago(9, 25);
            Tar2.AgregarBeneficio(9, 20);


            carro carro = tienda.agregarCarro();

            bool salir = false;

            while (salir == false)
            {
                Console.Clear();
                Console.WriteLine("*****\t\t\tTienda\t\t\t*****\n");
                Console.WriteLine("¿A qué módulo desea ingresar?\n");
                Console.WriteLine("1) Productos y Promociones\n2) Compras\n3) Tarjetas de Crédito\n4) Administración\n5) Salir del sistema");
                select = Console.ReadLine();

                switch (select)
                {
                case "1":                                                                                 //Módulo producto
                    ModuloProducto(carro, tienda);
                    break;

                case "2":                                                                                 //Módulo Compras
                    ModuloCompras(carro, tienda);
                    break;

                case "3":                                                                                 //Módulo Tarjetas
                    ModuloTarjetas(carro, tienda);
                    break;

                case "4":                                                                                 //Módulo administrativo
                    ModuloAdministrativo(tienda);
                    break;

                case "5":                                                                                 //Salir del sistema
                    salir = true;
                    break;

                default:
                    Console.WriteLine("La opción ingresada no es válida.\n");
                    Console.ReadKey();
                    break;
                }
            }
            Console.WriteLine("\n\nGracias, vuelva prontos.");
            Console.ReadKey();
        }