/// <summary> /// default constructor /// </summary> public Employee() { this.employeeId = -1; this.name = "default"; this.username = "******"; this.currentLocation = null; this.phoneNumber = "0000"; }
//CONSTRUCTORS /// <summary> /// constructor for Employee objects /// </summary> /// <param name="employeeId">the employee's id number</param> /// <param name="name">the employee's name</param> /// <param name="username">the employee's username</param> /// <param name="location">the employee's initila location</param> /// <param name="phoneNumber">the employee's phone number</param> public Employee(int employeeId, string name, string username, Location location, string phoneNumber) { this.employeeId = employeeId; this.name = name; this.username = username; this.currentLocation = location; this.phoneNumber = phoneNumber; }
static void Main(string[] args) { // create objects Location loc = new Location { Description = "Head Office", City = "Glasgow" }; Employee emp1 = new Employee(1, "Michael", "michael", loc, "1234"); TimeSheet ts = new TimeSheet(); // send messages (call methods) emp1.RecordOvertime(ts, 5, PayRate.Holiday); // wait for key press before ending Console.ReadLine(); }
//METHODS /// <summary> /// Move to a new location /// </summary> /// <param name="newLocation">the new location</param> public void Move(Location newLocation) { currentLocation = newLocation; }