public Employee(PersonFactory pFactory) : base(pFactory) { _office = pFactory.OfficeValue ?? ""; _salary = pFactory.SalaryValue ?? 0; _dateHired = pFactory.DateHiredValue ?? new MyDate(0, 0, 0); }
public Faculty(PersonFactory pFactory) : base(pFactory) { _officeHours = pFactory.OfficeValue ?? ""; _rank = pFactory.RankValue ?? ""; }
public Student(PersonFactory pFactory) : base(pFactory) { _classStatus = pFactory.ClassStatusValue ?? Status.Freshman; }
public static void Main(string[] args) { var pFactory = new PersonFactory(); var person = pFactory.Name("John Doe") .Address("3630 Front Street") .PhoneNumber("810-448-4050") .Email("*****@*****.**") .BuildPerson(); person.DisplayData(); Console.WriteLine(); var student = pFactory.Name("Lane Johnson") .Address("3959 Michael Street") .PhoneNumber("713-794-1984") .Email("*****@*****.**") .ClassStatus(Student.Status.Freshman) .BuildStudent(); student.DisplayData(); Console.WriteLine(); var employee = pFactory.Name("Nick Foles") .Address("344 Franklin Street") .PhoneNumber("334-707-2499") .Email("*****@*****.**") .Office("NF99") .Salary(4000000) .DateHired(new MyDate(09, 19, 1999)) .BuildEmployee(); employee.DisplayData(); Console.WriteLine(); var faculty = pFactory.Name("Jimmy Ledger") .Address("3724 Oakridge Lane") .PhoneNumber("478-275-5702") .Email("*****@*****.**") .Office("JL09") .Salary(60000) .DateHired(new MyDate(09, 9, 2003)) .OfficeHours("4pm-6pm") .Rank("Professor") .BuildFaculty(); faculty.DisplayData(); Console.WriteLine(); var staff = pFactory.Name("Hannah Smith") .Address("3724 Riverview Lane") .PhoneNumber("404-305-5978") .Email("*****@*****.**") .Office("HS09") .Salary(60000) .DateHired(new MyDate(08, 20, 2008)) .OfficeHours("4pm-6pm") .Rank("Professor") .Title("Dean") .BuildStaff(); staff.DisplayData(); Console.WriteLine(); }
public Staff(PersonFactory pFactory) : base(pFactory) { _title = pFactory.TitleValue ?? ""; }