diff --git a/NKC_WF/NKC_WF.csproj b/NKC_WF/NKC_WF.csproj index efde2b9..3bb111a 100644 --- a/NKC_WF/NKC_WF.csproj +++ b/NKC_WF/NKC_WF.csproj @@ -400,6 +400,7 @@ + @@ -923,6 +924,13 @@ cmp_homeButtons.ascx + + cmp_ItemDet.ascx + ASPXCodeBehind + + + cmp_ItemDet.ascx + cmp_kitImpCheck.ascx ASPXCodeBehind diff --git a/NKC_WF/WebUserControls/cmp_ItemDet.ascx b/NKC_WF/WebUserControls/cmp_ItemDet.ascx new file mode 100644 index 0000000..d225c65 --- /dev/null +++ b/NKC_WF/WebUserControls/cmp_ItemDet.ascx @@ -0,0 +1,27 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_ItemDet.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_ItemDet" %> + + + + + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ + + + + diff --git a/NKC_WF/WebUserControls/cmp_ItemDet.ascx.cs b/NKC_WF/WebUserControls/cmp_ItemDet.ascx.cs new file mode 100644 index 0000000..d44611f --- /dev/null +++ b/NKC_WF/WebUserControls/cmp_ItemDet.ascx.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace NKC_WF.WebUserControls +{ + public partial class cmp_ItemDet : BaseUserControl + { + protected void Page_Load(object sender, EventArgs e) + { + + } + public int ItemId + { + get + { + int answ = 0; + int.TryParse(hfItemId.Value, out answ); + return answ; + } + set + { + hfItemId.Value = value.ToString(); + frmView.DataBind(); + } + } + } +} \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_ItemDet.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_ItemDet.ascx.designer.cs new file mode 100644 index 0000000..6abacaa --- /dev/null +++ b/NKC_WF/WebUserControls/cmp_ItemDet.ascx.designer.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// +// Codice generato da uno strumento. +// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// +//------------------------------------------------------------------------------ + +namespace NKC_WF.WebUserControls +{ + + + public partial class cmp_ItemDet + { + + /// + /// Controllo hfItemId. + /// + /// + /// 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.HiddenField hfItemId; + + /// + /// Controllo frmView. + /// + /// + /// 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.FormView frmView; + + /// + /// Controllo ods. + /// + /// + /// 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.ObjectDataSource ods; + } +} diff --git a/NKC_WF/WebUserControls/cmp_secScreen.ascx b/NKC_WF/WebUserControls/cmp_secScreen.ascx index a01cbef..f71d33c 100644 --- a/NKC_WF/WebUserControls/cmp_secScreen.ascx +++ b/NKC_WF/WebUserControls/cmp_secScreen.ascx @@ -1,4 +1,6 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_secScreen.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_secScreen" %> +<%@ Register Src="~/WebUserControls/cmp_ItemDet.ascx" TagPrefix="uc1" TagName="cmp_ItemDet" %> + @@ -6,6 +8,10 @@ + + + +
@@ -13,9 +19,10 @@
<%: traduci("ShowCurrSheet") %>
-

<%: traduci("SecScreen") %> - - <%: hfNum.Value %>

+

<%: traduci("SecScreen") %> + (<%: hfNum.Value %>)

