Example #1
0
        //public bool CreateNewEmployee
        //comment this out - right click on interface and "Implement Interface"
        public bool Create(string first, string last, DateTime birthday, out IEmployee employee)
        {
            //Create the most recent and capable Employee object but return the interface

            employee = null;

            Employee3 employee3 = new Employee3(first, last, birthday);
            if (employee3.IsValid)
            {
                employee = (IEmployee)employee3;
                return true;
            }

            return false;
            //throw new NotImplementedException();
        }
Example #2
0
 public static IEmployee CreateEmployee(string firstname, string lastname, DateTime birthdate)
 {
     Employee3 employee = new Employee3(firstname, lastname, birthdate);
     return employee;
 }