Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace CompanyHierarchy
  8. {
  9. public abstract class Employee : Person, IEmployee
  10. {
  11. private decimal salary;
  12. public Department department { get; set; }
  13. public Employee
  14. (int employeeID, string employeeFirstName, string employeeLastName, decimal employeeSalary, Department employeeDepartment)
  15. : base(employeeID, employeeFirstName, employeeLastName)
  16. {
  17. this.Salary = employeeSalary;
  18. this.department = employeeDepartment;
  19. }
  20.  
  21.  
  22. public decimal Salary
  23. {
  24. get { return this.salary; }
  25. set
  26. {
  27. if (value < 0)
  28. {
  29. throw new ArgumentOutOfRangeException("Salary cannot be negative!");
  30. }
  31. this.salary = value;
  32. }
  33. }
  34.  
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement