Пример #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;
 }
Пример #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
         }
     });
 }
Пример #3
0
 public static void Unassign(this CarTool tool)
 {
     tool.Active          = false;
     tool.EndOfAssignment = DateTime.UtcNow;
 }
Пример #4
0
 public static void Remove(this CarTool tool)
 {
     tool.Deleted         = true;
     tool.Active          = false;
     tool.EndOfAssignment = DateTime.UtcNow;
 }