diff --git a/Models/Articoli.cs b/Models/Articoli.cs index 61ebcc9..9454227 100644 --- a/Models/Articoli.cs +++ b/Models/Articoli.cs @@ -1,5 +1,7 @@ -using System.ComponentModel.DataAnnotations; +using DocumentFormat.OpenXml.Presentation; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Globalization; namespace VirtualTask.Models { @@ -65,5 +67,18 @@ namespace VirtualTask.Models public string? Desc_sup { get; set; } public DateTime? DataObso { get; set; } + [NotMapped] + public string LiPrezzo_input + { + get => LiPrezzo?.ToString(CultureInfo.InvariantCulture); + set + { + if (decimal.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out var result)) + LiPrezzo = result; + else + LiPrezzo = null; + } + } + } } diff --git a/Models/Tecnici.cs b/Models/Tecnici.cs index 18d3f60..98eea2c 100644 --- a/Models/Tecnici.cs +++ b/Models/Tecnici.cs @@ -2,6 +2,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Globalization; namespace VirtualTask.Models { @@ -48,5 +49,20 @@ namespace VirtualTask.Models public DateTime? tcdatobs { get; set; } + [NotMapped] + public string tccoor_input + { + get => tccoor?.ToString(CultureInfo.InvariantCulture); + set + { + if (decimal.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out var result)) + tccoor = result; + else + tccoor = null; + } + } + } + + } diff --git a/Views/Articoli/Create.cshtml b/Views/Articoli/Create.cshtml index f47d287..77b2a87 100644 --- a/Views/Articoli/Create.cshtml +++ b/Views/Articoli/Create.cshtml @@ -40,7 +40,7 @@