public void Generate(AdHocSchedulesMessage message, string originalContent) { string outputDirectory = Path.Combine(@"C:\outputlocation", message.FlightInformation.AircraftOwner); string outputPath = Path.Combine(outputDirectory, Path.GetFileName(Path.GetTempFileName())); if (!Directory.Exists(outputDirectory)) { Directory.CreateDirectory(outputDirectory); } // Use extreme brute force here, hey it's a demo :) string airCraftType = message.EquipmentInformation.AirCraftType == "73H" ? "73Y" : message.EquipmentInformation.AirCraftType; File.WriteAllText(outputPath, originalContent.Replace(message.EquipmentInformation.AirCraftType, airCraftType)); }
public void Modify(AdHocSchedulesMessage message) { this.connection.Execute("INSERT INTO Messages(at, flightidentifier) VALUES(@at,@flightidentifier)", new { at = DateTimeOffset.Now, flightidentifier = message.FlightInformation.FlightIdentifier }); }
protected bool Equals(AdHocSchedulesMessage other) { return Equals(MessageHeading, other.MessageHeading) && string.Equals(Id, other.Id) && Equals(ActionInformation, other.ActionInformation) && Equals(FlightInformation, other.FlightInformation) && Equals(EquipmentInformation, other.EquipmentInformation); }