From 10bf242d4f0273a72e06a11babe49b087422b66e Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 18 Jul 2018 18:22:32 +0200 Subject: [PATCH] aggiunta css x typeahead --- MP-TAB/App_Start/BundleConfig.cs | 6 + MP-TAB/Bundle.config | 1 + MP-TAB/Content/typeahead.css | 141 ++++++++++++++ MP-TAB/Content/typeahead.less | 176 ++++++++++++++++++ MP-TAB/Content/typeahead.min.css | 1 + MP-TAB/MP-TAB.csproj | 7 + MP-TAB/Test.aspx | 16 +- MP-TAB/Test.aspx.designer.cs | 9 + MP-TAB/WebUserControls/cmp_newODL.ascx | 17 +- MP-TAB/WebUserControls/cmp_newODL.ascx.cs | 34 +++- .../cmp_newODL.ascx.designer.cs | 9 + MP-TAB/WebUserControls/mod_ODL.ascx.cs | 7 + MP-TAB/compilerconfig.json | 4 + 13 files changed, 420 insertions(+), 8 deletions(-) create mode 100644 MP-TAB/Content/typeahead.css create mode 100644 MP-TAB/Content/typeahead.less create mode 100644 MP-TAB/Content/typeahead.min.css diff --git a/MP-TAB/App_Start/BundleConfig.cs b/MP-TAB/App_Start/BundleConfig.cs index f9a407bc..7437267c 100644 --- a/MP-TAB/App_Start/BundleConfig.cs +++ b/MP-TAB/App_Start/BundleConfig.cs @@ -40,6 +40,12 @@ namespace MoonProTablet bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( "~/Scripts/bootstrap.bundle.js")); + /*--------------------------------------- + * vedere: + * http://twitter.github.io/typeahead.js/ + * http://twitter.github.io/typeahead.js/examples/ + * https://msdn.microsoft.com/en-us/magazine/dn913180.aspx?f=255&MSPPError=-2147217396 + */ bundles.Add(new ScriptBundle("~/bundles/typeahead").Include( "~/Scripts/bloodhound.min.js", "~/Scripts/typeahead.bundle.min.js", diff --git a/MP-TAB/Bundle.config b/MP-TAB/Bundle.config index 959ec209..67efdc10 100644 --- a/MP-TAB/Bundle.config +++ b/MP-TAB/Bundle.config @@ -4,6 +4,7 @@ + diff --git a/MP-TAB/Content/typeahead.css b/MP-TAB/Content/typeahead.css new file mode 100644 index 00000000..236f6711 --- /dev/null +++ b/MP-TAB/Content/typeahead.css @@ -0,0 +1,141 @@ +/* scaffolding */ +/* ----------- */ +html { + overflow-y: scroll; + *overflow-x: hidden; +} +.container { + max-width: 750px; + margin: 0 auto; + text-align: center; +} +.tt-menu, +.gist { + text-align: left; +} +/* base styles */ +/* ----------- */ +html { + font: normal normal normal 18px/1.2 "Helvetica Neue", Roboto, "Segoe UI", Calibri, sans-serif; + color: #292f33; +} +a { + color: #03739c; + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +.table-of-contents li { + display: inline-block; + *display: inline; + zoom: 1; +} +.table-of-contents li a { + font-size: 16px; + color: #999; +} +p + p { + margin: 30px 0 0 0; +} +/* site theme */ +/* ---------- */ +.title { + margin: 20px 0 0 0; + font-size: 64px; +} +.example { + padding: 30px 0; +} +.example-name { + margin: 20px 0; + font-size: 32px; +} +.demo { + position: relative; + *z-index: 1; + margin: 50px 0; +} +.typeahead, +.tt-query, +.tt-hint { + width: 396px; + height: 30px; + padding: 8px 12px; + font-size: 24px; + line-height: 30px; + border: 2px solid #ccc; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + outline: none; +} +.typeahead { + background-color: #fff; +} +.typeahead:focus { + border: 2px solid #0097cf; +} +.tt-query { + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.tt-hint { + color: #999; +} +.tt-menu { + width: 422px; + margin: 12px 0; + padding: 8px 0; + background-color: #fff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); +} +.tt-selectable { + color: #000; +} +.tt-suggestion { + padding: 3px 20px; + font-size: 18px; + line-height: 24px; +} +.tt-suggestion:hover { + cursor: pointer; + color: #fff; + background-color: #0097cf; +} +.tt-suggestion.tt-cursor { + color: #fff; + background-color: #0097cf; +} +.tt-suggestion p { + margin: 0; +} +.gist { + font-size: 14px; +} +/* example specific styles */ +/* ----------------------- */ +#custom-templates .empty-message { + padding: 5px 10px; + text-align: center; +} +#multiple-datasets .league-name { + margin: 0 20px 5px 20px; + padding: 3px 0; + border-bottom: 1px solid #ccc; +} +#scrollable-dropdown-menu .tt-menu { + max-height: 150px; + overflow-y: auto; +} +#rtl-support .tt-menu { + text-align: right; +} \ No newline at end of file diff --git a/MP-TAB/Content/typeahead.less b/MP-TAB/Content/typeahead.less new file mode 100644 index 00000000..9fb3fa38 --- /dev/null +++ b/MP-TAB/Content/typeahead.less @@ -0,0 +1,176 @@ +/* scaffolding */ +/* ----------- */ + +html { + overflow-y: scroll; + *overflow-x: hidden; +} + +.container { + max-width: 750px; + margin: 0 auto; + text-align: center; +} + +.tt-menu, +.gist { + text-align: left; +} + +/* base styles */ +/* ----------- */ + +html { + font: normal normal normal 18px/1.2 "Helvetica Neue", Roboto, "Segoe UI", Calibri, sans-serif; + color: #292f33; +} + + +a { + color: #03739c; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +.table-of-contents li { + display: inline-block; + *display: inline; + zoom: 1; +} + +.table-of-contents li a { + font-size: 16px; + color: #999; +} + +p + p { + margin: 30px 0 0 0; +} + +/* site theme */ +/* ---------- */ + +.title { + margin: 20px 0 0 0; + font-size: 64px; +} + +.example { + padding: 30px 0; +} + +.example-name { + margin: 20px 0; + font-size: 32px; +} + +.demo { + position: relative; + *z-index: 1; + margin: 50px 0; +} + +.typeahead, +.tt-query, +.tt-hint { + width: 396px; + height: 30px; + padding: 8px 12px; + font-size: 24px; + line-height: 30px; + border: 2px solid #ccc; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + outline: none; +} + +.typeahead { + background-color: #fff; +} + +.typeahead:focus { + border: 2px solid #0097cf; +} + +.tt-query { + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.tt-hint { + color: #999 +} + +.tt-menu { + width: 422px; + margin: 12px 0; + padding: 8px 0; + background-color: #fff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2); + -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2); + box-shadow: 0 5px 10px rgba(0,0,0,.2); +} + +.tt-selectable { + color: #000; +} + +.tt-suggestion +{ + padding: 3px 20px; + font-size: 18px; + line-height: 24px; +} + +.tt-suggestion:hover { + cursor: pointer; + color: #fff; + background-color: #0097cf; +} + +.tt-suggestion.tt-cursor { + color: #fff; + background-color: #0097cf; + +} + +.tt-suggestion p { + margin: 0; +} + +.gist { + font-size: 14px; +} + +/* example specific styles */ +/* ----------------------- */ + +#custom-templates .empty-message { + padding: 5px 10px; + text-align: center; +} + +#multiple-datasets .league-name { + margin: 0 20px 5px 20px; + padding: 3px 0; + border-bottom: 1px solid #ccc; +} + +#scrollable-dropdown-menu .tt-menu { + max-height: 150px; + overflow-y: auto; +} + +#rtl-support .tt-menu { + text-align: right; +} diff --git a/MP-TAB/Content/typeahead.min.css b/MP-TAB/Content/typeahead.min.css new file mode 100644 index 00000000..59000cd0 --- /dev/null +++ b/MP-TAB/Content/typeahead.min.css @@ -0,0 +1 @@ +html{overflow-y:scroll;*overflow-x:hidden;}.container{max-width:750px;margin:0 auto;text-align:center;}.tt-menu,.gist{text-align:left;}html{font:normal normal normal 18px/1.2 "Helvetica Neue",Roboto,"Segoe UI",Calibri,sans-serif;color:#292f33;}a{color:#03739c;text-decoration:none;}a:hover{text-decoration:underline;}.table-of-contents li{display:inline-block;*display:inline;zoom:1;}.table-of-contents li a{font-size:16px;color:#999;}p+p{margin:30px 0 0 0;}.title{margin:20px 0 0 0;font-size:64px;}.example{padding:30px 0;}.example-name{margin:20px 0;font-size:32px;}.demo{position:relative;*z-index:1;margin:50px 0;}.typeahead,.tt-query,.tt-hint{width:396px;height:30px;padding:8px 12px;font-size:24px;line-height:30px;border:2px solid #ccc;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;outline:none;}.typeahead{background-color:#fff;}.typeahead:focus{border:2px solid #0097cf;}.tt-query{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);}.tt-hint{color:#999;}.tt-menu{width:422px;margin:12px 0;padding:8px 0;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);}.tt-selectable{color:#000;}.tt-suggestion{padding:3px 20px;font-size:18px;line-height:24px;}.tt-suggestion:hover{cursor:pointer;color:#fff;background-color:#0097cf;}.tt-suggestion.tt-cursor{color:#fff;background-color:#0097cf;}.tt-suggestion p{margin:0;}.gist{font-size:14px;}#custom-templates .empty-message{padding:5px 10px;text-align:center;}#multiple-datasets .league-name{margin:0 20px 5px 20px;padding:3px 0;border-bottom:1px solid #ccc;}#scrollable-dropdown-menu .tt-menu{max-height:150px;overflow-y:auto;}#rtl-support .tt-menu{text-align:right;} \ No newline at end of file diff --git a/MP-TAB/MP-TAB.csproj b/MP-TAB/MP-TAB.csproj index 095af563..e412ae97 100644 --- a/MP-TAB/MP-TAB.csproj +++ b/MP-TAB/MP-TAB.csproj @@ -228,6 +228,13 @@ + + + typeahead.less + + + typeahead.css + diff --git a/MP-TAB/Test.aspx b/MP-TAB/Test.aspx index 7646afe3..7fb3ce34 100644 --- a/MP-TAB/Test.aspx +++ b/MP-TAB/Test.aspx @@ -14,9 +14,10 @@ Prova typeahead
+
+ + + diff --git a/MP-TAB/Test.aspx.designer.cs b/MP-TAB/Test.aspx.designer.cs index cc702a95..7c05a269 100644 --- a/MP-TAB/Test.aspx.designer.cs +++ b/MP-TAB/Test.aspx.designer.cs @@ -11,5 +11,14 @@ namespace MoonProTablet { public partial class Test { + + /// + /// Controllo hfCustomerId. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox hfCustomerId; } } diff --git a/MP-TAB/WebUserControls/cmp_newODL.ascx b/MP-TAB/WebUserControls/cmp_newODL.ascx index 35dc3350..52507fb3 100644 --- a/MP-TAB/WebUserControls/cmp_newODL.ascx +++ b/MP-TAB/WebUserControls/cmp_newODL.ascx @@ -4,12 +4,21 @@
- Articolo + Articolo (ricerca + selezione)
- - +
+
+ +
+ + + + + + +
diff --git a/MP-TAB/WebUserControls/cmp_newODL.ascx.cs b/MP-TAB/WebUserControls/cmp_newODL.ascx.cs index 77285112..1bdfc81b 100644 --- a/MP-TAB/WebUserControls/cmp_newODL.ascx.cs +++ b/MP-TAB/WebUserControls/cmp_newODL.ascx.cs @@ -9,14 +9,46 @@ namespace MoonProTablet.WebUserControls { public partial class cmp_newODL : System.Web.UI.UserControl { + + /// + /// registrato nuovo valore + /// + public event EventHandler eh_newVal; protected void Page_Load(object sender, EventArgs e) { - + if (!Page.IsPostBack) + { + setDefaults(); + } + } + /// + /// imposta valori std + /// + private void setDefaults() + { + txtNumPz.Text = "1"; + txtTC_min.Text = "1"; + txtTC_sec.Text = "0"; } protected void lbtCreaOdlProvv_Click(object sender, EventArgs e) { // effettua creazione ODL provvisorio e riporta a parent... + + + // invio email notifica creazione ODL PROVVISORIO (da riconciliare...) + + + // sollevo evento! + if (eh_newVal != null) + { + eh_newVal(this, new EventArgs()); + } + } + + protected void txtSearch_TextChanged(object sender, EventArgs e) + { + ddlArticolo.DataBind(); } } } \ No newline at end of file diff --git a/MP-TAB/WebUserControls/cmp_newODL.ascx.designer.cs b/MP-TAB/WebUserControls/cmp_newODL.ascx.designer.cs index f7439598..d2909a15 100644 --- a/MP-TAB/WebUserControls/cmp_newODL.ascx.designer.cs +++ b/MP-TAB/WebUserControls/cmp_newODL.ascx.designer.cs @@ -21,6 +21,15 @@ namespace MoonProTablet.WebUserControls { /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl divDetail; + /// + /// Controllo txtSearch. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox txtSearch; + /// /// Controllo ddlArticolo. /// diff --git a/MP-TAB/WebUserControls/mod_ODL.ascx.cs b/MP-TAB/WebUserControls/mod_ODL.ascx.cs index 6ad2c82d..d40fb55a 100644 --- a/MP-TAB/WebUserControls/mod_ODL.ascx.cs +++ b/MP-TAB/WebUserControls/mod_ODL.ascx.cs @@ -110,6 +110,13 @@ namespace MoonProTablet.WebUserControls { checkAll(); } + cmp_newODL.eh_newVal += Cmp_newODL_eh_newVal; + } + + private void Cmp_newODL_eh_newVal(object sender, EventArgs e) + { + // creato nuovo ODL, faccio refresh ricaricando pagina! + Response.Redirect("~/ODL"); } public void checkAll() diff --git a/MP-TAB/compilerconfig.json b/MP-TAB/compilerconfig.json index 0cc92ca9..900e75af 100644 --- a/MP-TAB/compilerconfig.json +++ b/MP-TAB/compilerconfig.json @@ -30,5 +30,9 @@ { "outputFile": "Content/flashing.css", "inputFile": "Content/flashing.less" + }, + { + "outputFile": "Content/typeahead.css", + "inputFile": "Content/typeahead.less" } ] \ No newline at end of file