From ff4e276eb2cfbccf9f4576feed9a027ee80f5610 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 6 Oct 2016 10:44:12 +0200 Subject: [PATCH] Aggiunta gestione (standardizzata) dell'anagrafica operatore... --- .../Controllers/OperatorsController.cs | 62 +++++---- StockManMVC/StockManMVC.csproj | 1 - StockManMVC/Views/Items/Index.cshtml | 2 +- StockManMVC/Views/Locations/Create.cshtml | 2 +- StockManMVC/Views/Operators/Create.cshtml | 90 ++++++------- StockManMVC/Views/Operators/Delete.cshtml | 73 ++++++----- StockManMVC/Views/Operators/Details.cshtml | 42 ------ StockManMVC/Views/Operators/Edit.cshtml | 75 +++++------ StockManMVC/Views/Operators/Index.cshtml | 120 ++++++++++++------ StockManMVC/bin/StockManMVC.dll | Bin 128000 -> 128000 bytes 10 files changed, 249 insertions(+), 218 deletions(-) delete mode 100644 StockManMVC/Views/Operators/Details.cshtml diff --git a/StockManMVC/Controllers/OperatorsController.cs b/StockManMVC/Controllers/OperatorsController.cs index 49b2ad8..81dd941 100644 --- a/StockManMVC/Controllers/OperatorsController.cs +++ b/StockManMVC/Controllers/OperatorsController.cs @@ -19,9 +19,7 @@ namespace StockManMVC.Controllers { return View(db.Operator.ToList()); } - - - + /// /// Selezione operatore da ricerca chiave... /// @@ -40,25 +38,21 @@ namespace StockManMVC.Controllers return answ; } - // GET: Operators/Details/5 - public ActionResult Details(string id) + // GET: Operators/Create (mode=std|full, opzionale) + public ActionResult Create(string mode) { - if (id == null) + if (mode == null) { - return new HttpStatusCodeResult(HttpStatusCode.BadRequest); + mode = "full"; } - Operator @operator = db.Operator.Find(id); - if (@operator == null) + if (mode == "std") { - return HttpNotFound(); + return PartialView(); + } + else + { + return View(); } - return View(@operator); - } - - // GET: Operators/Create - public ActionResult Create() - { - return View(); } // POST: Operators/Create @@ -78,9 +72,13 @@ namespace StockManMVC.Controllers return View(@operator); } - // GET: Operators/Edit/5 - public ActionResult Edit(string id) + // GET: Operators/Edit/5 (mode=std|full, opzionale) + public ActionResult Edit(string id, string mode) { + if (mode == null) + { + mode = "full"; + } if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); @@ -90,7 +88,14 @@ namespace StockManMVC.Controllers { return HttpNotFound(); } - return View(@operator); + if (mode == "std") + { + return PartialView(@operator); + } + else + { + return View(@operator); + } } // POST: Operators/Edit/5 @@ -109,9 +114,13 @@ namespace StockManMVC.Controllers return View(@operator); } - // GET: Operators/Delete/5 - public ActionResult Delete(string id) + // GET: Operators/Delete/5 (mode=std|full, opzionale) + public ActionResult Delete(string id, string mode) { + if (mode == null) + { + mode = "full"; + } if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); @@ -121,7 +130,14 @@ namespace StockManMVC.Controllers { return HttpNotFound(); } - return View(@operator); + if (mode == "std") + { + return PartialView(@operator); + } + else + { + return View(@operator); + } } // POST: Operators/Delete/5 diff --git a/StockManMVC/StockManMVC.csproj b/StockManMVC/StockManMVC.csproj index cd51334..71055fc 100644 --- a/StockManMVC/StockManMVC.csproj +++ b/StockManMVC/StockManMVC.csproj @@ -420,7 +420,6 @@ - diff --git a/StockManMVC/Views/Items/Index.cshtml b/StockManMVC/Views/Items/Index.cshtml index 9330713..d7932a2 100644 --- a/StockManMVC/Views/Items/Index.cshtml +++ b/StockManMVC/Views/Items/Index.cshtml @@ -44,7 +44,7 @@ MVCGridName = "ItemsGrid", PageSize = true, ColumnVisibility = true, - Export = true, + Export = false, GlobalSearch = true }) @Html.MVCGrid("ItemsGrid") diff --git a/StockManMVC/Views/Locations/Create.cshtml b/StockManMVC/Views/Locations/Create.cshtml index 414ff74..eadec2a 100644 --- a/StockManMVC/Views/Locations/Create.cshtml +++ b/StockManMVC/Views/Locations/Create.cshtml @@ -1,7 +1,7 @@ @model StockManMVC.Models.Location @{ - ViewBag.Title = "Create"; + ViewBag.Title = "Nuova Posizione"; } @using (Html.BeginForm()) diff --git a/StockManMVC/Views/Operators/Create.cshtml b/StockManMVC/Views/Operators/Create.cshtml index 80d65e1..6c0516b 100644 --- a/StockManMVC/Views/Operators/Create.cshtml +++ b/StockManMVC/Views/Operators/Create.cshtml @@ -1,64 +1,66 @@ @model StockManMVC.Models.Operator @{ - ViewBag.Title = "Create"; + ViewBag.Title = "Nuovo Operatore"; } -

