diff --git a/StockManMVC/App_Start/BundleConfig.cs b/StockManMVC/App_Start/BundleConfig.cs index e2bc627..c6005e5 100644 --- a/StockManMVC/App_Start/BundleConfig.cs +++ b/StockManMVC/App_Start/BundleConfig.cs @@ -48,7 +48,7 @@ namespace StockManMVC bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/bootstrap.css", "~/Content/font-awesome.css", - "~/Content/PagedList.css", + //"~/Content/PagedList.css", "~/Content/themes/base/*.css", //"~/Content/jquery.bootgrid.css", "~/Content/site.css")); diff --git a/StockManMVC/Content/Site.css b/StockManMVC/Content/Site.css index b89d449..bd20d84 100644 --- a/StockManMVC/Content/Site.css +++ b/StockManMVC/Content/Site.css @@ -50,6 +50,9 @@ textarea { /*z-index: 0; // commentare quando in prod?!?*/ color: #696969; } +.pagination { + margin: 5px 0; +} /*------------------------------------------------------------------ [ Shortcuts / .shortcuts ] */ diff --git a/StockManMVC/Content/Site.less b/StockManMVC/Content/Site.less index 474a92d..83b0116 100644 --- a/StockManMVC/Content/Site.less +++ b/StockManMVC/Content/Site.less @@ -61,7 +61,10 @@ textarea { /*z-index: 0; // commentare quando in prod?!?*/ color: #696969; } - +.pagination +{ + margin: 5px 0; +} /*------------------------------------------------------------------ [ Shortcuts / .shortcuts ] */ diff --git a/StockManMVC/Content/Site.min.css b/StockManMVC/Content/Site.min.css index c50fa61..a07b0a8 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;}.fontBig{font-size:2em;}.tNote{color:#8a8a8a;font-style:italic;}.tNoWrap{white-space:nowrap;}.navbar{min-height:0;color:#696969;}.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;}.tNote{color:#8a8a8a;font-style:italic;}.tNoWrap{white-space:nowrap;}.navbar{min-height:0;color:#696969;}.pagination{margin:5px 0;}.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/LocationsController.cs b/StockManMVC/Controllers/LocationsController.cs index 052a550..9d6cc53 100644 --- a/StockManMVC/Controllers/LocationsController.cs +++ b/StockManMVC/Controllers/LocationsController.cs @@ -26,7 +26,7 @@ namespace StockManMVC.Controllers if (SearchVal == null) SearchVal = ""; if (SortOrd == null) SortOrd = ""; if (page == null) page = 1; - if (pageSize == null) pageSize = 5; + if (pageSize == null) pageSize = 10; // salvo in model valori ViewBag.LocTypeDD = new SelectList(db.LocType, "ID", "Descr", LocTypeID); ViewBag.LocTypeID = LocTypeID; @@ -46,19 +46,22 @@ namespace StockManMVC.Controllers if (SortOrd == null) SortOrd = ""; //int PageNum = (page ?? 1); if (page == null) page = 1; - if (pageSize == null) pageSize = 5; + if (pageSize == null) pageSize = 10; ViewBag.LocTypeID = LocTypeID; ViewBag.SearchVal = SearchVal; ViewBag.SortOrd = SortOrd; ViewBag.DescrSortParm = String.IsNullOrEmpty(SortOrd) ? "Descr_desc" : ""; ViewBag.LocTypeSortParm = SortOrd == "LocType" ? "LocType_desc" : "LocType"; + // gestione selettore dim pagina + var pageOptions = new[] { "5", "10", "15", "25", "50", "100" }; + ViewBag.PageSizeDD = new SelectList(pageOptions, pageSize.ToString()); var CurrLocations = db.Location.Where(s => s.ID != ""); if (LocTypeID.ToString() != "") { CurrLocations = db.Location.Where(s => s.LocTypeID == LocTypeID); } - if(SearchVal != "") + if (SearchVal != "") { CurrLocations = CurrLocations.Where(s => s.Descr.Contains(SearchVal)); // || s.LocType.Descr.Contains(SearchVal) } diff --git a/StockManMVC/Views/Locations/_ListByType.cshtml b/StockManMVC/Views/Locations/_ListByType.cshtml index 20e872c..eb706a2 100644 --- a/StockManMVC/Views/Locations/_ListByType.cshtml +++ b/StockManMVC/Views/Locations/_ListByType.cshtml @@ -39,13 +39,24 @@