From c009c15403b14952b04467f29853590215f06328 Mon Sep 17 00:00:00 2001 From: michele Date: Mon, 8 Apr 2024 11:30:33 +0200 Subject: [PATCH] michele: chiamate create, aggiunta nota data null e su coontroller modifica per gestione data non specificata --- Controllers/ChiamateController.cs | 6 +++++- Models/Chiamate.cs | 2 +- Views/Chiamate/Create.cshtml | 35 +++++++++++++++++++------------ Views/Chiamate/Index.cshtml | 2 +- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/Controllers/ChiamateController.cs b/Controllers/ChiamateController.cs index 3747287..2f32ad7 100644 --- a/Controllers/ChiamateController.cs +++ b/Controllers/ChiamateController.cs @@ -124,11 +124,15 @@ namespace VirtualTask.Controllers model.chcodazi = tenant; model.chaziimp = tenant; model.chserial = getNewSeriale(); - model.chnumero=getNewNumeroChiamata(); + model.chnumero=getNewNumeroChiamata(); //DateTime adesso = DateTime.Now; //model.chdata = adesso; //model.chdtass = adesso; //model.chdtapp = adesso; + if (model.chdata == null) + { + model.chdata = DateTime.Now; + } model.chdtapp = model.chdata; model.chdtass = model.chdata; model.chtipo = "A";//X=creato da app, A creato da adhoc. DEVO METTERE A perche altrimenti l'app lo tratta come una chiamata da commessa diff --git a/Models/Chiamate.cs b/Models/Chiamate.cs index 4a2c516..1dfdc9e 100644 --- a/Models/Chiamate.cs +++ b/Models/Chiamate.cs @@ -24,7 +24,7 @@ namespace VirtualTask.Models [Column(TypeName = "decimal(10, 0)")] public decimal? chnumero { get; set; } - [Display(Name = "Data")] + [Display(Name = "Data Appuntamento")] [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}")] public DateTime? chdata { get; set; } diff --git a/Views/Chiamate/Create.cshtml b/Views/Chiamate/Create.cshtml index 582f378..60fe6cc 100644 --- a/Views/Chiamate/Create.cshtml +++ b/Views/Chiamate/Create.cshtml @@ -10,56 +10,65 @@
-
+
-
+
@Html.DropDownListFor(x => x.chcodimp, (IEnumerable)ViewBag.Impianti, new { @class = "agy-form-field require" })
 
-
+
@Html.DropDownListFor(x => x.chtchiam, (IEnumerable)ViewBag.Tecnici, new { @class = "agy-form-field require" })
 
-
+
@Html.DropDownListFor(x => x.chstato, (IEnumerable)ViewBag.StatiChiamata, new { @class = "agy-form-field require" })
 
-
-
- - @* *@ - +
+ + + + + +
+
+ + @* *@ + +
+

Se la data dell'appuntamento non è specificata verrà valorizzata con la data sistema (data del giorno).

+
 
-
+
@* *@
 
-
+
@* *@
 
-
+
@Html.DropDownListFor(x => x.chcodseg, (IEnumerable)ViewBag.CodiciSegnalazione, new { @class = "agy-form-field require" })
 
-
+
@* *@ diff --git a/Views/Chiamate/Index.cshtml b/Views/Chiamate/Index.cshtml index 91135ec..45c63bc 100644 --- a/Views/Chiamate/Index.cshtml +++ b/Views/Chiamate/Index.cshtml @@ -32,7 +32,7 @@ @* Seriale *@ @* Esercizio *@ Numero - Data + Data appuntamento Impianto Tecnico Stato