diff --git a/StockManMVC/App_Start/MVCGridConfig.cs b/StockManMVC/App_Start/MVCGridConfig.cs index b3460c3..e13ea38 100644 --- a/StockManMVC/App_Start/MVCGridConfig.cs +++ b/StockManMVC/App_Start/MVCGridConfig.cs @@ -305,11 +305,6 @@ namespace StockManMVC }) .WithRetrieveDataMethod((context) => { - //var options = context.QueryOptions; - //string sItemID = options.GetAdditionalQueryOptionString("ItemID"); - //if (String.IsNullOrEmpty(sItemID)) sItemID = "0"; - //int ItemID = Convert.ToInt32(sItemID); - return new QueryResult() { Items = vItemFlux2SaveController.Select().ToList(), @@ -318,6 +313,75 @@ namespace StockManMVC }) ); + + + //MVCGridDefinitionTable.Add("ItemsByFamGrid", new MVCGridBuilder(gridDefaults, colDefaults) // aggiungo valori di default... + // .WithSorting(sorting: true, defaultSortColumn: "QtaPend", defaultSortDirection: SortDirection.Dsc) + // .WithAdditionalQueryOptionNames("id") + // //.WithRowCssClassExpression(p => p.QtaCurr == 0 ? "warning" : "") // commentata x ora, poi potrebbe servire... + // .WithQueryStringPrefix("") + // .AddColumns(cols => + // { + // //Add your columns here + // cols.Add("ViewLink").WithColumnName("ViewLink") + // .WithSorting(false) + // .WithVisibility(true, false) + // .WithAllowChangeVisibility(false) + // .WithHeaderText("") + // .WithHtmlEncoding(false) + // .WithValueExpression((i, c) => c.UrlHelper.Action("Details", "Items", new { id = i.ID, StockItemID = i.ID, FluxItemID = i.ID })) + // .WithValueTemplate(""); + // cols.Add("CodInt").WithColumnName("CodInt") + // .WithVisibility(false, true) + // .WithHeaderText("Cod. Articolo") + // .WithValueExpression(i => i.CodInt); + // cols.Add("Descr").WithColumnName("Descr") + // .WithHeaderText("Articolo") + // .WithValueExpression(i => i.Descr); + // cols.Add("CodExt").WithColumnName("CodExt") + // .WithVisibility(false, true) + // .WithHeaderText("Cod. Fornitore") + // .WithValueExpression(i => i.CodExt); + // cols.Add("DescrExt").WithColumnName("DescrExt") + // .WithVisibility(false, true) + // .WithHeaderText("Descr. Fornitore") + // .WithValueExpression(i => i.DescrExt); + // cols.Add("QtaMin").WithColumnName("QtaMin") + // .WithVisibility(false, true) + // .WithHeaderText("Qta Minima") + // .WithValueExpression(i => i.QtaMin.ToString()); + // cols.Add("QtaBatch").WithColumnName("QtaBatch") + // .WithVisibility(false, true) + // .WithHeaderText("Lotto") + // .WithValueExpression(i => i.QtaBatch.ToString()); + // cols.Add("QtaPend").WithColumnName("QtaPend") + // .WithHeaderText("Stock") + // .WithCellCssClassExpression(p => p.QtaPend >= p.QtaMin ? "success text-right" : "danger text-right") + // .WithSortColumnData("QtaPend") + // .WithValueExpression(i => i.QtaPend.ToString()); + // cols.Add("CurrValue").WithColumnName("CurrValue") + // .WithVisibility(false, true) + // .WithHeaderText("€/pz") + // .WithValueExpression(i => i.CurrValue.ToString("C2")); + // cols.Add("TotVal").WithColumnName("TotVal") + // .WithVisibility(false, true) + // .WithHeaderText("Valore") + // .WithValueExpression(i => Convert.ToDecimal(i.CurrValue * i.QtaCurr).ToString("C2")); + // }) + // .WithRetrieveDataMethod((context) => + // { + // var options = context.QueryOptions; + // string FamilyID = options.GetAdditionalQueryOptionString("id"); + // if (String.IsNullOrEmpty(FamilyID)) FamilyID = ""; + + // return new QueryResult() + // { + // Items = ItemsController.SelectFamilyPage(FamilyID, (int)options.PageIndex, (int)options.ItemsPerPage).ToList(), + // TotalRecords = ItemsController.SelectFamilyCount(FamilyID) + // }; + + // }) + // ); } } } \ No newline at end of file diff --git a/StockManMVC/Content/Site.css b/StockManMVC/Content/Site.css index 37d66b4..534c3e5 100644 --- a/StockManMVC/Content/Site.css +++ b/StockManMVC/Content/Site.css @@ -35,6 +35,9 @@ textarea { .colAlt { color: #C93; } +.fontBig { + font-size: 2em; +} /*------------------------------------------------------------------ [ Shortcuts / .shortcuts ] */ diff --git a/StockManMVC/Content/Site.less b/StockManMVC/Content/Site.less index 49730ac..178e003 100644 --- a/StockManMVC/Content/Site.less +++ b/StockManMVC/Content/Site.less @@ -44,6 +44,10 @@ textarea { color: #C93; } +.fontBig{ + font-size:2em; +} + /*------------------------------------------------------------------ [ Shortcuts / .shortcuts ] diff --git a/StockManMVC/Content/Site.min.css b/StockManMVC/Content/Site.min.css index c0008c0..15d8fc5 100644 --- a/StockManMVC/Content/Site.min.css +++ b/StockManMVC/Content/Site.min.css @@ -1 +1 @@ -body{padding-top:50px;padding-bottom:20px;}.body-content{padding-left:15px;padding-right:15px;}.dl-horizontal dt{white-space:normal;}input,select,textarea{max-width:280px;}.deleted{text-decoration:line-through;}.padZL{padding-left:.2em;}.padZR{padding-right:.2em;}.padZRL{padding-left:.2em;padding-right:.2em;}.colAlt{color:#c93;}.shortcuts{text-align:center;}.shortcuts .shortcut{min-width:180px;min-height:100px;display:inline-block;padding:13.33333333px 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:10px;}.shortcuts .shortcut-sm{min-width:90px;min-height:60px;display:inline-block;padding:5px 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:10px;}.shortcuts .shortcut .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:40px;color:#333;}.shortcuts .shortcut-sm .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:40px;color:#333;}.shortcuts .shortcut:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut-sm:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut-sm:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut:hover .shortcut-icon{color:#c93;}.shortcuts .shortcut-sm:hover .shortcut-icon{color:#666;}.shortcuts .shortcut-label{display:block;margin-top:.75em;font-weight:400;color:#666;} \ No newline at end of file +body{padding-top:50px;padding-bottom:20px;}.body-content{padding-left:15px;padding-right:15px;}.dl-horizontal dt{white-space:normal;}input,select,textarea{max-width:280px;}.deleted{text-decoration:line-through;}.padZL{padding-left:.2em;}.padZR{padding-right:.2em;}.padZRL{padding-left:.2em;padding-right:.2em;}.colAlt{color:#c93;}.fontBig{font-size:2em;}.shortcuts{text-align:center;}.shortcuts .shortcut{min-width:180px;min-height:100px;display:inline-block;padding:13.33333333px 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:10px;}.shortcuts .shortcut-sm{min-width:90px;min-height:60px;display:inline-block;padding:5px 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:10px;}.shortcuts .shortcut .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:40px;color:#333;}.shortcuts .shortcut-sm .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:40px;color:#333;}.shortcuts .shortcut:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut-sm:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut-sm:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut:hover .shortcut-icon{color:#c93;}.shortcuts .shortcut-sm:hover .shortcut-icon{color:#666;}.shortcuts .shortcut-label{display:block;margin-top:.75em;font-weight:400;color:#666;} \ No newline at end of file diff --git a/StockManMVC/Controllers/ItemFamiliesController.cs b/StockManMVC/Controllers/ItemFamiliesController.cs index 7443234..90d3055 100644 --- a/StockManMVC/Controllers/ItemFamiliesController.cs +++ b/StockManMVC/Controllers/ItemFamiliesController.cs @@ -21,8 +21,12 @@ namespace StockManMVC.Controllers } // GET: ItemFamilies/Details/5 - public ActionResult Details(string id) + public ActionResult Details(string id, string mode) { + if (mode == null) + { + mode = "full"; + } if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); @@ -32,7 +36,15 @@ namespace StockManMVC.Controllers { return HttpNotFound(); } - return View(itemFamily); + + if (mode == "std") + { + return PartialView(itemFamily); + } + else + { + return View(itemFamily); + } } // GET: ItemFamilies/Create @@ -59,8 +71,13 @@ namespace StockManMVC.Controllers } // GET: ItemFamilies/Edit/5 - public ActionResult Edit(string id) + public ActionResult Edit(string id, string mode) { + + if (mode == null) + { + mode = "full"; + } if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); @@ -70,7 +87,14 @@ namespace StockManMVC.Controllers { return HttpNotFound(); } - return View(itemFamily); + if (mode == "std") + { + return PartialView(itemFamily); + } + else + { + return View(itemFamily); + } } // POST: ItemFamilies/Edit/5 @@ -90,18 +114,30 @@ namespace StockManMVC.Controllers } // GET: ItemFamilies/Delete/5 - public ActionResult Delete(string id) + public ActionResult Delete(string id, string mode) { + if (mode == null) + { + mode = "full"; + } if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } ItemFamily itemFamily = db.ItemFamily.Find(id); + ViewBag.mode = mode; if (itemFamily == null) { return HttpNotFound(); } - return View(itemFamily); + if (mode == "std") + { + return PartialView(itemFamily); + } + else + { + return View(itemFamily); + } } // POST: ItemFamilies/Delete/5 diff --git a/StockManMVC/Controllers/ItemFluxesController.cs b/StockManMVC/Controllers/ItemFluxesController.cs index f6a9efd..5a3e1c7 100644 --- a/StockManMVC/Controllers/ItemFluxesController.cs +++ b/StockManMVC/Controllers/ItemFluxesController.cs @@ -201,7 +201,6 @@ namespace StockManMVC.Controllers ViewBag.LocationID = new SelectList(db.Location.Where(o => o.LocType.IsStock), "ID", "Descr"); ViewBag.MovTypeID = new SelectList(db.MovType, "ID", "Descr", MovTypeID); ViewBag.ItemID = new SelectList(db.Item, "ID", "Descr", ItemID); - ViewBag.OperatorID = new SelectList(db.Operator, "ID", "CodExt"); // in base al tipo di mov richiesto determino cosa mostrare... switch (MovTypeID) { @@ -244,11 +243,13 @@ namespace StockManMVC.Controllers string currOpID = "ND"; // default try { - Operator currOp = (Operator)db.Operator.Where(o => o.CodExt == User.Identity.Name || o.CodExt.Contains(User.Identity.Name) || o.ID == User.Identity.Name); + var trovato = db.Operator.SingleOrDefault(s => s.CodExt == User.Identity.Name || s.CodExt.Contains(User.Identity.Name) || s.ID == User.Identity.Name); + Operator currOp = (Operator)trovato; currOpID = currOp.ID; } - catch - { } + catch(Exception exc) + { + } itemFlux.OperatorID = currOpID; //@User.Identity.Name == cod.ext --> user dominio! // verifico Qta: SE CAR > 0, se SCAR < 0, se MOV / rett libero... diff --git a/StockManMVC/Controllers/ItemsController.cs b/StockManMVC/Controllers/ItemsController.cs index 2a04ea7..8d39e71 100644 --- a/StockManMVC/Controllers/ItemsController.cs +++ b/StockManMVC/Controllers/ItemsController.cs @@ -32,6 +32,17 @@ namespace StockManMVC.Controllers return answ; } /// + /// Selezione + /// + /// + /// + public static IEnumerable SelectFamily(string FamilyID) + { + StockManEntities db = new StockManEntities(); + var answ = db.Item.Where(s => s.ItemFamilyID == FamilyID); + return answ; + } + /// /// Ricerca con selezione parametri /// /// @@ -141,6 +152,43 @@ namespace StockManMVC.Controllers { return Order(SearchVal, OrderBy, Sort).Skip(startRowIndex * maximumRows).Take(maximumRows); } + /// + /// Elenco x famiglia ordine qta desc + /// + /// + /// + /// + /// + public static IEnumerable SelectFamilyPage(string FamilyID, int startRowIndex, int maximumRows) + { + StockManEntities db = new StockManEntities(); + var answ = SelectFamily(FamilyID).OrderByDescending(x => x.QtaPend); + return answ.Skip(startRowIndex * maximumRows).Take(maximumRows); + } + /// + /// Elenco x famiglia ordine qta desc + /// + /// + /// + /// + /// + public ActionResult ListByFamily(string FamilyID) + { + var item = db.Item;//.Include(i => i.ItemFamily); + if (FamilyID == null) FamilyID = ""; + ViewBag.FamilyID = FamilyID; + return PartialView("ListByFamily", item); + } + + /// + /// calcolo num risultati + /// + /// + /// + public static int SelectFamilyCount(string FamilyID) + { + return SelectFamily(FamilyID).Count(); + } // GET: Items/Consolidate/5?caller=callingController public ActionResult Consolidate(int? id, string caller) diff --git a/StockManMVC/Controllers/OperatorsController.cs b/StockManMVC/Controllers/OperatorsController.cs index fb9fdf7..49b2ad8 100644 --- a/StockManMVC/Controllers/OperatorsController.cs +++ b/StockManMVC/Controllers/OperatorsController.cs @@ -34,12 +34,12 @@ namespace StockManMVC.Controllers { SearchVal = "##########"; } - var answ = db.Operator.Where( s => s.CodExt == SearchVal - || s.ID ==SearchVal + var answ = db.Operator.Where(s => s.CodExt == SearchVal + || s.ID == SearchVal ); return answ; } - + // GET: Operators/Details/5 public ActionResult Details(string id) { diff --git a/StockManMVC/Models/ItemFamily.cs b/StockManMVC/Models/ItemFamily.cs index 0eab266..53a698e 100644 --- a/StockManMVC/Models/ItemFamily.cs +++ b/StockManMVC/Models/ItemFamily.cs @@ -22,6 +22,7 @@ namespace StockManMVC.Models public string ID { get; set; } public string Descr { get; set; } + public Nullable NumItems { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection Item { get; set; } diff --git a/StockManMVC/Models/Metadata.cs b/StockManMVC/Models/Metadata.cs index 62f7652..d02c905 100644 --- a/StockManMVC/Models/Metadata.cs +++ b/StockManMVC/Models/Metadata.cs @@ -107,9 +107,15 @@ namespace StockManMVC.Models public class ItemFamilyMetadata { + [Display(Name = "Codice")] + public string ID; + [StringLength(250)] [Display(Name = "Categoria")] public string Descr; + + [Display(Name = "# Articoli")] + public string NumItems; } public class ItemStocksMetadata @@ -139,10 +145,10 @@ namespace StockManMVC.Models [DisplayFormat(DataFormatString = "{0:C2}", ApplyFormatInEditMode = true)] public String TotVal; - [Display(Name = "Tot num Articoli")] + [Display(Name = "Articoli")] public String NumArt; - [Display(Name = "Giacenza (totale)")] + [Display(Name = "Giacenza (qta tot)")] public String TotCurr; [Display(Name = "Mov. aperti")] diff --git a/StockManMVC/Models/SMModel.edmx b/StockManMVC/Models/SMModel.edmx index 52a77e5..02f17ec 100644 --- a/StockManMVC/Models/SMModel.edmx +++ b/StockManMVC/Models/SMModel.edmx @@ -27,6 +27,7 @@ + @@ -516,6 +517,7 @@ warning 6002: The table/view 'StockMan.dbo.vLocationVal' does not have a primary + @@ -745,6 +747,7 @@ warning 6002: The table/view 'StockMan.dbo.vLocationVal' does not have a primary + diff --git a/StockManMVC/StockManMVC.csproj b/StockManMVC/StockManMVC.csproj index 1511ea9..6fba1ec 100644 --- a/StockManMVC/StockManMVC.csproj +++ b/StockManMVC/StockManMVC.csproj @@ -445,6 +445,7 @@ + diff --git a/StockManMVC/Views/ItemFamilies/Delete.cshtml b/StockManMVC/Views/ItemFamilies/Delete.cshtml index e5cd351..2c91a9a 100644 --- a/StockManMVC/Views/ItemFamilies/Delete.cshtml +++ b/StockManMVC/Views/ItemFamilies/Delete.cshtml @@ -4,12 +4,17 @@ ViewBag.Title = "Delete"; } -

Delete

- -

Are you sure you want to delete this?

+@if (ViewBag.mode == "full") +{ +

Delete

+} +

Sicuro di voler eliminare questo record?

-

ItemFamily

-
+ @if (ViewBag.mode == "full") + { +

ItemFamily

+
+ }
@Html.DisplayNameFor(model => model.Descr) @@ -21,12 +26,17 @@
- @using (Html.BeginForm()) { + @using (Html.BeginForm()) + { @Html.AntiForgeryToken() -
- | - @Html.ActionLink("Back to List", "Index") +
+
+ +
+
}
diff --git a/StockManMVC/Views/ItemFamilies/Details.cshtml b/StockManMVC/Views/ItemFamilies/Details.cshtml index 1dae980..c5f5a07 100644 --- a/StockManMVC/Views/ItemFamilies/Details.cshtml +++ b/StockManMVC/Views/ItemFamilies/Details.cshtml @@ -1,26 +1,33 @@ @model StockManMVC.Models.ItemFamily @{ - ViewBag.Title = "Details"; + ViewBag.Title = "Famiglie Articoli"; } - -

Details

- -
-

ItemFamily

+@if (ViewBag.mode == "full") +{ +

Famiglie Articoli


-
-
- @Html.DisplayNameFor(model => model.Descr) -
- -
- @Html.DisplayFor(model => model.Descr) -
- -
+} +
+
+
+
+ @Html.DisplayFor(model => model.Descr) +
+
+ reset +
+
+
+
+ @*@Html.Partial("_MVCGridToolbar", new StockManMVC.Models.MVCGridToolbarModel() + { + MVCGridName = "ItemsByFamGrid", + PageSize = true, + ColumnVisibility = false, + Export = false, + GlobalSearch = false + }) + @Html.MVCGrid("ItemsByFamGrid")*@ +
-

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

diff --git a/StockManMVC/Views/ItemFamilies/Edit.cshtml b/StockManMVC/Views/ItemFamilies/Edit.cshtml index 49404d2..b54ebca 100644 --- a/StockManMVC/Views/ItemFamilies/Edit.cshtml +++ b/StockManMVC/Views/ItemFamilies/Edit.cshtml @@ -3,17 +3,21 @@ @{ ViewBag.Title = "Edit"; } - -

Edit

- +@if (ViewBag.mode == "full") +{ +

Edit

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

ItemFamily

-
+ @if (ViewBag.mode == "full") + { +

ItemFamily

+
+ } @Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.HiddenFor(model => model.ID) @@ -25,18 +29,18 @@
-
-
- +
+
+ +
+
+
} -
- @Html.ActionLink("Back to List", "Index") -
- @section Scripts { @Scripts.Render("~/bundles/jqueryval") } diff --git a/StockManMVC/Views/ItemFamilies/Index.cshtml b/StockManMVC/Views/ItemFamilies/Index.cshtml index 449fb0c..9259444 100644 --- a/StockManMVC/Views/ItemFamilies/Index.cshtml +++ b/StockManMVC/Views/ItemFamilies/Index.cshtml @@ -1,33 +1,104 @@ @model IEnumerable @{ - ViewBag.Title = "Index"; + ViewBag.Title = "Famiglie Articoli"; } -

Index

+
+
+
+
+
+
+ Famiglie Articoli +
+
+ @*@Html.ActionLink("Create New", "Create")*@ + + + Aggiunta Nuova Famiglia + +
+
+
+
+
+
+ @*qui inserisco la partial view...*@ +
+
+
+ + + + + + + + -

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

-
+ + @Html.DisplayNameFor(model => model.ID) + + @Html.DisplayNameFor(model => model.Descr) + + @Html.DisplayNameFor(model => model.NumItems) +
- - - - + @foreach (var item in Model) + { + var delStyle = ""; + if (item.NumItems > 0) { delStyle = "disabled"; } + + + + + + + + } -@foreach (var item in Model) { - - - - -} +
- @Html.DisplayNameFor(model => model.Descr) -
+ + + @Html.DisplayFor(modelItem => item.ID) + + @Html.DisplayFor(modelItem => item.Descr) + + @Html.DisplayFor(modelItem => item.NumItems) + + + +
- @Html.DisplayFor(modelItem => item.Descr) - - @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | - @Html.ActionLink("Details", "Details", new { id=item.ID }) | - @Html.ActionLink("Delete", "Delete", new { id=item.ID }) -
+
+
+
+ @*qui inserisco la partial view...*@ +
+
+
+
+
+
- + \ No newline at end of file diff --git a/StockManMVC/Views/Items/ListByFamily.cshtml b/StockManMVC/Views/Items/ListByFamily.cshtml new file mode 100644 index 0000000..11fe67e --- /dev/null +++ b/StockManMVC/Views/Items/ListByFamily.cshtml @@ -0,0 +1,79 @@ +@model IEnumerable + + + + + + + @* + + + *@ + + @**@ + + @* + *@ + + +@foreach (var item in Model) { + + + + @* + + + *@ + + @**@ + + @* + *@ + +} + +
+ @Html.DisplayNameFor(model => model.Descr) + + @Html.DisplayNameFor(model => model.CodInt) + + @Html.DisplayNameFor(model => model.CodExt) + + @Html.DisplayNameFor(model => model.DescrExt) + + @Html.DisplayNameFor(model => model.QtaMin) + + @Html.DisplayNameFor(model => model.QtaBatch) + + @Html.DisplayNameFor(model => model.CurrValue) + + @Html.DisplayNameFor(model => model.QtaCurr) + + @Html.DisplayNameFor(model => model.QtaPend) + + @Html.DisplayNameFor(model => model.ItemFamily.Descr) +
+ @Html.DisplayFor(modelItem => item.Descr) + + @Html.DisplayFor(modelItem => item.CodInt) + + @Html.DisplayFor(modelItem => item.CodExt) + + @Html.DisplayFor(modelItem => item.DescrExt) + + @Html.DisplayFor(modelItem => item.QtaMin) + + @Html.DisplayFor(modelItem => item.QtaBatch) + + @Html.DisplayFor(modelItem => item.CurrValue) + + @Html.DisplayFor(modelItem => item.QtaCurr) + + @Html.DisplayFor(modelItem => item.QtaPend) + + @Html.DisplayFor(modelItem => item.ItemFamily.Descr) + + @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | + @Html.ActionLink("Details", "Details", new { id=item.ID }) | + @Html.ActionLink("Delete", "Delete", new { id=item.ID }) +
diff --git a/StockManMVC/Views/Shared/_Layout.cshtml b/StockManMVC/Views/Shared/_Layout.cshtml index f111846..e59695e 100644 --- a/StockManMVC/Views/Shared/_Layout.cshtml +++ b/StockManMVC/Views/Shared/_Layout.cshtml @@ -72,9 +72,7 @@ diff --git a/StockManMVC/bin/StockManMVC.dll b/StockManMVC/bin/StockManMVC.dll index 6fee4f9..71b2e50 100644 Binary files a/StockManMVC/bin/StockManMVC.dll and b/StockManMVC/bin/StockManMVC.dll differ