Ejemplo n.º 1
0
        //----- All Parts-----

        //----- By Price-----
        public static void ByPrice()
        {
            Console.WriteLine("Enter minimum Price Module");
            string userMinPrice = Console.ReadLine();
            int    minPrice     = int.Parse(userMinPrice);

            Console.WriteLine("Enter maximum Price Module");
            string userMaxPrice = Console.ReadLine();
            int    maxPrice     = int.Parse(userMaxPrice);

            Program.PopulateDb();
            foreach (var item2 in Db.Modules)
            {
                if (item2.Price > minPrice && item2.Price < maxPrice)
                {
                    Console.WriteLine("----------------------------");
                    Console.WriteLine($"|Price:{item2.Price}|Id:{item2.Id}|");
                    foreach (var itemPart in item2.Parts)
                    {
                        Console.WriteLine($"|{itemPart.Id} {itemPart.Name} {itemPart.Type} {itemPart.Company}|");
                    }
                }
            }
            Console.WriteLine("--------------------------------------------------------------");
            Console.WriteLine("Choose product ID and press any key to continue to Add to Card");
            Console.WriteLine("--------------------------------------------------------------");
            Console.ReadLine();
            AddToCard.SelectTheProductModules();
        }
Ejemplo n.º 2
0
        //----- All Parts-----


        //----- By Price-----
        public static void ByPrice()
        {
            Console.WriteLine("Enter minimum Price");
            string userMinPrice = Console.ReadLine();
            int    minPrice     = int.Parse(userMinPrice);

            Console.WriteLine("Enter maximum Price");
            string userMaxPrice = Console.ReadLine();
            int    maxPrice     = int.Parse(userMaxPrice);

            Program.PopulateDb();
            foreach (var item in Db.Parts)
            {
                if (item.Price > minPrice && item.Price < maxPrice)
                {
                    Console.WriteLine("-------------------------------------------------------------------------------");
                    Console.WriteLine($"|Id:{item.Id}|Name:{item.Name}|Price:{item.Price}|By_Type:{item.Type}|Company:{item.Company}|Quantity:{item.Quantity}");
                }
            }
            Console.WriteLine("--------------------------------------------------------------");
            Console.WriteLine("Choose product ID and press any key to continue to Add to Card");
            Console.WriteLine("--------------------------------------------------------------");
            Console.ReadLine();
            AddToCard.SelectTheProductParts();
        }
Ejemplo n.º 3
0
        //----- All Parts-----

        //----- By Price-----
        public static void ByPrice()
        {
            Console.WriteLine("Enter minimum Price Module");
            string userMinPrice = Console.ReadLine();
            int    minPrice     = int.Parse(userMinPrice);

            Console.WriteLine("Enter maximum Price Module");
            string userMaxPrice = Console.ReadLine();
            int    maxPrice     = int.Parse(userMaxPrice);

            Program.PopulateDb();
            foreach (var item in Db.Configurations)
            {
                if (item.Price > minPrice && item.Price < maxPrice)
                {
                    Console.WriteLine("----------------------------");
                    Console.WriteLine($"|Id:{item.Id}|Configuration type:{item.Type}|Price:{item.Price}|");
                    Console.WriteLine("----------------------------");
                }
            }
            Console.WriteLine("--------------------------------------------------------------");
            Console.WriteLine("Choose product ID and press any key to continue to Add to Card");
            Console.WriteLine("--------------------------------------------------------------");
            Console.ReadLine();
            AddToCard.SelectTheProductConf();
        }
Ejemplo n.º 4
0
 //----- All Parts-----
 public static void AllProduct()
 {
     Program.PopulateDb();
     for (int i = 0; i < Db.Parts.Count; i++)
     {
         Console.WriteLine("-------------------------------------------------------------------------------");
         Console.WriteLine($"|Id:{Db.Parts[i].Id}|Name:{Db.Parts[i].Name}|Price:{Db.Parts[i].Price}|By_Type:{Db.Parts[i].Type}|Company:{Db.Parts[i].Company}|Quantity:{Db.Parts[i].Quantity}");
     }
     Console.WriteLine("--------------------------------------------------------------");
     Console.WriteLine("Choose product ID and press any key to continue to Add to Card");
     Console.WriteLine("--------------------------------------------------------------");
     Console.ReadLine();
     AddToCard.SelectTheProductParts();
 }
Ejemplo n.º 5
0
        //----- By Price-----

        //----- By Type-----
        public static void ByType()
        {
            Console.WriteLine("Sort parts by Type");
            Program.PopulateDb();
            foreach (var item in Db.Parts)
            {
                Console.WriteLine("-------------------------------------------------------------------------------");
                Console.WriteLine($"|By_Type:{item.Type}|Id:{item.Id}|Name:{item.Name}|Price:{item.Price}|Company:{item.Company}|Quantity:{item.Quantity}");
            }
            Console.WriteLine("--------------------------------------------------------------");
            Console.WriteLine("Choose product ID and press any key to continue to Add to Card");
            Console.WriteLine("--------------------------------------------------------------");
            Console.ReadLine();
            AddToCard.SelectTheProductParts();
        }
Ejemplo n.º 6
0
        //----- By Price-----

        //----- By Type-----
        public static void ByType()
        {
            Console.WriteLine("Sort parts by Type");
            Program.PopulateDb();
            foreach (var item in Db.Configurations)
            {
                Console.WriteLine("----------------------------");
                Console.WriteLine($"|Id:{item.Id}|Configuration type:{item.Type}|Price:{item.Price}|");
                Console.WriteLine("----------------------------");
            }
            Console.WriteLine("--------------------------------------------------------------");
            Console.WriteLine("Choose product ID and press any key to continue to Add to Card");
            Console.WriteLine("--------------------------------------------------------------");
            Console.ReadLine();
            AddToCard.SelectTheProductConf();
        }
Ejemplo n.º 7
0
 //----- All Parts-----
 public static void AllProduct()
 {
     Program.PopulateDb();
     foreach (var item in Db.Modules)
     {
         Console.WriteLine("----------------------------");
         Console.WriteLine($"|Id:{item.Id}|Type:{item.Type}|");
         foreach (var itemPart in item.Parts)
         {
             Console.WriteLine($"|{itemPart.Id} {itemPart.Name} {itemPart.Type} {itemPart.Company}|");
         }
     }
     Console.WriteLine("--------------------------------------------------------------");
     Console.WriteLine("Choose product ID and press any key to continue to Add to Card");
     Console.WriteLine("--------------------------------------------------------------");
     Console.ReadLine();
     AddToCard.SelectTheProductModules();
 }
Ejemplo n.º 8
0
 //----- All Parts-----
 public static void AllProduct()
 {
     Program.PopulateDb();
     foreach (var item in Db.Configurations)
     {
         Console.WriteLine("----------------------------");
         Console.WriteLine($"|Id:{item.Id}|Configuration type:{item.Type}|Price:{item.Price}|");
         Console.WriteLine("----------------------------");
         foreach (var itemPart in item.Modules)
         {
             foreach (var itemDeeperThanUniverse in itemPart.Parts)
             {
                 Console.WriteLine($"|{itemPart.Type}|{itemDeeperThanUniverse.Company}|{itemDeeperThanUniverse.Name}|");
             }
         }
     }
     Console.WriteLine("--------------------------------------------------------------");
     Console.WriteLine("Choose product ID and press any key to continue to Add to Card");
     Console.WriteLine("--------------------------------------------------------------");
     Console.ReadLine();
     AddToCard.SelectTheProductConf();
 }