Ejemplo n.º 1
0
        public static VehicInfo VehHistory(VehCate cate, VehMake make, [Optional] string model, [Optional] VehType ctype, [Optional] string color)
        {
            var vehistory = new VehicInfo
            {
                VehCategs = cate,
                Make      = make,
                Model     = model,
                Cselect   = color
            };

            vInvent.Add(vehistory);
            return(vehistory);
        }
Ejemplo n.º 2
0
        public static void GetVehData(VehCate vehCategs)
        {
            var vehInfo = new VehicInfo();

            Console.ForegroundColor = ConsoleColor.Green;

            Console.Write("Please select make number: ");
            var vehmake = Enum.GetNames(typeof(VehMake)); //Hyundai, Ford, Kia

            for (var i = 0; i < vehmake.Length; i++)
            {
                Console.Write($" {i + 1 }. {vehmake[i]}     ");
            }
            Console.ResetColor();
            Console.WriteLine();

            Console.Write("You've entered: ");
            Console.ForegroundColor = ConsoleColor.Yellow;
            var cmake  = Convert.ToInt32(Console.ReadLine());
            var cmakes = (VehMake)Enum.Parse(typeof(VehMake), vehmake[cmake - 1]);


            vehInfo.Tes(cmakes, vehCategs);//Elantra, Tuson, F150, F250, Rio, Rio5
            var model = vehInfo.Model;

            Console.ResetColor();

            Console.ForegroundColor = ConsoleColor.Green;
            foreach (string str in Enum.GetNames(typeof(VehType)))//Manual, Automatic, TwoWheelDrv, FrWheelDrv
            {
                Console.Write(str + ":  ");
            }
            Console.ResetColor();
            Console.WriteLine();

            Console.Write("You've entered: ");
            var cusType = Console.ReadLine();

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Select Color (Case Sensitive): Red, Gray, and Black");
            Console.ResetColor();

            Console.Write("You've entered: ");
            var Vcolor = Console.ReadLine();

            vehInfo.CusColor(Vcolor);


            var vehFactory = VehFactory.VehHistory(vehCategs, cmakes, model: model, color: Vcolor);
        }
        //private static VehDataBSModel db = new VehDataBSModel(); //Reference to created database

        //public static VehicInfo VehHistory(string name, VehCate cate)
        public static VehicInfo VehHistory(string name, VehColor color, [Optional] VehCate cate, [Optional] VehMake make, [Optional] string model)
        {
            var vehistory = new VehicInfo
            {
                VehCategs = cate,
                CusName   = name,
                Make      = make,
                Model     = model,
                Color     = color,
            };

            vInvent.Add(vehistory);
            //db.VehicInfos.Add(vehistory);
            //db.SaveChanges();
            return(vehistory);
        }
Ejemplo n.º 4
0
        public static void CustomerRecord(string name, VehCate cate, decimal budget)
        {
            var cusname = db.VehicInfos.SingleOrDefault(a => a.CusName == name);
            //cusname.CusBudget(budget);

            var vehrelation = new VehRelation()
            {
                CusRecDateTime = DateTime.Now,
                CusName        = name,
                Categories     = cate,
                Budget         = budget,
            };

            db.VehRelations.Add(vehrelation);

            db.SaveChanges();
        }
