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 f14cdb9..6c1eef3 100644 Binary files a/StockManMVC/bin/StockManMVC.dll and b/StockManMVC/bin/StockManMVC.dll differ