コード例 #1
0
        //Create
        public bool CreateCustomer(KomodoCustomer customer)
        {
            int startingCount = _customerDirectory.Count();

            _customerDirectory.Add(customer);

            bool wasAdded = (_customerDirectory.Count > startingCount) ? true : false;

            return(wasAdded);
        }
コード例 #2
0
        //Update
        public void UpdateCustomer(KomodoCustomer customerToChange)
        {
            Console.WriteLine("Enter new ID number:");
            int id = int.Parse(Console.ReadLine());

            customerToChange.IDNumber = id;

            Console.WriteLine("Enter new Last Name:");
            string lastName = Console.ReadLine();

            customerToChange.LastName = lastName;

            Console.WriteLine("Enter new age:");
            int age = int.Parse(Console.ReadLine());

            customerToChange.Age = age;

            Console.WriteLine("Enter new Enrollment Date:");
            DateTime enrollmentDate = DateTime.Parse(Console.ReadLine());

            customerToChange.EnrollmentDate = enrollmentDate;
        }
コード例 #3
0
 //Delete
 public void DeleteCustomer(KomodoCustomer customerToDelete)
 {
     _customerDirectory.Remove(customerToDelete);
 }