Ejemplo n.º 1
0
 /// <summary>
 /// default constructor
 /// </summary>
 public Employee()
 {
     this.employeeId = -1;
     this.name = "default";
     this.username = "******";
     this.currentLocation = null;
     this.phoneNumber = "0000";
 }
Ejemplo n.º 2
0
 //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;
 }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
 //METHODS
 /// <summary>
 /// Move to a new location
 /// </summary>
 /// <param name="newLocation">the new location</param>
 public void Move(Location newLocation)
 {
     currentLocation = newLocation;
 }