예제 #1
0
        private void SeedCompanyOutings()
        {
            CompanyOuting outing = new CompanyOuting(EventType.AmusementPark, 4, "April 30", 4.00);

            _companyOutingRepo.AddCompOuting(outing);
            CompanyOuting outing1 = new CompanyOuting(EventType.Bowling, 3, "April 10", 4.00);

            _companyOutingRepo.AddCompOuting(outing1);
        }
예제 #2
0
        public bool AddCompOuting(CompanyOuting outing)
        {
            int startingCount = _companyOutings.Count;

            _companyOutings.Add(outing);
            bool wasAdded = _companyOutings.Count == startingCount + 1;

            return(wasAdded);
        }
예제 #3
0
        public double SumAllOutings(CompanyOuting outing)
        {
            double i = 0;

            foreach (CompanyOuting compOuting in _companyOutings)
            {
                i = compOuting.TotalEventCost + i;
            }
            return(i);
        }
예제 #4
0
        private void AddOuting()
        {
            Console.Clear();
            CompanyOuting outing = new CompanyOuting();

            Console.WriteLine("What is the Date of the event?");
            outing.EventDate = Console.ReadLine();
            Console.WriteLine("How many people are attending?");
            outing.AttendeeTotal = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("What is the price of the event per person?");
            outing.Cost = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("What type of Event is this:\n" +
                              "1. Golf\n" +
                              "2. Bowling\n" +
                              "3. Amusement Park\n" +
                              "4. Conert");
            string typeAsSTring = Console.ReadLine();
            int    typeASInt    = int.Parse(typeAsSTring);

            outing.EventType = (EventType)typeASInt;
            _companyOutingRepo.AddCompOuting(outing);
            Console.WriteLine("Press any key to return to the Main Menu");
        }