Create

- - -@using (Html.BeginForm()) +@using (Html.BeginForm()) { @Html.AntiForgeryToken() - -
-

Operator

-
- @Html.ValidationSummary(true, "", new { @class = "text-danger" }) -
- @Html.LabelFor(model => model.ID, htmlAttributes: new { @class = "control-label col-md-2" }) -
- @Html.EditorFor(model => model.ID, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.ID, "", new { @class = "text-danger" }) -
+
+
+ Crea nuovo Operatore
-
- @Html.LabelFor(model => model.CodExt, htmlAttributes: new { @class = "control-label col-md-2" }) -
- @Html.EditorFor(model => model.CodExt, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.CodExt, "", new { @class = "text-danger" }) -
-
+
+
+ @Html.ValidationSummary(true, "", new { @class = "text-danger" }) +
+ @Html.LabelFor(model => model.ID, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.ID, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.ID, "", new { @class = "text-danger" }) +
+
-
- @Html.LabelFor(model => model.LastName, htmlAttributes: new { @class = "control-label col-md-2" }) -
- @Html.EditorFor(model => model.LastName, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.LastName, "", new { @class = "text-danger" }) -
-
+
+ @Html.LabelFor(model => model.CodExt, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.CodExt, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.CodExt, "", new { @class = "text-danger" }) +
+
-
- @Html.LabelFor(model => model.FirstName, htmlAttributes: new { @class = "control-label col-md-2" }) -
- @Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.FirstName, "", new { @class = "text-danger" }) -
-
+
+ @Html.LabelFor(model => model.LastName, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.LastName, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.LastName, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.FirstName, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.FirstName, "", new { @class = "text-danger" }) +
+
+ +
+
+ +
+ +
-
-
-
} -
- @Html.ActionLink("Back to List", "Index") -
- @section Scripts { @Scripts.Render("~/bundles/jqueryval") } diff --git a/StockManMVC/Views/Operators/Delete.cshtml b/StockManMVC/Views/Operators/Delete.cshtml index 3955211..d66a654 100644 --- a/StockManMVC/Views/Operators/Delete.cshtml +++ b/StockManMVC/Views/Operators/Delete.cshtml @@ -1,48 +1,57 @@ @model StockManMVC.Models.Operator @{ - ViewBag.Title = "Delete"; + ViewBag.Title = "Delete Operatore"; } -

Delete

+
+
+ Eliminazione record +
-

Are you sure you want to delete this?

-
-

Operator

-
-
-
- @Html.DisplayNameFor(model => model.CodExt) -
+
+

Sicuro di voler eliminare questo record?

+
+
+
+ @Html.DisplayNameFor(model => model.CodExt) +
-
- @Html.DisplayFor(model => model.CodExt) -
+
+ @Html.DisplayFor(model => model.CodExt) +
-
- @Html.DisplayNameFor(model => model.LastName) -
+
+ @Html.DisplayNameFor(model => model.LastName) +
-
- @Html.DisplayFor(model => model.LastName) -
+
+ @Html.DisplayFor(model => model.LastName) +
-
- @Html.DisplayNameFor(model => model.FirstName) -
+
+ @Html.DisplayNameFor(model => model.FirstName) +
-
- @Html.DisplayFor(model => model.FirstName) -
+
+ @Html.DisplayFor(model => model.FirstName) +
-
+
- @using (Html.BeginForm()) { - @Html.AntiForgeryToken() + @using (Html.BeginForm()) + { + @Html.AntiForgeryToken() -
- | - @Html.ActionLink("Back to List", "Index") +
+
+ +
+ +
+ }
- } +
diff --git a/StockManMVC/Views/Operators/Details.cshtml b/StockManMVC/Views/Operators/Details.cshtml deleted file mode 100644 index a5c3bf2..0000000 --- a/StockManMVC/Views/Operators/Details.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@model StockManMVC.Models.Operator - -@{ - ViewBag.Title = "Details"; -} - -

Details

- -
-

Operator

-
-
-
- @Html.DisplayNameFor(model => model.CodExt) -
- -
- @Html.DisplayFor(model => model.CodExt) -
- -
- @Html.DisplayNameFor(model => model.LastName) -
- -
- @Html.DisplayFor(model => model.LastName) -
- -
- @Html.DisplayNameFor(model => model.FirstName) -
- -
- @Html.DisplayFor(model => model.FirstName) -
- -
-
-

- @Html.ActionLink("Edit", "Edit", new { id = Model.ID }) | - @Html.ActionLink("Back to List", "Index") -

diff --git a/StockManMVC/Views/Operators/Edit.cshtml b/StockManMVC/Views/Operators/Edit.cshtml index 638d406..bf0cee0 100644 --- a/StockManMVC/Views/Operators/Edit.cshtml +++ b/StockManMVC/Views/Operators/Edit.cshtml @@ -4,55 +4,56 @@ ViewBag.Title = "Edit"; } -

