Compare commits

...
2 Commits
19 changed files with 859 additions and 86 deletions
+21
View File
@@ -0,0 +1,21 @@
<Project>
<PropertyGroup>
<!-- Required for intellisense -->
<CoreCompileDependsOn>CoreResGen;$(CoreCompileDependsOn)</CoreCompileDependsOn>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource
Update="@(EmbeddedResource -> WithMetadataValue('Generator', 'MSBuild:Compile'))"
Type="Resx">
<StronglyTypedFileName>$(IntermediateOutputPath)\$([MSBuild]::ValueOrDefault('%(RelativeDir)',
'').Replace('\', '.').Replace('/',
'.'))%(Filename).g$(DefaultLanguageSourceExtension)</StronglyTypedFileName>
<StronglyTypedLanguage>$(Language)</StronglyTypedLanguage>
<StronglyTypedNamespace Condition="'%(RelativeDir)' == ''">$(RootNamespace)</StronglyTypedNamespace>
<StronglyTypedNamespace Condition="'%(RelativeDir)' != ''">$(RootNamespace).$([MSBuild]::ValueOrDefault('%(RelativeDir)',
'').Replace('\', '.').Replace('/', '.').TrimEnd('.'))</StronglyTypedNamespace>
<StronglyTypedClassName>%(Filename)</StronglyTypedClassName>
</EmbeddedResource>
</ItemGroup>
</Project>
+1
View File
@@ -8,6 +8,7 @@
<PackageVersion Include="Extensions.MudBlazor.StaticInput" Version="4.1.0" />
<PackageVersion Include="FluentValidation" Version="12.1.1" />
<PackageVersion Include="Grpc.AspNetCore" Version="2.64.0" />
<PackageVersion Include="Microsoft.Extensions.Localization" Version="10.0.9" />
<PackageVersion Include="MudBlazor" Version="9.4.0" />
</ItemGroup>
<ItemGroup>
+19 -1
View File
@@ -1,4 +1,7 @@
<!DOCTYPE html>
@using System.Globalization
@using Microsoft.AspNetCore.Localization
<!DOCTYPE html>
<html lang="en">
<head>
@@ -23,3 +26,18 @@
</body>
</html>
@code {
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
protected override void OnInitialized()
{
HttpContext?.Response.Cookies.Append(
CookieRequestCultureProvider.DefaultCookieName,
CookieRequestCultureProvider.MakeCookieValue(
new RequestCulture(
CultureInfo.CurrentCulture,
CultureInfo.CurrentUICulture)));
}
}
@@ -10,7 +10,7 @@
<DialogActions>
<MudButton Color="Color.Primary" Variant="Variant.Filled" EndIcon="@Icons.Material.Filled.Close"
OnClick="Submit">
Close
@LanguageLocale.general_btnClose
</MudButton>
</DialogActions>
</MudDialog>
@@ -1,60 +1,64 @@
@using System.Linq;
@using FluentValidation;
@using Somnia.GuestLog.Models.DTOs;
@using Somnia.GuestLog.Services;
@using Somnia.GuestLog.Validators;
<MudForm @ref="@_form" Model="@Model" Validation="@(guestDocValidator.ValidateValue)" ValidationDelay="0"
@inject IDataListService dataListService;
@inject IValidator<GuestDocumentDTO> guestDocValidator;
@inject IStringLocalizer<LanguageLocale> lang;
<MudForm @ref="@_form" Model="@Model" Validation="@((guestDocValidator as GuestDocumentDTOValidator)!.ValidateValue)" ValidationDelay="0"
ReadOnly="@ReadOnly">
<MudGrid>
<MudItem xs="12" md="6">
<MudPaper Class="pa-4" Elevation="3" Height="100%">
<MudText Typo="Typo.subtitle1" Align="Align.Center">Document Details</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center">@LanguageLocale.control_GuestDocForm_sectionDocument</MudText>
<MudDivider DividerType="DividerType.Middle" Class="mb-4" />
<MudStack Row>
<MudSelect @bind-Value="Model.DocumentType" For="@(() => Model.DocumentType)" Label="DocumentType"
<MudSelect @bind-Value="Model.DocumentType" For="@(() => Model.DocumentType)" Label="@LanguageLocale.dto_GuestDocument_DocumentType"
Required>
@foreach (string docType in GuestConsts.DocumentTypeList)
@foreach (string docType in dataListService.GetDataListByName(GuestConsts.DataList_DocumentTypes))
{
<MudSelectItem Value="docType">@docType</MudSelectItem>
<MudSelectItem Value="docType">@lang[$"dataList.DocumentType.{docType}"]</MudSelectItem>
}
</MudSelect>
<MudTextField @bind-Value="Model.DocumentNum" For="@(() => Model.DocumentNum)" Label="Document Num"
<MudTextField @bind-Value="Model.DocumentNum" For="@(() => Model.DocumentNum)" Label="@LanguageLocale.dto_GuestDocument_DocumentNum"
Immediate="true" Required />
</MudStack>
<MudStack Row>
<MudDatePicker @bind-Date="Model.IssueDate" For="@(() => Model.IssueDate)" Label="Issue Date"
<MudDatePicker @bind-Date="Model.IssueDate" For="@(() => Model.IssueDate)" Label="@LanguageLocale.dto_GuestDocument_IssueDate"
Clearable OpenTo="OpenTo.Year" Editable />
<MudTextField @bind-Value="Model.SupportNum" For="@(() => Model.SupportNum)" Label="Support Num"
<MudTextField @bind-Value="Model.SupportNum" For="@(() => Model.SupportNum)" Label="@LanguageLocale.dto_GuestDocument_SupportNum"
Immediate="true" Required="@isSuportNumberRequired" />
</MudStack>
<MudSelect @bind-Value="Model.Nationality" For="@(() => Model.Nationality)" Label="Nationality">
@foreach (var countryPair in GuestConsts.CountryList)
{
<MudSelectItem Value="countryPair.Key">@countryPair.Value</MudSelectItem>
}
</MudSelect>
<MudAutocomplete T="string" @bind-Value="Model.Nationality" For="@(() => Model.Nationality)" Label="@LanguageLocale.dto_GuestDocument_Nationality"
SearchFunc="@SearchCountryCodes" ToStringFunc="@(e=> string.IsNullOrEmpty(e) ? "" : lang[$"dataList.CountryCode.{e}"])"
SelectValueOnTab="true" AdornmentIcon="@Icons.Material.Filled.Search" />
</MudPaper>
</MudItem>
<MudItem xs="12" md="6">
<MudPaper Class="pa-4" Elevation="3" Height="100%">
<MudText Typo="Typo.subtitle1" Align="Align.Center">Customer Details</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center">@LanguageLocale.control_GuestDocForm_sectionGuest</MudText>
<MudDivider DividerType="DividerType.Middle" Class="mb-4" />
<MudTextField @bind-Value="Model.Name" For="@(() => Model.Name)" Immediate="true" Label="Name" />
<MudTextField @bind-Value="Model.Name" For="@(() => Model.Name)" Immediate="true" Label="@LanguageLocale.dto_GuestDocument_Name" />
<MudTextField @bind-Value="Model.Surname" For="@(() => Model.Surname)" Immediate="true"
Label="Surname" />
Label="@LanguageLocale.dto_GuestDocument_Surname" />
<MudTextField @bind-Value="Model.Surname2" For="@(() => Model.Surname2)" Immediate="true"
Label="Surname2" />
<MudStack Row>
<MudDatePicker @bind-Date="Model.BirthDate" For="@(() => Model.BirthDate)" Label="BirthDate"
<MudDatePicker @bind-Date="Model.BirthDate" For="@(() => Model.BirthDate)" Label="@LanguageLocale.dto_GuestDocument_BirthDate"
Clearable OpenTo="OpenTo.Year" Editable />
<MudSelect @bind-Value="Model.Gender" For="@(() => Model.Gender)" Label="Gender">
@foreach (var genderPair in GuestConsts.GenderList)
<MudSelect @bind-Value="Model.Gender" For="@(() => Model.Gender)" Label="@LanguageLocale.dto_GuestDocument_Gender">
@foreach (string gender in dataListService.GetDataListByName(GuestConsts.DataList_GenderOptions))
{
<MudSelectItem Value="genderPair.Key">@genderPair.Value</MudSelectItem>
<MudSelectItem Value="gender">@lang[$"dataList.GenderOption.{gender}"]</MudSelectItem>
}
</MudSelect>
</MudStack>
@@ -63,41 +67,39 @@
<MudItem xs="12" md="6">
<MudPaper Class="pa-4" Elevation="3" Height="100%">
<MudText Typo="Typo.subtitle1" Align="Align.Center">Contact Details</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center">@LanguageLocale.control_GuestDocForm_sectionContact</MudText>
<MudDivider DividerType="DividerType.Middle" Class="mb-4" />
<MudStack Row>
<MudTextField @bind-Value="Model.PhoneNumber" For="@(() => Model.PhoneNumber)" Immediate="true"
Label="Phone Number" />
Label="@LanguageLocale.dto_GuestDocument_PhoneNumber" />
<MudTextField @bind-Value="Model.EmailAddress" For="@(() => Model.EmailAddress)" Immediate="true"
Label="Email" />
Label="@LanguageLocale.dto_GuestDocument_EmailAddress" />
</MudStack>
</MudPaper>
</MudItem>
<MudItem xs="12" md="6">
<MudPaper Class="pa-4" Elevation="3" Height="100%">
<MudText Typo="Typo.subtitle1" Align="Align.Center">Address</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center">@LanguageLocale.control_GuestDocForm_sectionAddress</MudText>
<MudDivider DividerType="DividerType.Middle" Class="mb-4" />
<MudTextField @bind-Value="Model.Address" For="@(() => Model.Address)" Immediate="true" Label="Address" />
<MudTextField @bind-Value="Model.Address" For="@(() => Model.Address)" Immediate="true" Label="@LanguageLocale.dto_GuestDocument_Address" />
<MudStack Row>
<MudTextField @bind-Value="Model.AddressCity" For="@(() => Model.AddressCity)" Immediate="true"
Label="City" />
Label="@LanguageLocale.dto_GuestDocument_AddressCity" />
<MudTextField @bind-Value="Model.AddressProvince" For="@(() => Model.AddressProvince)" Immediate="true"
Label="Province" />
Label="@LanguageLocale.dto_GuestDocument_AddressProvince" />
<MudTextField @bind-Value="Model.AddressState" For="@(() => Model.AddressState)" Immediate="true"
Label="State" />
Label="@LanguageLocale.dto_GuestDocument_AddressState" />
</MudStack>
<MudStack Row>
<MudSelect @bind-Value="Model.AddressCountry" For="@(() => Model.AddressCountry)" Label="Country">
@foreach (var countryPair in GuestConsts.CountryList)
{
<MudSelectItem Value="countryPair.Key">@countryPair.Value</MudSelectItem>
}
</MudSelect>
<MudAutocomplete T="string" @bind-Value="Model.AddressCountry" For="@(() => Model.AddressCountry)" Label="@LanguageLocale.dto_GuestDocument_AddressCountry"
SearchFunc="@SearchCountryCodes" ToStringFunc="@(e=> string.IsNullOrEmpty(e) ? "" : lang[$"dataList.CountryCode.{e}"])"
SelectValueOnTab="true" AdornmentIcon="@Icons.Material.Filled.Search" />
<MudTextField @bind-Value="Model.ZipCode" For="@(() => Model.ZipCode)" Immediate="true"
Label="ZipCode" />
Label="@LanguageLocale.dto_GuestDocument_ZipCode" />
</MudStack>
</MudPaper>
</MudItem>
@@ -115,7 +117,7 @@
private MudForm _form = null!;
private readonly GuestDocumentDTOValidator guestDocValidator = new();
private Dictionary<string, string>? countryDict = null;
private bool isSuportNumberRequired { get => Model?.Nationality == "ESP"; }
private string CreateTimeString
@@ -141,4 +143,27 @@
return _form.IsValid;
}
private async Task<IEnumerable<string>> SearchCountryCodes(string value, CancellationToken token)
{
// if text is null or empty, show complete list
if (string.IsNullOrEmpty(value)) {
return new string[0];
}
if(countryDict is null || countryDict.Count == 0) {
var countryCodeSet = dataListService.GetDataListByName(GuestConsts.DataList_CountryCodes);
countryDict = new(countryCodeSet.Count);
//Init dict.
foreach(string code in dataListService.GetDataListByName(GuestConsts.DataList_CountryCodes))
{
countryDict.Add(code, lang[$"dataList.CountryCode.{code}"]);
}
}
return countryDict
.Where(x => x.Value.Contains(value, StringComparison.InvariantCultureIgnoreCase))
.Select(x => x.Key);
}
}
@@ -1,6 +1,6 @@
<MudDialog>
<TitleContent>
<MudText Typo="Typo.subtitle1" Align="Align.Center">In progress...</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center">@LanguageLocale.general_inProgressMsg</MudText>
</TitleContent>
<DialogContent>
<div class="d-flex flex-grow-1 flex-wrap justify-center align-center ma-8">
@@ -7,6 +7,7 @@
@inject NavigationManager Navigation
@inject ISnackbar Snackbar
@inject IDialogService DialogService
@inject IStringLocalizer<LanguageLocale> Lang
<PageTitle>Somnia - Guest Docs</PageTitle>
@@ -16,7 +17,7 @@
<MudSpacer />
<MudButton Variant="Variant.Filled" Color="Color.Success" Size="Size.Small" StartIcon="@Icons.Material.Filled.Add"
OnClick="() => BtnNewGuest()">
New Guest
@LanguageLocale.page_GuestDocList_btnNewGuest
</MudButton>
</MudStack>
@@ -36,32 +37,47 @@
<MudStack Class="ml-auto" Row="true" AlignItems="AlignItems.End">
<MudButton StartIcon="@Icons.Material.Outlined.Refresh" Variant="Variant.Outlined" Size="Size.Small"
OnClick="() => LoadDataAsync()">
Reload Data
@LanguageLocale.general_reloadData
</MudButton>
<MudButton StartIcon="@Icons.Material.Outlined.ViewColumn" Variant="Variant.Outlined" Size="Size.Small"
OnClick="(args) => BtnConfigureColumnsClick(args)">
Configure Columns
@LanguageLocale.general_ConfigureColumns
</MudButton>
</MudStack>
</ToolBarContent>
<Columns>
<PropertyColumn Property="x => x.DocumentType" Hideable="false" />
<PropertyColumn Property="x => x.DocumentNum" Hideable="false" />
<PropertyColumn Property="x => x.Name" />
<PropertyColumn Property="x => x.Surname" />
<PropertyColumn Property="x => x.Nationality" />
<PropertyColumn Property="x => x.UpdateTime" />
<PropertyColumn Property="x => x.DocumentType" Hideable="false"
Title="@LanguageLocale.dto_GuestDocument_DocumentType" />
<PropertyColumn Property="x => x.DocumentNum" Hideable="false"
Title="@LanguageLocale.dto_GuestDocument_DocumentNum" />
<PropertyColumn Property="x => x.Name" Title="@LanguageLocale.dto_GuestDocument_Name" />
<PropertyColumn Property="x => x.Surname" Title="@LanguageLocale.dto_GuestDocument_Surname" />
<PropertyColumn Property="x => x.Nationality" Title="@LanguageLocale.dto_GuestDocument_Surname2" />
<PropertyColumn Property="x => x.UpdateTime" Title="@LanguageLocale.dto_GuestDocument_UpdateTime" />
<TemplateColumn CellClass="d-flex justify-between" Title="Options" StickyRight Hideable="false"
ShowColumnOptions="false">
<CellTemplate>
<MudIconButton Size="@Size.Small" Icon="@Icons.Material.Outlined.Info"
OnClick="() => BtnViewDetails(context.Item)" />
<MudIconButton Size="@Size.Small" Icon="@Icons.Material.Outlined.Delete"
OnClick="() => BtnDeleteItem(context.Item)" />
</CellTemplate>
</TemplateColumn>
</Columns>
</MudDataGrid>
<MudMessageBox @ref="_msgBoxConfirmDelete" Title="Warning" CancelText="Cancel">
<MessageContent>
@LanguageLocale.general_confirmDeleteMsg
</MessageContent>
<YesButton>
<MudButton Variant="Variant.Filled" Color="Color.Error" StartIcon="@Icons.Material.Filled.DeleteForever">
@LanguageLocale.general_btnDelete
</MudButton>
</YesButton>
</MudMessageBox>
@code {
private IEnumerable<GuestDocumentDTO> guestDocList = [];
@@ -70,7 +86,8 @@
private HashSet<string> _moduleList = [];
private HashSet<string> _selectedModuleList = [];
private MudDataGrid<GuestDocumentDTO>? _dataGrid;
private MudDataGrid<GuestDocumentDTO> _dataGrid = null!;
private MudMessageBox _msgBoxConfirmDelete = null!;
protected override async Task OnInitializedAsync()
@@ -108,11 +125,6 @@
private async Task BtnConfigureColumnsClick(MouseEventArgs args)
{
if (_dataGrid is null)
{
Snackbar.Add("No ref to grid");
return;
}
_dataGrid.ShowColumnsPanel(args);
}
@@ -124,12 +136,32 @@
{
FullScreen = true,
CloseButton = true,
CloseOnEscapeKey = true,
CloseOnEscapeKey = true,
};
await DialogService.ShowAsync<GuestDocDetailsDialog>("GuestDoc Details", parameters, options);
}
private async Task BtnDeleteItem(GuestDocumentDTO item)
{
bool? confirmDelete = await _msgBoxConfirmDelete.ShowAsync();
if (confirmDelete is null || confirmDelete.Value == false)
{
return;
}
bool deleted = await GuestDocService.DeleteDocumentAsync(item);
if (!deleted)
{
Snackbar.Add($"Error deleting document {item.DocumentType}-{item.DocumentNum}", Severity.Error);
return;
}
Snackbar.Add($"Document {item.DocumentType}-{item.DocumentNum} deleted!", Severity.Success);
await LoadDataAsync();
}
private void BtnNewGuest()
{
Navigation.NavigateTo(GuestConsts.Page_GuestDocs_New);
@@ -19,11 +19,11 @@
<MudSpacer />
<MudButton Variant="Variant.Filled" Color="Color.Success" Size="Size.Small" StartIcon="@Icons.Material.Filled.Add"
OnClick="() => BtnSaveNewGuest()">
Create
@LanguageLocale.general_btnCreate
</MudButton>
<MudButton Variant="Variant.Filled" Color="Color.Default" Size="Size.Small"
StartIcon="@Icons.Material.Filled.ArrowBack" OnClick="() => BtnReturn()">
Return
@LanguageLocale.general_btnReturn
</MudButton>
</MudStack>
<GuestDocForm @ref="_form" />
@@ -6,8 +6,10 @@
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using Microsoft.Extensions.Localization
@using MudBlazor
@using MudBlazor.Services
@using Somnia.GuestLog
@using Somnia.GuestLog.Components
@using Somnia.GuestLog.Components.Layout
@using Somnia.GuestLog.Resources
+4 -21
View File
@@ -7,27 +7,10 @@ public static class GuestConsts
public const string Page_GuestDocs_New = "/guest-documents/new";
public static HashSet<string> DocumentTypeList { get; private set; } = [
"DNI",
"NIE",
"Passport",
"ID Card",
"Other",
];
public static Dictionary<string, string> CountryList { get; private set; } = new([
new KeyValuePair<string, string>("ESP", "Spain"),
new KeyValuePair<string, string>("ITA", "Italy"),
new KeyValuePair<string, string>("USA", "United States")
]);
public static Dictionary<string, string> GenderList { get; private set; } = new([
new KeyValuePair<string, string>("M", "Male"),
new KeyValuePair<string, string>("F", "Female"),
new KeyValuePair<string, string>("O", "Other")
]);
public const string regexPattern_phoneNum = @"\+?\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}";
public const string DataList_DocumentTypes = "DocumentTypes";
public const string DataList_GenderOptions = "GenderOptions";
public const string DataList_CountryCodes = "CountryCodes";
}
+15
View File
@@ -1,4 +1,5 @@
using FluentValidation;
using Microsoft.AspNetCore.Localization;
using Microsoft.EntityFrameworkCore;
using MudBlazor.Services;
using Somnia.GuestLog.Components;
@@ -30,6 +31,9 @@ builder.Services.AddSingleton<IValidator<GuestDocumentDTO>, GuestDocumentDTOVali
// Add Services
builder.Services.AddSingleton<IGuestDocumentService, GuestDocumentService>();
builder.Services.AddSingleton<IDataListService, StaticDataListService>();
builder.Services.AddLocalization();
var app = builder.Build();
@@ -49,6 +53,17 @@ app.UseHttpsRedirection();
app.UseAntiforgery();
string[] supportedCultures = ["en-US", "es-ES"];
var localizationOptions = new RequestLocalizationOptions()
.SetDefaultCulture(supportedCultures[0])
.AddSupportedCultures(supportedCultures)
.AddSupportedUICultures(supportedCultures);
localizationOptions.RequestCultureProviders = [
new QueryStringRequestCultureProvider(),
new CookieRequestCultureProvider()
];
app.UseRequestLocalization(localizationOptions);
app.MapStaticAssets();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="SimpleKey" xml:space="preserve">
<value>Valor Simple!</value>
</data>
</root>
@@ -0,0 +1,422 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing"
mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework
object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="dto.GuestDocument.DocumentType" xml:space="preserve"><value>Document Type</value></data>
<data name="dto.GuestDocument.DocumentNum" xml:space="preserve"><value>Document Number</value></data>
<data name="dto.GuestDocument.IssueDate" xml:space="preserve"><value>Issue Date</value></data>
<data name="dto.GuestDocument.SupportNum" xml:space="preserve"><value>Support Number</value></data>
<data name="dto.GuestDocument.Nationality" xml:space="preserve"><value>Nationality</value></data>
<data name="dto.GuestDocument.Name" xml:space="preserve"><value>Name</value></data>
<data name="dto.GuestDocument.Surname" xml:space="preserve"><value>Surname</value></data>
<data name="dto.GuestDocument.Surname2" xml:space="preserve"><value>Surname 2</value></data>
<data name="dto.GuestDocument.BirthDate" xml:space="preserve"><value>Birth Date</value></data>
<data name="dto.GuestDocument.Gender" xml:space="preserve"><value>Gender</value></data>
<data name="dto.GuestDocument.PhoneNumber" xml:space="preserve"><value>Phone Number</value></data>
<data name="dto.GuestDocument.EmailAddress" xml:space="preserve"><value>Email Address</value></data>
<data name="dto.GuestDocument.Address" xml:space="preserve"><value>Address</value></data>
<data name="dto.GuestDocument.AddressCity" xml:space="preserve"><value>City</value></data>
<data name="dto.GuestDocument.AddressProvince" xml:space="preserve"><value>County</value></data>
<data name="dto.GuestDocument.AddressState" xml:space="preserve"><value>State</value></data>
<data name="dto.GuestDocument.AddressCountry" xml:space="preserve"><value>Country</value></data>
<data name="dto.GuestDocument.ZipCode" xml:space="preserve"><value>Zip Code</value></data>
<data name="dto.GuestDocument.CreateTime" xml:space="preserve"><value>Creation Time</value></data>
<data name="dto.GuestDocument.UpdateTime" xml:space="preserve"><value>Update Time</value></data>
<data name="general.reloadData" xml:space="preserve"><value>Reload Data</value></data>
<data name="general.inProgressMsg" xml:space="preserve"><value>In Progress...</value></data>
<data name="general.ConfigureColumns" xml:space="preserve"><value>Configure Columns</value></data>
<data name="general.confirmDeleteMsg" xml:space="preserve"><value>Deleting can not be undone!</value></data>
<data name="general.btnDelete" xml:space="preserve"><value>Delete</value></data>
<data name="general.btnCreate" xml:space="preserve"><value>Create</value></data>
<data name="general.btnReturn" xml:space="preserve"><value>Return</value></data>
<data name="general.btnClose" xml:space="preserve"><value>Close</value></data>
<data name="dataList.CountryCode.ABW" xml:space="preserve"><value>Aruba</value></data>
<data name="dataList.CountryCode.AFG" xml:space="preserve"><value>Afghanistan</value></data>
<data name="dataList.CountryCode.AGO" xml:space="preserve"><value>Angola</value></data>
<data name="dataList.CountryCode.AIA" xml:space="preserve"><value>Anguilla</value></data>
<data name="dataList.CountryCode.ALA" xml:space="preserve"><value>Åland Islands</value></data>
<data name="dataList.CountryCode.ALB" xml:space="preserve"><value>Albania</value></data>
<data name="dataList.CountryCode.AND" xml:space="preserve"><value>Andorra</value></data>
<data name="dataList.CountryCode.ARE" xml:space="preserve"><value>United Arab Emirates</value></data>
<data name="dataList.CountryCode.ARG" xml:space="preserve"><value>Argentina</value></data>
<data name="dataList.CountryCode.ARM" xml:space="preserve"><value>Armenia</value></data>
<data name="dataList.CountryCode.ASM" xml:space="preserve"><value>American Samoa</value></data>
<data name="dataList.CountryCode.ATA" xml:space="preserve"><value>Antarctica</value></data>
<data name="dataList.CountryCode.ATF" xml:space="preserve"><value>French Southern Territories</value></data>
<data name="dataList.CountryCode.ATG" xml:space="preserve"><value>Antigua and Barbuda</value></data>
<data name="dataList.CountryCode.AUS" xml:space="preserve"><value>Australia</value></data>
<data name="dataList.CountryCode.AUT" xml:space="preserve"><value>Austria</value></data>
<data name="dataList.CountryCode.AZE" xml:space="preserve"><value>Azerbaijan</value></data>
<data name="dataList.CountryCode.BDI" xml:space="preserve"><value>Burundi</value></data>
<data name="dataList.CountryCode.BEL" xml:space="preserve"><value>Belgium</value></data>
<data name="dataList.CountryCode.BEN" xml:space="preserve"><value>Benin</value></data>
<data name="dataList.CountryCode.BES" xml:space="preserve"><value>Bonaire, Sint Eustatius and Saba</value></data>
<data name="dataList.CountryCode.BFA" xml:space="preserve"><value>Burkina Faso</value></data>
<data name="dataList.CountryCode.BGD" xml:space="preserve"><value>Bangladesh</value></data>
<data name="dataList.CountryCode.BGR" xml:space="preserve"><value>Bulgaria</value></data>
<data name="dataList.CountryCode.BHR" xml:space="preserve"><value>Bahrain</value></data>
<data name="dataList.CountryCode.BHS" xml:space="preserve"><value>Bahamas</value></data>
<data name="dataList.CountryCode.BIH" xml:space="preserve"><value>Bosnia and Herzegovina</value></data>
<data name="dataList.CountryCode.BLM" xml:space="preserve"><value>Saint Barthélemy</value></data>
<data name="dataList.CountryCode.BLR" xml:space="preserve"><value>Belarus</value></data>
<data name="dataList.CountryCode.BLZ" xml:space="preserve"><value>Belize</value></data>
<data name="dataList.CountryCode.BMU" xml:space="preserve"><value>Bermuda</value></data>
<data name="dataList.CountryCode.BOL" xml:space="preserve"><value>Bolivia, Plurinational State of</value></data>
<data name="dataList.CountryCode.BRA" xml:space="preserve"><value>Brazil</value></data>
<data name="dataList.CountryCode.BRB" xml:space="preserve"><value>Barbados</value></data>
<data name="dataList.CountryCode.BRN" xml:space="preserve"><value>Brunei Darussalam</value></data>
<data name="dataList.CountryCode.BTN" xml:space="preserve"><value>Bhutan</value></data>
<data name="dataList.CountryCode.BVT" xml:space="preserve"><value>Bouvet Island</value></data>
<data name="dataList.CountryCode.BWA" xml:space="preserve"><value>Botswana</value></data>
<data name="dataList.CountryCode.CAF" xml:space="preserve"><value>Central African Republic</value></data>
<data name="dataList.CountryCode.CAN" xml:space="preserve"><value>Canada</value></data>
<data name="dataList.CountryCode.CCK" xml:space="preserve"><value>Cocos (Keeling) Islands</value></data>
<data name="dataList.CountryCode.CHE" xml:space="preserve"><value>Switzerland</value></data>
<data name="dataList.CountryCode.CHL" xml:space="preserve"><value>Chile</value></data>
<data name="dataList.CountryCode.CHN" xml:space="preserve"><value>China</value></data>
<data name="dataList.CountryCode.CIV" xml:space="preserve"><value>Côte d'Ivoire</value></data>
<data name="dataList.CountryCode.CMR" xml:space="preserve"><value>Cameroon</value></data>
<data name="dataList.CountryCode.COD" xml:space="preserve"><value>Congo, Democratic Republic of the</value></data>
<data name="dataList.CountryCode.COG" xml:space="preserve"><value>Congo</value></data>
<data name="dataList.CountryCode.COK" xml:space="preserve"><value>Cook Islands</value></data>
<data name="dataList.CountryCode.COL" xml:space="preserve"><value>Colombia</value></data>
<data name="dataList.CountryCode.COM" xml:space="preserve"><value>Comoros</value></data>
<data name="dataList.CountryCode.CPV" xml:space="preserve"><value>Cabo Verde</value></data>
<data name="dataList.CountryCode.CRI" xml:space="preserve"><value>Costa Rica</value></data>
<data name="dataList.CountryCode.CUB" xml:space="preserve"><value>Cuba</value></data>
<data name="dataList.CountryCode.CUW" xml:space="preserve"><value>Curaçao</value></data>
<data name="dataList.CountryCode.CXR" xml:space="preserve"><value>Christmas Island</value></data>
<data name="dataList.CountryCode.CYM" xml:space="preserve"><value>Cayman Islands</value></data>
<data name="dataList.CountryCode.CYP" xml:space="preserve"><value>Cyprus</value></data>
<data name="dataList.CountryCode.CZE" xml:space="preserve"><value>Czechia</value></data>
<data name="dataList.CountryCode.DEU" xml:space="preserve"><value>Germany</value></data>
<data name="dataList.CountryCode.DJI" xml:space="preserve"><value>Djibouti</value></data>
<data name="dataList.CountryCode.DMA" xml:space="preserve"><value>Dominica</value></data>
<data name="dataList.CountryCode.DNK" xml:space="preserve"><value>Denmark</value></data>
<data name="dataList.CountryCode.DOM" xml:space="preserve"><value>Dominican Republic</value></data>
<data name="dataList.CountryCode.DZA" xml:space="preserve"><value>Algeria</value></data>
<data name="dataList.CountryCode.ECU" xml:space="preserve"><value>Ecuador</value></data>
<data name="dataList.CountryCode.EGY" xml:space="preserve"><value>Egypt</value></data>
<data name="dataList.CountryCode.ERI" xml:space="preserve"><value>Eritrea</value></data>
<data name="dataList.CountryCode.ESH" xml:space="preserve"><value>Western Sahara</value></data>
<data name="dataList.CountryCode.ESP" xml:space="preserve"><value>Spain</value></data>
<data name="dataList.CountryCode.EST" xml:space="preserve"><value>Estonia</value></data>
<data name="dataList.CountryCode.ETH" xml:space="preserve"><value>Ethiopia</value></data>
<data name="dataList.CountryCode.FIN" xml:space="preserve"><value>Finland</value></data>
<data name="dataList.CountryCode.FJI" xml:space="preserve"><value>Fiji</value></data>
<data name="dataList.CountryCode.FLK" xml:space="preserve"><value>Falkland Islands (Malvinas)</value></data>
<data name="dataList.CountryCode.FRA" xml:space="preserve"><value>France</value></data>
<data name="dataList.CountryCode.FRO" xml:space="preserve"><value>Faroe Islands</value></data>
<data name="dataList.CountryCode.FSM" xml:space="preserve"><value>Micronesia, Federated States of</value></data>
<data name="dataList.CountryCode.GAB" xml:space="preserve"><value>Gabon</value></data>
<data name="dataList.CountryCode.GBR" xml:space="preserve"><value>United Kingdom of Great Britain and Northern Ireland</value></data>
<data name="dataList.CountryCode.GEO" xml:space="preserve"><value>Georgia</value></data>
<data name="dataList.CountryCode.GGY" xml:space="preserve"><value>Guernsey</value></data>
<data name="dataList.CountryCode.GHA" xml:space="preserve"><value>Ghana</value></data>
<data name="dataList.CountryCode.GIB" xml:space="preserve"><value>Gibraltar</value></data>
<data name="dataList.CountryCode.GIN" xml:space="preserve"><value>Guinea</value></data>
<data name="dataList.CountryCode.GLP" xml:space="preserve"><value>Guadeloupe</value></data>
<data name="dataList.CountryCode.GMB" xml:space="preserve"><value>Gambia</value></data>
<data name="dataList.CountryCode.GNB" xml:space="preserve"><value>Guinea-Bissau</value></data>
<data name="dataList.CountryCode.GNQ" xml:space="preserve"><value>Equatorial Guinea</value></data>
<data name="dataList.CountryCode.GRC" xml:space="preserve"><value>Greece</value></data>
<data name="dataList.CountryCode.GRD" xml:space="preserve"><value>Grenada</value></data>
<data name="dataList.CountryCode.GRL" xml:space="preserve"><value>Greenland</value></data>
<data name="dataList.CountryCode.GTM" xml:space="preserve"><value>Guatemala</value></data>
<data name="dataList.CountryCode.GUF" xml:space="preserve"><value>French Guiana</value></data>
<data name="dataList.CountryCode.GUM" xml:space="preserve"><value>Guam</value></data>
<data name="dataList.CountryCode.GUY" xml:space="preserve"><value>Guyana</value></data>
<data name="dataList.CountryCode.HKG" xml:space="preserve"><value>Hong Kong</value></data>
<data name="dataList.CountryCode.HMD" xml:space="preserve"><value>Heard Island and McDonald Islands</value></data>
<data name="dataList.CountryCode.HND" xml:space="preserve"><value>Honduras</value></data>
<data name="dataList.CountryCode.HRV" xml:space="preserve"><value>Croatia</value></data>
<data name="dataList.CountryCode.HTI" xml:space="preserve"><value>Haiti</value></data>
<data name="dataList.CountryCode.HUN" xml:space="preserve"><value>Hungary</value></data>
<data name="dataList.CountryCode.IDN" xml:space="preserve"><value>Indonesia</value></data>
<data name="dataList.CountryCode.IMN" xml:space="preserve"><value>Isle of Man</value></data>
<data name="dataList.CountryCode.IND" xml:space="preserve"><value>India</value></data>
<data name="dataList.CountryCode.IOT" xml:space="preserve"><value>British Indian Ocean Territory</value></data>
<data name="dataList.CountryCode.IRL" xml:space="preserve"><value>Ireland</value></data>
<data name="dataList.CountryCode.IRN" xml:space="preserve"><value>Iran, Islamic Republic of</value></data>
<data name="dataList.CountryCode.IRQ" xml:space="preserve"><value>Iraq</value></data>
<data name="dataList.CountryCode.ISL" xml:space="preserve"><value>Iceland</value></data>
<data name="dataList.CountryCode.ISR" xml:space="preserve"><value>Israel</value></data>
<data name="dataList.CountryCode.ITA" xml:space="preserve"><value>Italy</value></data>
<data name="dataList.CountryCode.JAM" xml:space="preserve"><value>Jamaica</value></data>
<data name="dataList.CountryCode.JEY" xml:space="preserve"><value>Jersey</value></data>
<data name="dataList.CountryCode.JOR" xml:space="preserve"><value>Jordan</value></data>
<data name="dataList.CountryCode.JPN" xml:space="preserve"><value>Japan</value></data>
<data name="dataList.CountryCode.KAZ" xml:space="preserve"><value>Kazakhstan</value></data>
<data name="dataList.CountryCode.KEN" xml:space="preserve"><value>Kenya</value></data>
<data name="dataList.CountryCode.KGZ" xml:space="preserve"><value>Kyrgyzstan</value></data>
<data name="dataList.CountryCode.KHM" xml:space="preserve"><value>Cambodia</value></data>
<data name="dataList.CountryCode.KIR" xml:space="preserve"><value>Kiribati</value></data>
<data name="dataList.CountryCode.KNA" xml:space="preserve"><value>Saint Kitts and Nevis</value></data>
<data name="dataList.CountryCode.KOR" xml:space="preserve"><value>Korea, Republic of</value></data>
<data name="dataList.CountryCode.KWT" xml:space="preserve"><value>Kuwait</value></data>
<data name="dataList.CountryCode.LAO" xml:space="preserve"><value>Lao People's Democratic Republic</value></data>
<data name="dataList.CountryCode.LBN" xml:space="preserve"><value>Lebanon</value></data>
<data name="dataList.CountryCode.LBR" xml:space="preserve"><value>Liberia</value></data>
<data name="dataList.CountryCode.LBY" xml:space="preserve"><value>Libya</value></data>
<data name="dataList.CountryCode.LCA" xml:space="preserve"><value>Saint Lucia</value></data>
<data name="dataList.CountryCode.LIE" xml:space="preserve"><value>Liechtenstein</value></data>
<data name="dataList.CountryCode.LKA" xml:space="preserve"><value>Sri Lanka</value></data>
<data name="dataList.CountryCode.LSO" xml:space="preserve"><value>Lesotho</value></data>
<data name="dataList.CountryCode.LTU" xml:space="preserve"><value>Lithuania</value></data>
<data name="dataList.CountryCode.LUX" xml:space="preserve"><value>Luxembourg</value></data>
<data name="dataList.CountryCode.LVA" xml:space="preserve"><value>Latvia</value></data>
<data name="dataList.CountryCode.MAC" xml:space="preserve"><value>Macao</value></data>
<data name="dataList.CountryCode.MAF" xml:space="preserve"><value>Saint Martin (French part)</value></data>
<data name="dataList.CountryCode.MAR" xml:space="preserve"><value>Morocco</value></data>
<data name="dataList.CountryCode.MCO" xml:space="preserve"><value>Monaco</value></data>
<data name="dataList.CountryCode.MDA" xml:space="preserve"><value>Moldova, Republic of</value></data>
<data name="dataList.CountryCode.MDG" xml:space="preserve"><value>Madagascar</value></data>
<data name="dataList.CountryCode.MDV" xml:space="preserve"><value>Maldives</value></data>
<data name="dataList.CountryCode.MEX" xml:space="preserve"><value>Mexico</value></data>
<data name="dataList.CountryCode.MHL" xml:space="preserve"><value>Marshall Islands</value></data>
<data name="dataList.CountryCode.MKD" xml:space="preserve"><value>North Macedonia</value></data>
<data name="dataList.CountryCode.MLI" xml:space="preserve"><value>Mali</value></data>
<data name="dataList.CountryCode.MLT" xml:space="preserve"><value>Malta</value></data>
<data name="dataList.CountryCode.MMR" xml:space="preserve"><value>Myanmar</value></data>
<data name="dataList.CountryCode.MNE" xml:space="preserve"><value>Montenegro</value></data>
<data name="dataList.CountryCode.MNG" xml:space="preserve"><value>Mongolia</value></data>
<data name="dataList.CountryCode.MNP" xml:space="preserve"><value>Northern Mariana Islands</value></data>
<data name="dataList.CountryCode.MOZ" xml:space="preserve"><value>Mozambique</value></data>
<data name="dataList.CountryCode.MRT" xml:space="preserve"><value>Mauritania</value></data>
<data name="dataList.CountryCode.MSR" xml:space="preserve"><value>Montserrat</value></data>
<data name="dataList.CountryCode.MTQ" xml:space="preserve"><value>Martinique</value></data>
<data name="dataList.CountryCode.MUS" xml:space="preserve"><value>Mauritius</value></data>
<data name="dataList.CountryCode.MWI" xml:space="preserve"><value>Malawi</value></data>
<data name="dataList.CountryCode.MYS" xml:space="preserve"><value>Malaysia</value></data>
<data name="dataList.CountryCode.MYT" xml:space="preserve"><value>Mayotte</value></data>
<data name="dataList.CountryCode.NAM" xml:space="preserve"><value>Namibia</value></data>
<data name="dataList.CountryCode.NCL" xml:space="preserve"><value>New Caledonia</value></data>
<data name="dataList.CountryCode.NER" xml:space="preserve"><value>Niger</value></data>
<data name="dataList.CountryCode.NFK" xml:space="preserve"><value>Norfolk Island</value></data>
<data name="dataList.CountryCode.NGA" xml:space="preserve"><value>Nigeria</value></data>
<data name="dataList.CountryCode.NIC" xml:space="preserve"><value>Nicaragua</value></data>
<data name="dataList.CountryCode.NIU" xml:space="preserve"><value>Niue</value></data>
<data name="dataList.CountryCode.NLD" xml:space="preserve"><value>Netherlands, Kingdom of the</value></data>
<data name="dataList.CountryCode.NOR" xml:space="preserve"><value>Norway</value></data>
<data name="dataList.CountryCode.NPL" xml:space="preserve"><value>Nepal</value></data>
<data name="dataList.CountryCode.NRU" xml:space="preserve"><value>Nauru</value></data>
<data name="dataList.CountryCode.NZL" xml:space="preserve"><value>New Zealand</value></data>
<data name="dataList.CountryCode.OMN" xml:space="preserve"><value>Oman</value></data>
<data name="dataList.CountryCode.PAK" xml:space="preserve"><value>Pakistan</value></data>
<data name="dataList.CountryCode.PAN" xml:space="preserve"><value>Panama</value></data>
<data name="dataList.CountryCode.PCN" xml:space="preserve"><value>Pitcairn</value></data>
<data name="dataList.CountryCode.PER" xml:space="preserve"><value>Peru</value></data>
<data name="dataList.CountryCode.PHL" xml:space="preserve"><value>Philippines</value></data>
<data name="dataList.CountryCode.PLW" xml:space="preserve"><value>Palau</value></data>
<data name="dataList.CountryCode.PNG" xml:space="preserve"><value>Papua New Guinea</value></data>
<data name="dataList.CountryCode.POL" xml:space="preserve"><value>Poland</value></data>
<data name="dataList.CountryCode.PRI" xml:space="preserve"><value>Puerto Rico</value></data>
<data name="dataList.CountryCode.PRK" xml:space="preserve"><value>Korea, Democratic People's Republic of</value></data>
<data name="dataList.CountryCode.PRT" xml:space="preserve"><value>Portugal</value></data>
<data name="dataList.CountryCode.PRY" xml:space="preserve"><value>Paraguay</value></data>
<data name="dataList.CountryCode.PSE" xml:space="preserve"><value>Palestine, State of</value></data>
<data name="dataList.CountryCode.PYF" xml:space="preserve"><value>French Polynesia</value></data>
<data name="dataList.CountryCode.QAT" xml:space="preserve"><value>Qatar</value></data>
<data name="dataList.CountryCode.REU" xml:space="preserve"><value>Réunion</value></data>
<data name="dataList.CountryCode.ROU" xml:space="preserve"><value>Romania</value></data>
<data name="dataList.CountryCode.RUS" xml:space="preserve"><value>Russian Federation</value></data>
<data name="dataList.CountryCode.RWA" xml:space="preserve"><value>Rwanda</value></data>
<data name="dataList.CountryCode.SAU" xml:space="preserve"><value>Saudi Arabia</value></data>
<data name="dataList.CountryCode.SDN" xml:space="preserve"><value>Sudan</value></data>
<data name="dataList.CountryCode.SEN" xml:space="preserve"><value>Senegal</value></data>
<data name="dataList.CountryCode.SGP" xml:space="preserve"><value>Singapore</value></data>
<data name="dataList.CountryCode.SGS" xml:space="preserve"><value>South Georgia and the South Sandwich Islands</value></data>
<data name="dataList.CountryCode.SHN" xml:space="preserve"><value>Saint Helena, Ascension and Tristan da Cunha</value></data>
<data name="dataList.CountryCode.SJM" xml:space="preserve"><value>Svalbard and Jan Mayen</value></data>
<data name="dataList.CountryCode.SLB" xml:space="preserve"><value>Solomon Islands</value></data>
<data name="dataList.CountryCode.SLE" xml:space="preserve"><value>Sierra Leone</value></data>
<data name="dataList.CountryCode.SLV" xml:space="preserve"><value>El Salvador</value></data>
<data name="dataList.CountryCode.SMR" xml:space="preserve"><value>San Marino</value></data>
<data name="dataList.CountryCode.SOM" xml:space="preserve"><value>Somalia</value></data>
<data name="dataList.CountryCode.SPM" xml:space="preserve"><value>Saint Pierre and Miquelon</value></data>
<data name="dataList.CountryCode.SRB" xml:space="preserve"><value>Serbia</value></data>
<data name="dataList.CountryCode.SSD" xml:space="preserve"><value>South Sudan</value></data>
<data name="dataList.CountryCode.STP" xml:space="preserve"><value>Sao Tome and Principe</value></data>
<data name="dataList.CountryCode.SUR" xml:space="preserve"><value>Suriname</value></data>
<data name="dataList.CountryCode.SVK" xml:space="preserve"><value>Slovakia</value></data>
<data name="dataList.CountryCode.SVN" xml:space="preserve"><value>Slovenia</value></data>
<data name="dataList.CountryCode.SWE" xml:space="preserve"><value>Sweden</value></data>
<data name="dataList.CountryCode.SWZ" xml:space="preserve"><value>Eswatini</value></data>
<data name="dataList.CountryCode.SXM" xml:space="preserve"><value>Sint Maarten (Dutch part)</value></data>
<data name="dataList.CountryCode.SYC" xml:space="preserve"><value>Seychelles</value></data>
<data name="dataList.CountryCode.SYR" xml:space="preserve"><value>Syrian Arab Republic</value></data>
<data name="dataList.CountryCode.TCA" xml:space="preserve"><value>Turks and Caicos Islands</value></data>
<data name="dataList.CountryCode.TCD" xml:space="preserve"><value>Chad</value></data>
<data name="dataList.CountryCode.TGO" xml:space="preserve"><value>Togo</value></data>
<data name="dataList.CountryCode.THA" xml:space="preserve"><value>Thailand</value></data>
<data name="dataList.CountryCode.TJK" xml:space="preserve"><value>Tajikistan</value></data>
<data name="dataList.CountryCode.TKL" xml:space="preserve"><value>Tokelau</value></data>
<data name="dataList.CountryCode.TKM" xml:space="preserve"><value>Turkmenistan</value></data>
<data name="dataList.CountryCode.TLS" xml:space="preserve"><value>Timor-Leste</value></data>
<data name="dataList.CountryCode.TON" xml:space="preserve"><value>Tonga</value></data>
<data name="dataList.CountryCode.TTO" xml:space="preserve"><value>Trinidad and Tobago</value></data>
<data name="dataList.CountryCode.TUN" xml:space="preserve"><value>Tunisia</value></data>
<data name="dataList.CountryCode.TUR" xml:space="preserve"><value>Türkiye</value></data>
<data name="dataList.CountryCode.TUV" xml:space="preserve"><value>Tuvalu</value></data>
<data name="dataList.CountryCode.TWN" xml:space="preserve"><value>Taiwan, Province of China</value></data>
<data name="dataList.CountryCode.TZA" xml:space="preserve"><value>Tanzania, United Republic of</value></data>
<data name="dataList.CountryCode.UGA" xml:space="preserve"><value>Uganda</value></data>
<data name="dataList.CountryCode.UKR" xml:space="preserve"><value>Ukraine</value></data>
<data name="dataList.CountryCode.UMI" xml:space="preserve"><value>United States Minor Outlying Islands</value></data>
<data name="dataList.CountryCode.URY" xml:space="preserve"><value>Uruguay</value></data>
<data name="dataList.CountryCode.USA" xml:space="preserve"><value>United States of America</value></data>
<data name="dataList.CountryCode.UZB" xml:space="preserve"><value>Uzbekistan</value></data>
<data name="dataList.CountryCode.VAT" xml:space="preserve"><value>Holy See</value></data>
<data name="dataList.CountryCode.VCT" xml:space="preserve"><value>Saint Vincent and the Grenadines</value></data>
<data name="dataList.CountryCode.VEN" xml:space="preserve"><value>Venezuela, Bolivarian Republic of</value></data>
<data name="dataList.CountryCode.VGB" xml:space="preserve"><value>Virgin Islands (British)</value></data>
<data name="dataList.CountryCode.VIR" xml:space="preserve"><value>Virgin Islands (U.S.)</value></data>
<data name="dataList.CountryCode.VNM" xml:space="preserve"><value>Viet Nam</value></data>
<data name="dataList.CountryCode.VUT" xml:space="preserve"><value>Vanuatu</value></data>
<data name="dataList.CountryCode.WLF" xml:space="preserve"><value>Wallis and Futuna</value></data>
<data name="dataList.CountryCode.WSM" xml:space="preserve"><value>Samoa</value></data>
<data name="dataList.CountryCode.YEM" xml:space="preserve"><value>Yemen</value></data>
<data name="dataList.CountryCode.ZAF" xml:space="preserve"><value>South Africa</value></data>
<data name="dataList.CountryCode.ZMB" xml:space="preserve"><value>Zambia</value></data>
<data name="dataList.CountryCode.ZWE" xml:space="preserve"><value>Zimbabwe</value></data>
<data name="dataList.DocumentType.DNI" xml:space="preserve"><value>DNI</value></data>
<data name="dataList.DocumentType.NIE" xml:space="preserve"><value>NIE</value></data>
<data name="dataList.DocumentType.PASSPORT" xml:space="preserve"><value>Passport</value></data>
<data name="dataList.DocumentType.ID" xml:space="preserve"><value>ID Card</value></data>
<data name="dataList.DocumentType.OTHER" xml:space="preserve"><value>Other</value></data>
<data name="dataList.GenderOption.M" xml:space="preserve"><value>Male</value></data>
<data name="dataList.GenderOption.F" xml:space="preserve"><value>Female</value></data>
<data name="dataList.GenderOption.O" xml:space="preserve"><value>Other</value></data>
<data name="page.GuestDocList.btnNewGuest" xml:space="preserve"><value>New Guest</value></data>
<data name="control.GuestDocForm.sectionDocument" xml:space="preserve"><value>Document Details</value></data>
<data name="control.GuestDocForm.sectionGuest" xml:space="preserve"><value>Guest Details</value></data>
<data name="control.GuestDocForm.sectionContact" xml:space="preserve"><value>Contact Details</value></data>
<data name="control.GuestDocForm.sectionAddress" xml:space="preserve"><value>Guest Address</value></data>
</root>
@@ -69,16 +69,51 @@ public class GuestDocumentService(
}
}
public bool UpdateDocument(GuestDocumentDTO dto)
public Task<bool> UpdateDocumentAsync(GuestDocumentDTO dto)
{
throw new NotImplementedException();
}
public Task<bool> DeleteDocumentAsync(GuestDocumentDTO dto)
{
if (dto.DocumentType is null || dto.DocumentNum is null)
{
throw new InvalidOperationException("GuestDocumentService - DeleteDocument: A DTO without key can't be deleted!");
}
return DeleteDocumentAsync(dto.DocumentType, dto.DocumentNum);
}
public async Task<bool> DeleteDocumentAsync(string docType, string docNum)
{
using var dbContext = contextFactory.CreateDbContext();
GuestDocument? dbItem = await dbContext.GuestDocuments.FindAsync(docType, docNum);
if (dbItem is null)
{
logger.LogWarning("GuestDocumentService - DeleteDocument: Error deleting GuestDocument. Entity not found with key: '{key}-{key2}'", docType, docNum);
return false;
}
try
{
dbContext.GuestDocuments.Remove(dbItem);
await dbContext.SaveChangesAsync();
logger.LogInformation("GuestDocumentService - DeleteDocument: GuestDocument deleted: '{id}'", dbItem.GetFullKey());
return true;
}
catch (Exception ex)
{
logger.LogError(ex, "GuestDocumentService - CreateDocument: Error deleting GuestDocument: '{id}'", dbItem.GetFullKey());
return false;
}
}
public async Task<GuestDocumentDTO?> GetDtoByIdAsync(string docType, string docNum)
{
using var dbContext = contextFactory.CreateDbContext();
GuestDocument? dbItem = await dbContext.GuestDocuments.FindAsync(new { docType, docNum });
GuestDocument? dbItem = await dbContext.GuestDocuments.FindAsync(docType, docNum);
return dbItem is not null ? GetDtoFromDb(dbItem) : null;
}
@@ -0,0 +1,9 @@
namespace Somnia.GuestLog.Services;
public interface IDataListService
{
public List<string> GetAvailableLists();
public HashSet<string> GetDataListByName(string dataListName);
public bool IsValueInList(string dataListName, string value);
}
@@ -5,7 +5,9 @@ namespace Somnia.GuestLog.Services;
public interface IGuestDocumentService
{
public Task<bool> CreateDocumentAsync(GuestDocumentDTO dto);
public bool UpdateDocument(GuestDocumentDTO dto);
public Task<bool> UpdateDocumentAsync(GuestDocumentDTO dto);
public Task<bool> DeleteDocumentAsync(GuestDocumentDTO dto);
public Task<bool> DeleteDocumentAsync(string docType, string docNum);
public Task<GuestDocumentDTO?> GetDtoByIdAsync(string docType, string docNum);
public Task<IEnumerable<GuestDocumentDTO>> GetDtoListAsync();
@@ -0,0 +1,78 @@
namespace Somnia.GuestLog.Services;
public class StaticDataListService() : IDataListService
{
private readonly Dictionary<string, HashSet<string>> dataListDict = new([
new KeyValuePair<string, HashSet<string>>(GuestConsts.DataList_DocumentTypes, _documentTypeSet),
new KeyValuePair<string, HashSet<string>>(GuestConsts.DataList_GenderOptions, _genderOptionSet),
new KeyValuePair<string, HashSet<string>>(GuestConsts.DataList_CountryCodes, _countryCodeSet),
]);
public List<string> GetAvailableLists()
{
return [.. dataListDict.Keys];
}
public HashSet<string> GetDataListByName(string dataListName)
{
if (!dataListDict.TryGetValue(dataListName, out HashSet<string>? list))
{
throw new InvalidOperationException($"DataList not found with name: '{dataListName}'");
}
return list;
}
public bool IsValueInList(string dataListName, string value)
{
var set = GetDataListByName(dataListName);
return set.Contains(value);
}
#region DataList Dicts
private static readonly HashSet<string> _documentTypeSet = [
"DNI",
"NIE",
"PASSPORT",
"ID",
"OTHER",
];
private static readonly HashSet<string> _genderOptionSet = [
"M",
"F",
"O",
];
private static readonly HashSet<string> _countryCodeSet = [
"ABW","AFG","AGO","AIA","ALA","ALB","AND","ARE","ARG","ARM",
"ASM","ATA","ATF","ATG","AUS","AUT","AZE","BDI","BEL","BEN",
"BES","BFA","BGD","BGR","BHR","BHS","BIH","BLM","BLR","BLZ",
"BMU","BOL","BRA","BRB","BRN","BTN","BVT","BWA","CAF","CAN",
"CCK","CHE","CHL","CHN","CIV","CMR","COD","COG","COK","COL",
"COM","CPV","CRI","CUB","CUW","CXR","CYM","CYP","CZE","DEU",
"DJI","DMA","DNK","DOM","DZA","ECU","EGY","ERI","ESH","ESP",
"EST","ETH","FIN","FJI","FLK","FRA","FRO","FSM","GAB","GBR",
"GEO","GGY","GHA","GIB","GIN","GLP","GMB","GNB","GNQ","GRC",
"GRD","GRL","GTM","GUF","GUM","GUY","HKG","HMD","HND","HRV",
"HTI","HUN","IDN","IMN","IND","IOT","IRL","IRN","IRQ","ISL",
"ISR","ITA","JAM","JEY","JOR","JPN","KAZ","KEN","KGZ","KHM",
"KIR","KNA","KOR","KWT","LAO","LBN","LBR","LBY","LCA","LIE",
"LKA","LSO","LTU","LUX","LVA","MAC","MAF","MAR","MCO","MDA",
"MDG","MDV","MEX","MHL","MKD","MLI","MLT","MMR","MNE","MNG",
"MNP","MOZ","MRT","MSR","MTQ","MUS","MWI","MYS","MYT","NAM",
"NCL","NER","NFK","NGA","NIC","NIU","NLD","NOR","NPL","NRU",
"NZL","OMN","PAK","PAN","PCN","PER","PHL","PLW","PNG","POL",
"PRI","PRK","PRT","PRY","PSE","PYF","QAT","REU","ROU","RUS",
"RWA","SAU","SDN","SEN","SGP","SGS","SHN","SJM","SLB","SLE",
"SLV","SMR","SOM","SPM","SRB","SSD","STP","SUR","SVK","SVN",
"SWE","SWZ","SXM","SYC","SYR","TCA","TCD","TGO","THA","TJK",
"TKL","TKM","TLS","TON","TTO","TUN","TUR","TUV","TWN","TZA",
"UGA","UKR","UMI","URY","USA","UZB","VAT","VCT","VEN","VGB",
"VIR","VNM","VUT","WLF","WSM","YEM","ZAF","ZMB","ZWE",
];
#endregion
}
@@ -26,4 +26,10 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources\LanguageLocale.resx">
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
</ItemGroup>
</Project>
@@ -1,5 +1,6 @@
using FluentValidation;
using Somnia.GuestLog.Models.DTOs;
using Somnia.GuestLog.Services;
namespace Somnia.GuestLog.Validators;
@@ -8,11 +9,11 @@ namespace Somnia.GuestLog.Validators;
/// </summary>
public class GuestDocumentDTOValidator : AbstractValidator<GuestDocumentDTO>
{
public GuestDocumentDTOValidator()
public GuestDocumentDTOValidator(IDataListService dataListService)
{
RuleFor(x => x.DocumentType)
.NotEmpty()
.Must(val => val != null && GuestConsts.DocumentTypeList.Contains(val));
.Must(val => val != null && dataListService.IsValueInList(GuestConsts.DataList_DocumentTypes, val));
RuleFor(x => x.DocumentNum)
.NotEmpty()
@@ -36,7 +37,7 @@ public class GuestDocumentDTOValidator : AbstractValidator<GuestDocumentDTO>
RuleFor(x => x.Nationality)
.NotEmpty()
.Must(val => val != null && GuestConsts.CountryList.ContainsKey(val));
.Must(val => val != null && dataListService.IsValueInList(GuestConsts.DataList_CountryCodes, val));
//Contact Fields
@@ -50,7 +51,7 @@ public class GuestDocumentDTOValidator : AbstractValidator<GuestDocumentDTO>
RuleFor(x => x.AddressCountry)
.NotEmpty()
.Must(val => val != null && GuestConsts.CountryList.ContainsKey(val));
.Must(val => val != null && dataListService.IsValueInList(GuestConsts.DataList_CountryCodes, val));
// RuleFor(x => x.Email)
// .Cascade(CascadeMode.Stop)