diff --git a/Controllers/CommesseVTController.cs b/Controllers/CommesseVTController.cs index 097856a..330cd9b 100644 --- a/Controllers/CommesseVTController.cs +++ b/Controllers/CommesseVTController.cs @@ -163,7 +163,7 @@ namespace VirtualTask.Controllers #region DETAILS - public IActionResult Details(string id) + public IActionResult Details(string id, string azienda) { SessionHelper helper = new SessionHelper(this); @@ -185,7 +185,7 @@ namespace VirtualTask.Controllers { string data = response.Content.ReadAsStringAsync().Result; modelList = JsonConvert.DeserializeObject>(data); - commessa = modelList.Where(x => x.laserial.Equals(id)).First(); + commessa = modelList.Where(x => x.laserial.Equals(id) && x.lacodazi.Equals(azienda)).First(); } else { @@ -202,7 +202,7 @@ namespace VirtualTask.Controllers #region EDIT - public IActionResult Edit(string id) + public IActionResult Edit(string id, string azienda) { SessionHelper helper = new SessionHelper(this); token = helper.GetStringValue("tok"); @@ -224,7 +224,7 @@ namespace VirtualTask.Controllers { string data = response.Content.ReadAsStringAsync().Result; modelList = JsonConvert.DeserializeObject>(data); - commessa = modelList.Where(x => x.laserial.Equals(id)).First(); + commessa = modelList.Where(x => x.laserial.Equals(id) && x.lacodazi.Equals(azienda)).First(); } else { @@ -253,7 +253,7 @@ namespace VirtualTask.Controllers return RedirectToAction("Index", "Login"); } - model.lacodazi = tenant; + //model.lacodazi = tenant; apiUrl = helper.GetStringValue("apiUrl"); urlBase = apiUrl + "commesseVT/mod"; @@ -283,7 +283,7 @@ namespace VirtualTask.Controllers #region DELETE [HttpGet] - public IActionResult Delete(string id) + public IActionResult Delete(string id, string azienda) { SessionHelper helper = new SessionHelper(this); @@ -305,7 +305,7 @@ namespace VirtualTask.Controllers { string data = response.Content.ReadAsStringAsync().Result; modelList = JsonConvert.DeserializeObject>(data); - commesse = modelList.Where(x => x.laserial.Equals(id)).First(); + commesse = modelList.Where(x => x.laserial.Equals(id)&& x.lacodazi.Equals(azienda)).First(); return View(commesse); } @@ -324,7 +324,7 @@ namespace VirtualTask.Controllers token = helper.GetStringValue("tok"); tenant = helper.GetStringValue("tenant"); - model.lacodazi = tenant; + //model.lacodazi = tenant; model.ladatchi = DateTime.Now; apiUrl = helper.GetStringValue("apiUrl"); urlBase = apiUrl + "commesseVT/del"; diff --git a/Views/CommesseVT/Delete.cshtml b/Views/CommesseVT/Delete.cshtml index aa3fe15..cc21783 100644 --- a/Views/CommesseVT/Delete.cshtml +++ b/Views/CommesseVT/Delete.cshtml @@ -9,7 +9,16 @@
+
+ @Html.HiddenFor(model => model.ladatchi) + @Html.HiddenFor(model => model.lacodazi) + @Html.HiddenFor(model => model.laserial) + @Html.HiddenFor(model => model.lacodcom) + @Html.HiddenFor(model => model.lacodimp) + @Html.HiddenFor(model => model.ladeslav) + @Html.HiddenFor(model => model.latipcli) + @Html.HiddenFor(model => model.lacodcli)
@Html.DisplayNameFor(model => model.laserial)   @Html.DisplayFor(model => model.laserial)
@@ -22,10 +31,9 @@
@Html.DisplayNameFor(model => model.ladeslav)   @Html.DisplayFor(model => model.ladeslav)
- @*
*@ - @* @Html.DisplayNameFor(model => model.ladatchi) *@ - @Html.HiddenFor(model => model.ladatchi)   @Html.HiddenFor(model => model.ladatchi) - @*
*@ + + +
@Html.DisplayNameFor(model => model.latipcli)   @Html.DisplayFor(model => model.latipcli)
@@ -37,9 +45,10 @@
 
- + - model.laserial) name="id" /> + + diff --git a/Views/CommesseVT/Edit.cshtml b/Views/CommesseVT/Edit.cshtml index bf03265..b9259a9 100644 --- a/Views/CommesseVT/Edit.cshtml +++ b/Views/CommesseVT/Edit.cshtml @@ -23,6 +23,7 @@
 
@Html.HiddenFor(x => x.lacodazi) + @Html.DisplayFor(x => x.lacodazi) @*
diff --git a/Views/CommesseVT/Index.cshtml b/Views/CommesseVT/Index.cshtml index 05d87a2..1a3b0cb 100644 --- a/Views/CommesseVT/Index.cshtml +++ b/Views/CommesseVT/Index.cshtml @@ -106,15 +106,15 @@ @Html.DisplayFor(modelItem => item.improvin) - + Modifica - - + + Dettaglio @{ - string _url_del = @Url.Action("Delete", "CommesseVT", new { id = item.laserial }); + string _url_del = @Url.Action("Delete", "CommesseVT", new { id = item.laserial, azienda = item.lacodazi }); string flagComGen = string.Empty; flagComGen = string.IsNullOrEmpty(item.lacomgen) ? "N" : item.lacomgen;