예제 #1
0
        private void AddToList()
        {
            Console.Clear();

            OutingContent newOuting = new OutingContent();

            Console.WriteLine("Please enter the number of people attending:");
            string intAsString = Console.ReadLine();
            int    peopleNum   = int.Parse(intAsString);

            newOuting.NumberOfPeople = peopleNum;

            Console.WriteLine("Please enter the cost per person:");
            string  personString = Console.ReadLine();
            decimal personDec    = decimal.Parse(personString);

            newOuting.CostPerPerson = personDec;

            Console.WriteLine("Please enter the date of the event:");
            string   dateAsString = Console.ReadLine();
            DateTime actualDate   = DateTime.Parse(dateAsString);

            newOuting.Date = actualDate;

            Console.WriteLine("Please enter the number for the type of event:\n " +
                              "1 = Golf\n 2 = Amusement Park\n 3 = Concert");
            string typeAsString = Console.ReadLine();
            int    eventType    = int.Parse(typeAsString);

            newOuting.TypeOfEvent = (EventType)eventType;

            _outingRepo.CreateOuting(newOuting);
        }