Utils: Add PhoneNrTypes
This commit is contained in:
@ -48,6 +48,16 @@ namespace Elwig.Helpers {
|
|||||||
[GeneratedRegex(@"^(.*?) +([0-9].*)$", RegexOptions.Compiled)]
|
[GeneratedRegex(@"^(.*?) +([0-9].*)$", RegexOptions.Compiled)]
|
||||||
private static partial Regex GeneratedAddressRegex();
|
private static partial Regex GeneratedAddressRegex();
|
||||||
|
|
||||||
|
public static readonly KeyValuePair<string, string>[] PhoneNrTypes = [
|
||||||
|
new("landline", "Tel.-Nr. (Festnetz)"),
|
||||||
|
new("mobile", "Tel.-Nr. (mobil)"),
|
||||||
|
new("fax", "Fax-Nr."),
|
||||||
|
];
|
||||||
|
|
||||||
|
public static string PhoneNrTypeToString(string type) {
|
||||||
|
return PhoneNrTypes.Where(t => t.Key == type).Select(t => t.Value).FirstOrDefault(type);
|
||||||
|
}
|
||||||
|
|
||||||
private static readonly ushort[] Crc16ModbusTable = {
|
private static readonly ushort[] Crc16ModbusTable = {
|
||||||
0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
|
0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
|
||||||
0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
|
0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
|
||||||
|
@ -19,11 +19,7 @@ namespace Elwig.Windows {
|
|||||||
private readonly RoutedCommand CtrlF = new();
|
private readonly RoutedCommand CtrlF = new();
|
||||||
private readonly (ComboBox, TextBox, TextBox)[] PhoneNrInputs;
|
private readonly (ComboBox, TextBox, TextBox)[] PhoneNrInputs;
|
||||||
|
|
||||||
private static ObservableCollection<KeyValuePair<string, string>> PhoneNrTypes { get; set; } = [
|
private static ObservableCollection<KeyValuePair<string, string>> PhoneNrTypes { get; set; } = new(Utils.PhoneNrTypes);
|
||||||
new("landline", "Tel.-Nr. (Festnetz)"),
|
|
||||||
new("mobile", "Tel.-Nr. (mobil)"),
|
|
||||||
new("fax", "Fax-Nr."),
|
|
||||||
];
|
|
||||||
|
|
||||||
public MemberAdminWindow() {
|
public MemberAdminWindow() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
Reference in New Issue
Block a user