Exemplo n.º 1
0
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}");
     toStringOutput.Add($"EmployeeId = {(EmployeeId == null ? "null" : EmployeeId == string.Empty ? "" : EmployeeId)}");
     toStringOutput.Add($"LocationId = {(LocationId == null ? "null" : LocationId == string.Empty ? "" : LocationId)}");
     toStringOutput.Add($"Timezone = {(Timezone == null ? "null" : Timezone == string.Empty ? "" : Timezone)}");
     toStringOutput.Add($"StartAt = {(StartAt == null ? "null" : StartAt == string.Empty ? "" : StartAt)}");
     toStringOutput.Add($"EndAt = {(EndAt == null ? "null" : EndAt == string.Empty ? "" : EndAt)}");
     toStringOutput.Add($"Wage = {(Wage == null ? "null" : Wage.ToString())}");
     toStringOutput.Add($"Breaks = {(Breaks == null ? "null" : $"[{ string.Join(", ", Breaks)} ]")}");
     toStringOutput.Add($"Status = {(Status == null ? "null" : Status.ToString())}");
     toStringOutput.Add($"Version = {(Version == null ? "null" : Version.ToString())}");
     toStringOutput.Add($"CreatedAt = {(CreatedAt == null ? "null" : CreatedAt == string.Empty ? "" : CreatedAt)}");
     toStringOutput.Add($"UpdatedAt = {(UpdatedAt == null ? "null" : UpdatedAt == string.Empty ? "" : UpdatedAt)}");
     toStringOutput.Add($"TeamMemberId = {(TeamMemberId == null ? "null" : TeamMemberId == string.Empty ? "" : TeamMemberId)}");
 }
   } // end method Earnings                                      

   // return string representation of HourlyEmployee object
   public override string ToString()
   {
       return "hourly employee: " + base.ToString() + System.Environment.NewLine +
        "hourly wage: " + Wage.ToString("C") + " ; hours worked: " +
        Hours.ToString();
   } // end method ToString