wrapping, added last update field

This commit is contained in:
Llywelwyn 2022-07-25 11:45:22 +01:00
parent dd2aef92a6
commit 8c58930bc8
3 changed files with 17 additions and 5 deletions

View file

@ -11,13 +11,13 @@
<Grid> <Grid>
<controls:MetroAnimatedTabControl Margin="10"> <controls:MetroAnimatedTabControl Margin="10">
<TabItem Header="Employment"> <TabItem Header="Employment">
<TextBox x:Name="EmploymentBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas"/> <TextBox x:Name="EmploymentBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas" TextWrapping="Wrap"/>
</TabItem> </TabItem>
<TabItem Header="Medical"> <TabItem Header="Medical">
<TextBox x:Name="MedicalBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas"/> <TextBox x:Name="MedicalBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas" TextWrapping="Wrap"/>
</TabItem> </TabItem>
<TabItem Header="Security"> <TabItem Header="Security">
<TextBox x:Name="SecurityBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas"/> <TextBox x:Name="SecurityBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas" TextWrapping="Wrap"/>
</TabItem> </TabItem>
</controls:MetroAnimatedTabControl> </controls:MetroAnimatedTabControl>
</Grid> </Grid>

View file

@ -104,10 +104,12 @@ namespace CharacterRecordsGenerator
!_employmentSkills.Any()) !_employmentSkills.Any())
{ {
recordText.AppendLine("/// NO EMPLOYMENT RECORD FOUND ///"); recordText.AppendLine("/// NO EMPLOYMENT RECORD FOUND ///");
recordText.AppendLine();
} }
else else
{ {
recordText.AppendLine("/// EMPLOYMENT RECORD ///"); recordText.AppendLine("/// EMPLOYMENT RECORD ///");
recordText.AppendLine("This information has been verified by employment agents within the External Affairs department, and any comments, questions, or concerns about the legitimacy of such must be sent in a secure document to the same department.");
recordText.AppendLine(); recordText.AppendLine();
WriteSectionIfAny(ref recordText, WriteSectionIfAny(ref recordText,
@ -121,8 +123,10 @@ namespace CharacterRecordsGenerator
WriteSectionIfAny(ref recordText, WriteSectionIfAny(ref recordText,
"Other skills:", "Other skills:",
_employmentSkills); _employmentSkills);
} }
recordText.AppendLine($"LAST UPDATED: {Utility.HumanisedDate(Info.IcDate)}");
return recordText.ToString(); return recordText.ToString();
} }
@ -145,6 +149,7 @@ namespace CharacterRecordsGenerator
!_targetRecord.NoRevive) !_targetRecord.NoRevive)
{ {
recordText.AppendLine("/// NO MEDICAL RECORD FOUND ///"); recordText.AppendLine("/// NO MEDICAL RECORD FOUND ///");
recordText.AppendLine();
} }
else else
{ {
@ -152,7 +157,7 @@ namespace CharacterRecordsGenerator
recordText.AppendLine(); recordText.AppendLine();
recordText.AppendLine( recordText.AppendLine(
" The following information is protected by doctor-patient confidentiality laws. Do not release without patient's consent.\n"); "The following information is protected by doctor-patient confidentiality laws. Do not release without patient's consent.\n");
if (_targetRecord.NoBorg || _targetRecord.NoProsthetic || _targetRecord.NoRevive) if (_targetRecord.NoBorg || _targetRecord.NoProsthetic || _targetRecord.NoRevive)
{ {
@ -189,8 +194,10 @@ namespace CharacterRecordsGenerator
WriteSectionIfAny(ref recordText, WriteSectionIfAny(ref recordText,
"Prescriptions:", "Prescriptions:",
_medicalPrescriptions); _medicalPrescriptions);
}
}
recordText.AppendLine($"LAST UPDATED: {Utility.HumanisedDate(Info.IcDate)}");
return recordText.ToString(); return recordText.ToString();
} }
@ -208,6 +215,7 @@ namespace CharacterRecordsGenerator
!_securityAttitudeCrew.Any()) !_securityAttitudeCrew.Any())
{ {
recordText.AppendLine("/// NO SECURITY RECORD FOUND ///"); recordText.AppendLine("/// NO SECURITY RECORD FOUND ///");
recordText.AppendLine();
} }
else else
{ {
@ -231,6 +239,7 @@ namespace CharacterRecordsGenerator
_securityRecords); _securityRecords);
} }
recordText.AppendLine($"LAST UPDATED: {Utility.HumanisedDate(Info.IcDate)}");
return recordText.ToString(); return recordText.ToString();
} }
} }

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using Humanizer;
namespace CharacterRecordsGenerator namespace CharacterRecordsGenerator
{ {
@ -33,6 +34,8 @@ namespace CharacterRecordsGenerator
/// <returns></returns> /// <returns></returns>
public static string SpaceIfValue(this string val) => string.IsNullOrWhiteSpace(val) ? string.Empty : $"{val} "; public static string SpaceIfValue(this string val) => string.IsNullOrWhiteSpace(val) ? string.Empty : $"{val} ";
public static string HumanisedDate(DateTime date) => $"{date.ToString("MMMM")} {date.Day.Ordinalize()}, {date.Year}";
public static string IfEmpty(this string target, string fallback) => public static string IfEmpty(this string target, string fallback) =>
target.IsEmpty() ? fallback : target; target.IsEmpty() ? fallback : target;