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; }
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 } }); }
public static void Unassign(this CarTool tool) { tool.Active = false; tool.EndOfAssignment = DateTime.UtcNow; }
public static void Remove(this CarTool tool) { tool.Deleted = true; tool.Active = false; tool.EndOfAssignment = DateTime.UtcNow; }