Edit

- - @using (Html.BeginForm()) { @Html.AntiForgeryToken() - -
-

Operator

-
- @Html.ValidationSummary(true, "", new { @class = "text-danger" }) - @Html.HiddenFor(model => model.ID) - -
- @Html.LabelFor(model => model.CodExt, htmlAttributes: new { @class = "control-label col-md-2" }) -
- @Html.EditorFor(model => model.CodExt, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.CodExt, "", new { @class = "text-danger" }) -
+
+
+ Modifica Operatore
-
- @Html.LabelFor(model => model.LastName, htmlAttributes: new { @class = "control-label col-md-2" }) -
- @Html.EditorFor(model => model.LastName, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.LastName, "", new { @class = "text-danger" }) -
-
+
+
+ @Html.ValidationSummary(true, "", new { @class = "text-danger" }) + @Html.HiddenFor(model => model.ID) -
- @Html.LabelFor(model => model.FirstName, htmlAttributes: new { @class = "control-label col-md-2" }) -
- @Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.FirstName, "", new { @class = "text-danger" }) -
-
+
+ @Html.LabelFor(model => model.CodExt, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.CodExt, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.CodExt, "", new { @class = "text-danger" }) +
+
-
-
- +
+ @Html.LabelFor(model => model.LastName, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.LastName, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.LastName, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.FirstName, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.FirstName, "", new { @class = "text-danger" }) +
+
+ +
+
+ +
+ +
} -
- @Html.ActionLink("Back to List", "Index") -
- @section Scripts { @Scripts.Render("~/bundles/jqueryval") } diff --git a/StockManMVC/Views/Operators/Index.cshtml b/StockManMVC/Views/Operators/Index.cshtml index f311cb5..ac21cbb 100644 --- a/StockManMVC/Views/Operators/Index.cshtml +++ b/StockManMVC/Views/Operators/Index.cshtml @@ -1,45 +1,91 @@ @model IEnumerable @{ - ViewBag.Title = "Index"; + ViewBag.Title = "COnfigurazione Operatori"; } -

Index

-

- @Html.ActionLink("Create New", "Create") -

- - - - - - - +
+
+
+
+
+
+ Configurazione Operatori +
+
+ +
+
+
+
+
+
- @Html.DisplayNameFor(model => model.CodExt) - - @Html.DisplayNameFor(model => model.LastName) - - @Html.DisplayNameFor(model => model.FirstName) -
+ + + + + + -@foreach (var item in Model) { - - - - - - -} + @foreach (var item in Model) + { + var delStyle = ""; + if (item.ItemFlux.Count > 0 || item.ID == "ND") { delStyle = "disabled invisible"; } + + + + + + + } -
+ @Html.DisplayNameFor(model => model.CodExt) + + @Html.DisplayNameFor(model => model.LastName) + + @Html.DisplayNameFor(model => model.FirstName) +
- @Html.DisplayFor(modelItem => item.CodExt) - - @Html.DisplayFor(modelItem => item.LastName) - - @Html.DisplayFor(modelItem => item.FirstName) - - @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | - @Html.ActionLink("Details", "Details", new { id=item.ID }) | - @Html.ActionLink("Delete", "Delete", new { id=item.ID }) -
+ @Html.DisplayFor(modelItem => item.CodExt) + + @Html.DisplayFor(modelItem => item.LastName) + + @Html.DisplayFor(modelItem => item.FirstName) + + + +
+ +
+
+
+ @*qui inserisco la partial view...*@ +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/StockManMVC/bin/StockManMVC.dll b/StockManMVC/bin/StockManMVC.dll index f14cdb974c4cb570374783fd5c6882711a7664c7..6c1eef30db43ee9e1795230c27789249aa4b8fb1 100644 GIT binary patch delta 3381 zcmb`~c~n%_9S89H9cG4M25|0E5EPId96)h{irdIwKq{hQT!;qiQqd^50E$KigHdB_ z6@Q*svp8yFYg{7sB?tG=9Ide?E=LngjZ2znY&CAR)ux*CzW1(U%;}$ zdliU36SJ_YO^gM%Fb3_Uc-5^*Cs_Cl+>^-f1<5`KBEUUg=i(u zyab%1sq;MeoVL$Ppl$OU^!YqDoe=Md^W79V-$9l0-MBza^GDGxAzmAaOO#eS0heiI zZ34bjn`#dP;A@(>Xe6%Chl>hvl|t$YDY(u-6YJc#M!&5~z~AU-T_OHXiZ=n*Da%`k z8?;!ozojjreUol`N6;;=Ma{3jg7}?a*3@B)rB#jvvnQp#D?E2FWA@5YVON*A|Dd5S z<-nxA^3pO`BE)8>Qp1*Tt5;ko_P~AzV?}H)+lzoWCmS4UXdfEjWCKL!B6f@2(RJLc z>9*APAWe6K0z}WNV%>|_T}}SG++%n3>yqqR3}7bho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