Ejemplo n.º 1
0
 public static void Activate(this CarTool tool, InUpdateToolAssignmentDTO toolAssignmentDTO)
 {
     tool.StartOfAssignment = DateTimeOffset
                              .FromUnixTimeSeconds(toolAssignmentDTO.DateOfAssignment).UtcDateTime;
     tool.Active          = true;
     tool.Deleted         = false;
     tool.EndOfAssignment = null;
 }
Ejemplo n.º 2
0
 public static OutAssignedToolDTO Map(CarTool tool)
 {
     return(new OutAssignedToolDTO
     {
         Active = tool.Active,
         StartOfAssignment = tool.StartOfAssignment,
         EndOfAssignment = tool.EndOfAssignment,
         Tool = new OutToolDTO
         {
             Id = tool.Tool.Id,
             Name = tool.Tool.Name,
             SerialNumber = tool.Tool.SerialNumber,
             Comment = tool.Tool.Comment
         }
     });
 }
Ejemplo n.º 3
0
 public static void Unassign(this CarTool tool)
 {
     tool.Active          = false;
     tool.EndOfAssignment = DateTime.UtcNow;
 }
Ejemplo n.º 4
0
 public static void Remove(this CarTool tool)
 {
     tool.Deleted         = true;
     tool.Active          = false;
     tool.EndOfAssignment = DateTime.UtcNow;
 }