コード例 #1
0
 internal static void PrintRemoveCamperMenu(Camper camperToUpdate)
 {
     Console.WriteLine($"Do you really want to check out {camperToUpdate.FirstName} {camperToUpdate.LastName} from Camp SleepOver?");
     Console.WriteLine("---------------------------");
     Console.WriteLine("1. Yes");
     Console.WriteLine("2. No");
 }
コード例 #2
0
        public static CamperHistory GetACamperHistory(Camper camper, bool isActive)
        {
            var camperHistory = new CamperHistory()
            {
                CamperID             = camper.CamperId,
                FirstName            = camper.FirstName,
                LastName             = camper.LastName,
                SocialSecurityNumber = camper.SocialSecurityNumber,
                IsActive             = isActive,
                TimeStamp            = DateTime.UtcNow
            };

            if (camper.CabinID != null)
            {
                camperHistory.CabinID = camper.CabinID;
            }

            return(camperHistory);
        }
コード例 #3
0
        internal static void PrintSpecificCamper(Camper camper, List <NextOfKin> nextOfKins)
        {
            string noCabin = "No assigned cabin";

            Console.WriteLine("***CAMPER***");
            Console.WriteLine($"Firstname: {camper.FirstName}");
            Console.WriteLine($"Lastname: {camper.LastName}");
            Console.WriteLine($"SSN: {camper.SocialSecurityNumber}");
            Console.WriteLine($"Cabin number: {(camper.CabinID != null ? camper.Cabin.CabinNumber.ToString() : noCabin)}");

            if (nextOfKins.Count < 1)
            {
                Console.WriteLine($"***Next of kin***");
                Console.WriteLine("No next of kin exists in database");
            }
            else
            {
                foreach (var nextOfKin in nextOfKins)
                {
                    PrintSpecificNextOfKin(nextOfKin);
                }
            }
        }