Beispiel #1
0
 /// <summary>
 /// default constructor
 /// </summary>
 public Employee()
 {
     this.employeeId = -1;
     this.name = "default";
     this.username = "******";
     this.currentLocation = null;
     this.phoneNumber = "0000";
 }
Beispiel #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;
 }
Beispiel #3
0
        static void Main(string[] args)
        {
            // create objects
            Location loc = new Location();
            Employee emp1 = new Employee(1, "Michael", "michael", loc, "1234");
            FileTimeSheet fts = new FileTimeSheet(@"timesheet.dat");
            DatabaseTimeSheet dts = new DatabaseTimeSheet(@"mydb");
            //ITimeSheet ts = new FileTimeSheet(@"timesheet.dat");

            // send messages (call methods)
            emp1.RecordOvertime(fts, 8, PayRate.Weekend);
            emp1.RecordOvertime(fts, 5, PayRate.Day);
            emp1.RecordOvertime(dts, 8, PayRate.Weekend);
            emp1.RecordOvertime(dts, 5, PayRate.Day);
            //emp1.RecordOvertime(ts, 10, PayRate.Day);

            // wait for key press before ending
            Console.ReadLine();
        }
Beispiel #4
0
 //METHODS
 /// <summary>
 /// Move to a new location
 /// </summary>
 /// <param name="newLocation">the new location</param>
 public void Move(Location newLocation)
 {
     currentLocation = newLocation;
 }