+
@@ -26,7 +33,7 @@
- +
<%--
diff --git a/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs b/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs index b317fab..2ef445d 100644 --- a/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_secScreen.ascx.cs @@ -14,6 +14,11 @@ namespace NKC_WF.WebUserControls { public partial class cmp_secScreen : BaseUserControl { + + protected void timerRefresh_Tick(object sender, EventArgs e) + { + doUpdate(); + } protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) @@ -21,8 +26,9 @@ namespace NKC_WF.WebUserControls // recupero numero currNum = ComLib.getSecScreenCode(); doUpdate(); - pdfPath = "../temp/none.pdf"; + //pdfPath = "../temp/none.pdf"; SheetId = 999999999; + itemDtmx = "IT00014788"; } } @@ -53,6 +59,36 @@ namespace NKC_WF.WebUserControls hlShowCurrSheet.NavigateUrl = $"~/site/SvgFull?sheetId={value}"; } } + public string itemDtmx + { + get + { + return hfItemDtmx.Value; + } + set + { + hfItemDtmx.Value = value; + // cerco e salvo! + var tabItem = DataLayer.man.taIL.getBySearch(0, value, 0, 9999); + if (tabItem != null && tabItem.Count > 0) + { + int ItemId = tabItem[0].ItemID; + itemCode = tabItem[0].ItemExtCode; + pdfPath = tabItem[0].PdfFilePath; + } + } + } + public string itemCode + { + get + { + return hfItemCode.Value; + } + set + { + hfItemCode.Value = value; + } + } public string pdfPath { get @@ -61,11 +97,30 @@ namespace NKC_WF.WebUserControls } set { + string nameOnly = $"~/temp/{itemCode}.pdf"; // FIXME TODO necessario copiare in locale il pdf? - lblPdf.Text = value.Trim(); - hlPdfOpener.NavigateUrl = value.Trim(); + lblPdf.Text = nameOnly; + // svuoto files vecchi... + removeOldTemp(); + // copio in locale file... + File.Copy(value.Trim(), nameOnly); + // update... + hlPdfOpener.NavigateUrl = nameOnly; } } + + private void removeOldTemp() + { + var fileList = fileMover.obj.elencoFilesDir(Server.MapPath("~/temp")); + foreach (var item in fileList) + { + if (item.dataMod < DateTime.Now.AddHours(-1)) + { + fileMover.deleteFile(Server.MapPath($"~/temp/{item.Nome}")); + } + } + } + protected string codSSC { get @@ -92,14 +147,20 @@ namespace NKC_WF.WebUserControls { // valutato ma non usato pdf.js: // https://mozilla.github.io/pdf.js/examples/index.html#interactive-examples - string newPath = ComLib.getSecScreenRequest(codSSC); - pdfPath = string.IsNullOrEmpty(newPath) ? "../temp/none.pdf" : newPath; + string newDtmx = ComLib.getSecScreenRequest(codSSC); + // se è variato da current... + if (newDtmx != itemDtmx) + { + itemDtmx = newDtmx; + } + } + + public void refreshCodPost() + { // genero nuovo QR string qrUrl = getImageUrl(); imgQrMain.ImageUrl = qrUrl; } - - } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_secScreen.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_secScreen.ascx.designer.cs index b999108..3e55820 100644 --- a/NKC_WF/WebUserControls/cmp_secScreen.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_secScreen.ascx.designer.cs @@ -41,6 +41,42 @@ namespace NKC_WF.WebUserControls /// protected global::System.Web.UI.WebControls.HiddenField hfSheetId; + /// + /// Controllo hfItemPdf. + /// + /// + /// 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.HiddenField hfItemPdf; + + /// + /// Controllo hfItemDtmx. + /// + /// + /// 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.HiddenField hfItemDtmx; + + /// + /// Controllo hfItemCode. + /// + /// + /// 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.HiddenField hfItemCode; + + /// + /// Controllo timerRefresh. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.Timer timerRefresh; + /// /// Controllo hlShowCurrSheet. /// @@ -68,6 +104,15 @@ namespace NKC_WF.WebUserControls /// protected global::System.Web.UI.WebControls.Label lblPdf; + /// + /// Controllo cmp_ItemDet. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::NKC_WF.WebUserControls.cmp_ItemDet cmp_ItemDet; + /// /// Controllo hlPdfOpener. /// diff --git a/NKC_WF/site/SecondScreen.aspx b/NKC_WF/site/SecondScreen.aspx index 3daaab0..53bc917 100644 --- a/NKC_WF/site/SecondScreen.aspx +++ b/NKC_WF/site/SecondScreen.aspx @@ -4,7 +4,7 @@ - + diff --git a/NKC_WF/site/SecondScreen.aspx.cs b/NKC_WF/site/SecondScreen.aspx.cs index 18fa833..69bd320 100644 --- a/NKC_WF/site/SecondScreen.aspx.cs +++ b/NKC_WF/site/SecondScreen.aspx.cs @@ -15,7 +15,8 @@ namespace NKC_WF protected void timerSecScreen_Tick(object sender, EventArgs e) { - cmp_secScreen.doUpdate(); + cmp_secScreen.refreshCodPost(); } + } } \ No newline at end of file