Ejemplo n.º 5
0
        //public VehFeatures Features { get; set; } //*What Features

        //string Budget { get; set; } //*What's their budget

        public void Tes(VehMake Cmake, VehCate category)

        {
            if (Cmake == VehMake.Ford && VehCate.Truck == category)
            {
                Console.WriteLine("Please Select: F150 or F250");
                Console.Write("You've entered: ");
                var makeInven = Console.ReadLine();
                Model = makeInven;
            }

            if (Cmake == VehMake.Ford && VehCate.Suv == category)
            {
                Console.WriteLine("Please Select: EcoSport, Edge, or Escape");
                Console.Write("You've entered: ");
                var makeInven = Console.ReadLine();
                Model = makeInven;
            }

            if (Cmake == VehMake.Ford && VehCate.Sedan == category)
            {
                Console.WriteLine("Please Select: Fiesta, Focus, or Taurus");
                Console.Write("You've entered: ");
                var makeInven = Console.ReadLine();
                Model = makeInven;
            }
            if (Cmake == VehMake.Kia && VehCate.Suv == category)
            {
                Console.WriteLine("Please Select: Niro, Sorento, or Sportage");
                Console.Write("You've entered: ");
                var makeInven = Console.ReadLine();
                Model = makeInven;
            }

            if (Cmake == VehMake.Kia && VehCate.Sedan == category)
            {
                Console.WriteLine("Please Select: Cadenza, Forte, Optima");
                Console.Write("You've entered: ");
                var makeInven = Console.ReadLine();
                Model = makeInven;
            }
            if (Cmake == VehMake.Hyundai && VehCate.Suv == category)
            {
                Console.WriteLine("Please Select: Tuscon, Kona, Santa Fe");
                Console.Write("You've entered: ");
                var makeInven = Console.ReadLine();
                Model = makeInven;
            }

            if (Cmake == VehMake.Hyundai && VehCate.Sedan == category)
            {
                Console.WriteLine("Please Select: Accent, Elantra, or Sonata");
                Console.Write("You've entered: ");
                var makeInven = Console.ReadLine();
                Model = makeInven;
            }

            if (Cmake == VehMake.Hyundai && VehCate.Truck == category || Cmake == VehMake.Kia && VehCate.Truck == category)
            {
                Console.WriteLine("Sorry, Ford is the make that has truck models");
            }
        }
Ejemplo n.º 6
0
 public VehCate GetCategory(VehCate vehcateg)
 {
     return(VehCategs);
 }
Ejemplo n.º 7
0
        private static void GetVehData(VehCate x, string name)
        {
            var vehInfo = new VehicInfo();

            Console.ForegroundColor = ConsoleColor.Green;

            Console.Write("Please select make number: ");
            var vehmake = Enum.GetNames(typeof(VehMake)); //Hyundai, Ford, Kia

            for (var i = 0; i < vehmake.Length; i++)
            {
                Console.Write($" {i + 1 }. {vehmake[i]}     ");
            }
            Console.ResetColor();
            Console.WriteLine();

            Console.Write("You've entered: ");
            Console.ForegroundColor = ConsoleColor.Yellow;
            var cmake  = Convert.ToInt32(Console.ReadLine());
            var cmakes = (VehMake)Enum.Parse(typeof(VehMake), vehmake[cmake - 1]);


            vehInfo.Tes(cmakes, x);//Elantra, Tuson, F150, F250, Rio, Rio5
            var model = vehInfo.Model;

            Console.ResetColor();

            Console.ForegroundColor = ConsoleColor.Green;
            foreach (string str in Enum.GetNames(typeof(VehType)))//Manual, Automatic, TwoWheelDrv, FrWheelDrv
            {
                Console.Write(str + ":  ");
            }
            Console.ResetColor();
            Console.WriteLine();

            Console.Write("You've entered: ");
            var cusType = Console.ReadLine();

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Select Color: ");

            var vehcolor = Enum.GetNames(typeof(VehColor)); //

            for (var i = 0; i < vehcolor.Length; i++)
            {
                Console.Write($" {i + 1 }. {vehcolor[i]}     ");
            }

            Console.WriteLine();

            Console.ResetColor();

            Console.Write("You've selected: ");

            var cColor  = Convert.ToInt32(Console.ReadLine());
            var cColors = (VehColor)Enum.Parse(typeof(VehColor), vehcolor[cColor - 1]);

            var Vcolor = new [] { "White", "Red", "Blue", "Black", "Gray" };

            if (cColors == VehColor.Black)
            {
                var tColor = "Black";


                vehInfo.CusColor(tColor);
            }

            Console.Write("Enter Customer's Budget:  ");
            var cusbud = Convert.ToDecimal(Console.ReadLine());

            //VehFactory.CustomerRecord(name, x, cusbud);
            var ntest = VehFactory.VehHistory(cate: x, color: cColors, name: name, make: cmakes, model: model);
        }