From 2a8c1ad7c945cfc377ccee2e21864ddaa40acfc2 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 3 Feb 2020 19:06:19 +0100 Subject: [PATCH] Update x export excel dettaglio BUNK --- Jenkinsfile | 2 +- NKC_SDK/Objects.cs | 6 +- NKC_WF/Controllers/BunkController.cs | 10 ++- NKC_WF/NKC_WF.csproj | 8 ++ NKC_WF/Web.config | 1 + NKC_WF/WebUserControls/cmp_BP_bunkList.ascx | 6 +- .../WebUserControls/cmp_stackLoading.ascx.cs | 1 + NKC_WF/export/BunkDetail.aspx | 48 +++++++++++ NKC_WF/export/BunkDetail.aspx.cs | 85 +++++++++++++++++++ NKC_WF/export/BunkDetail.aspx.designer.cs | 53 ++++++++++++ NKC_WF/site/BatchPreview.aspx | 8 +- NKC_WF/site/BatchPreview.aspx.designer.cs | 9 -- 12 files changed, 217 insertions(+), 20 deletions(-) create mode 100644 NKC_WF/export/BunkDetail.aspx create mode 100644 NKC_WF/export/BunkDetail.aspx.cs create mode 100644 NKC_WF/export/BunkDetail.aspx.designer.cs diff --git a/Jenkinsfile b/Jenkinsfile index d4e809c..7d3ca04 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=249']) { + withEnv(['NEXT_BUILD_NUMBER=251']) { // env.versionNumber = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.versionNumberBeta = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') diff --git a/NKC_SDK/Objects.cs b/NKC_SDK/Objects.cs index 321f72a..4039584 100644 --- a/NKC_SDK/Objects.cs +++ b/NKC_SDK/Objects.cs @@ -484,10 +484,14 @@ namespace NKC_SDK public string MaterialDescription { get; set; } } /// - /// Dati delal lavorazione + /// Dati della lavorazione /// public class WorkData { + /// + /// Indica che la lavorazione è stata eseguita con successo (default = true) + /// + public bool Success { get; set; } /// /// Percorso del programma da eseguire /// diff --git a/NKC_WF/Controllers/BunkController.cs b/NKC_WF/Controllers/BunkController.cs index f22ec72..b1aeb15 100644 --- a/NKC_WF/Controllers/BunkController.cs +++ b/NKC_WF/Controllers/BunkController.cs @@ -90,10 +90,14 @@ namespace NKC_WF.Controllers foreach (var item in currBunk.SheetList) { DataLayer.man.taSHL.updateDate(item.SheetId, item.Printing.DtStart, item.Printing.DtEnd, item.Machining.DtStart, item.Machining.DtEnd, item.Unloading.DtStart, item.Unloading.DtEnd); - // SE machining completato --> status a LAVORATO! - if (item.Machining.DtEnd != null) + // verifico SE SIA AVVENUTO CON SUCCESSO lo step di lavorazione... + if (item.Machining.Success) { - DataLayer.man.taIL.updateSheetStatus(item.SheetId, 1, "PROD"); + // SE machining completato --> status a LAVORATO! + if (item.Machining.DtEnd != null) + { + DataLayer.man.taIL.updateSheetStatus(item.SheetId, 1, "PROD"); + } } } } diff --git a/NKC_WF/NKC_WF.csproj b/NKC_WF/NKC_WF.csproj index 54d42ac..116c516 100644 --- a/NKC_WF/NKC_WF.csproj +++ b/NKC_WF/NKC_WF.csproj @@ -255,6 +255,7 @@ + @@ -524,6 +525,13 @@ Oops.aspx + + BunkDetail.aspx + ASPXCodeBehind + + + BunkDetail.aspx + Home.aspx ASPXCodeBehind diff --git a/NKC_WF/Web.config b/NKC_WF/Web.config index 5584372..d672064 100644 --- a/NKC_WF/Web.config +++ b/NKC_WF/Web.config @@ -67,6 +67,7 @@ + diff --git a/NKC_WF/WebUserControls/cmp_BP_bunkList.ascx b/NKC_WF/WebUserControls/cmp_BP_bunkList.ascx index fc7c144..87d8da5 100644 --- a/NKC_WF/WebUserControls/cmp_BP_bunkList.ascx +++ b/NKC_WF/WebUserControls/cmp_BP_bunkList.ascx @@ -34,8 +34,12 @@ + + + + + - diff --git a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs index cafddeb..9052931 100644 --- a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs @@ -208,6 +208,7 @@ namespace NKC_WF.WebUserControls DataLayer.man.taSHL.advanceInStack(stackIdCurr); } doUpdate(); + raiseEvent(); } } diff --git a/NKC_WF/export/BunkDetail.aspx b/NKC_WF/export/BunkDetail.aspx new file mode 100644 index 0000000..064aa10 --- /dev/null +++ b/NKC_WF/export/BunkDetail.aspx @@ -0,0 +1,48 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BunkDetail.aspx.cs" Inherits="NKC_WF.export.BunkDetail" %> + + + + + + + + + +
+
+ + + + No Record + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + diff --git a/NKC_WF/export/BunkDetail.aspx.cs b/NKC_WF/export/BunkDetail.aspx.cs new file mode 100644 index 0000000..55087f6 --- /dev/null +++ b/NKC_WF/export/BunkDetail.aspx.cs @@ -0,0 +1,85 @@ +using SteamWare; +using System; +using System.Web; +using System.Web.UI; + +namespace NKC_WF.export +{ + public partial class BunkDetail : System.Web.UI.Page + { + + public override void VerifyRenderingInServerForm(Control control) + { + // Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time. + } + + protected string BunkID + { + get + { + string answ = "0"; + answ = memLayer.ML.QSS("BunkID"); + return answ; + } + } + + private void doExport() + { + Response.Clear(); + string content = $"attachment; filename=Bunk_{BunkID}.xls"; + Response.AddHeader("content-disposition",content); + Response.Charset = ""; + // If you want the option to open the Excel file without saving than + // comment out the line below + Response.Cache.SetCacheability(HttpCacheability.NoCache); + Response.ContentType = "application/vnd.xls"; + System.IO.StringWriter stringWrite = new System.IO.StringWriter(); + System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); + grView.RenderControl(htmlWrite); + Response.Write(stringWrite.ToString()); + Response.End(); + + } + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + aggiornamento(); + doExport(); + } + } + public void aggiornamento() + { + hfStackID.Value = BunkID; + grView.AllowPaging = false; + ods.DataBind(); + } + /// + /// Formatta in min/sec il tempo in sec decimale + /// + /// + /// + public string formatMinSec(object _timeSec) + { + int totSec = 0; + string answ = ""; + int.TryParse(_timeSec.ToString().Replace(".", ""), out totSec); + int numMin = totSec / 60; + int numSec = totSec - (60 * numMin); + answ = $"00:{numMin:00}:{numSec:00}"; + return answ; + } + /// + /// Restitusice path bnonificato + /// + /// + /// + public string fixFilePath(object _rawPath) + { + string answ = _rawPath.ToString().ToLower(); + string fileBasePath = memLayer.ML.CRS("fileBasePath").ToLower(); + answ = answ.Replace(fileBasePath, "").Replace("svg", "SVG").Replace("cnc", "CNC"); + return answ; + } + } +} \ No newline at end of file diff --git a/NKC_WF/export/BunkDetail.aspx.designer.cs b/NKC_WF/export/BunkDetail.aspx.designer.cs new file mode 100644 index 0000000..940455f --- /dev/null +++ b/NKC_WF/export/BunkDetail.aspx.designer.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// 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.export +{ + + + public partial class BunkDetail + { + + /// + /// Controllo form1. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// Controllo hfStackID. + /// + /// + /// 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 hfStackID; + + /// + /// Controllo grView. + /// + /// + /// 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.GridView grView; + + /// + /// 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/site/BatchPreview.aspx b/NKC_WF/site/BatchPreview.aspx index b946c22..6d80774 100644 --- a/NKC_WF/site/BatchPreview.aspx +++ b/NKC_WF/site/BatchPreview.aspx @@ -9,18 +9,16 @@
-
+
-
+

Batch preview

- - - +
diff --git a/NKC_WF/site/BatchPreview.aspx.designer.cs b/NKC_WF/site/BatchPreview.aspx.designer.cs index ec2624c..e6fdb58 100644 --- a/NKC_WF/site/BatchPreview.aspx.designer.cs +++ b/NKC_WF/site/BatchPreview.aspx.designer.cs @@ -50,15 +50,6 @@ namespace NKC_WF.site /// protected global::NKC_WF.WebUserControls.cmp_MU_svgViewer cmp_MU_svgViewer; - /// - /// Controllo pnlSheets. - /// - /// - /// 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.Panel pnlSheets; - /// /// Controllo cmp_BP_sheetList. ///