diff --git a/Controllers/HomeController.cs b/Controllers/HomeController.cs index 0233074..33a114e 100644 --- a/Controllers/HomeController.cs +++ b/Controllers/HomeController.cs @@ -25,21 +25,22 @@ namespace VirtualTask.Controllers } else { - List modelList = new List(); - Anag a=new Anag(); - a.ancodice = "0001"; - a.andescri = "Francesco Totti"; - modelList.Add(a); + //List modelList = new List(); + //Anag a=new Anag(); + //a.ancodice = "0001"; + //a.andescri = "Francesco Totti"; + //modelList.Add(a); - Anag b = new Anag(); - b.ancodice = "0002"; - b.andescri = "Alex Del Piero"; - modelList.Add(b); + //Anag b = new Anag(); + //b.ancodice = "0002"; + //b.andescri = "Alex Del Piero"; + //modelList.Add(b); - SelectList customers = new SelectList(modelList,"ancodice","andescri"); - ViewBag.Token = token; - return View(customers); + //SelectList customers = new SelectList(modelList,"ancodice","andescri"); + //ViewBag.Token = token; + //return View(customers); + return View(); } } diff --git a/Controllers/ImpiantiController.cs b/Controllers/ImpiantiController.cs index 14b553a..1b6fa31 100644 --- a/Controllers/ImpiantiController.cs +++ b/Controllers/ImpiantiController.cs @@ -14,6 +14,7 @@ namespace VirtualTask.Controllers string apiUrl = string.Empty; string urlBase = string.Empty; string token = string.Empty; + string tenant = string.Empty; HttpClient client; public ImpiantiController() @@ -25,6 +26,7 @@ namespace VirtualTask.Controllers { SessionHelper helper = new SessionHelper(this); token = helper.GetStringValue("tok"); + if (string.IsNullOrEmpty(token)) return RedirectToAction("Index", "Login"); @@ -77,9 +79,10 @@ namespace VirtualTask.Controllers { SessionHelper helper = new SessionHelper(this); token = helper.GetStringValue("tok"); + tenant = helper.GetStringValue("tenant"); if (string.IsNullOrEmpty(token)) return RedirectToAction("Index", "Login"); - + model.imcodazi = tenant; apiUrl = helper.GetStringValue("apiUrl"); urlBase = apiUrl + "impianti/add"; urlBase = urlBase + "?token=" + token; diff --git a/Controllers/LoginController.cs b/Controllers/LoginController.cs index 3974891..4f655d1 100644 --- a/Controllers/LoginController.cs +++ b/Controllers/LoginController.cs @@ -49,6 +49,7 @@ namespace VirtualTask.Controllers //ViewBag.Token = loginOut.Tok; helper.SetStringValue("tok", loginOut.Tok); helper.SetStringValue("apiUrl", apiUrl); + helper.SetStringValue("tenant", model.Tenant); return RedirectToAction("Index","Home"); } return View(); diff --git a/Models/Impianto.cs b/Models/Impianto.cs index 49a4314..e043852 100644 --- a/Models/Impianto.cs +++ b/Models/Impianto.cs @@ -18,30 +18,39 @@ namespace VirtualTask.Models public string? imdescri { get; set; } /// Tipo indirizzo (Via, piazza..) + [Display(Name = "Via,piazza,..")] public string? imindiri1 { get; set; } /// indirizzo + [Display(Name = "Indirizzo")] public string? imindiri2 { get; set; } /// numero civico + [Display(Name = "Num civico")] public int? imindiri3 { get; set; } /// sottonumero + [Display(Name = "Interno")] public string? imindiri4 { get; set; } /// scala + [Display(Name = "Scala")] public string? imindiri5 { get; set; } /// localita + [Display(Name = "Località")] public string? imlocali { get; set; } /// Cap + [Display(Name = "Cap")] public string? imcodcap { get; set; } /// Comune + [Display(Name = "Comune")] public string? imcomune { get; set; } /// Provincia + [Display(Name = "Provincia")] public string? improvin { get; set; } [Display(Name = "Cliente")] diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index 56e8740..a023004 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -7,30 +7,5 @@

Welcome

- -
-
-
- - @if (ViewBag.Message != null) - { - - } - -
- - - - diff --git a/Views/Impianti/Create.cshtml b/Views/Impianti/Create.cshtml index ae5da8c..0170b14 100644 --- a/Views/Impianti/Create.cshtml +++ b/Views/Impianti/Create.cshtml @@ -17,11 +17,12 @@ -
+@*
-
+
*@ + @Html.HiddenFor(m => m.imcodazi)
@@ -74,19 +75,11 @@
- @Html.DropDownListFor(x =>x.imultcli, - (IEnumerable)ViewBag.AllStockList) - - + @Html.DropDownListFor(x =>x.imultcli,(IEnumerable)ViewBag.AllStockList,new {@class = "form-control"})
-
- @Html.LabelFor(model => model.imultcli, htmlAttributes: new { @class = "control-label col-md-2" }) -
- @Html.DropDownListFor(c => c.imultcli, (IEnumerable)ViewBag.AllStockList, null, new { @class = "selectpicker", data_live_search = "true" }) -
-
+
diff --git a/Views/Shared/_Layout.cshtml b/Views/Shared/_Layout.cshtml index 7fd4cd7..d158b96 100644 --- a/Views/Shared/_Layout.cshtml +++ b/Views/Shared/_Layout.cshtml @@ -56,6 +56,15 @@ + + + + + @await RenderSectionAsync("Scripts", required: false)