From ba8aac50f8d0964fd8400ca99288ab1728ced1ee Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 23 Dec 2019 15:02:45 +0100 Subject: [PATCH] Fix upload e check dxf preliminare --- AppData/DS_App.Designer.cs | 109 +++++++++++++++++++--- AppData/DS_App.xsd | 78 +++++++++------- Jenkinsfile | 2 +- NKC_WF/OrderManager.aspx.cs | 60 ++++++++---- NKC_WF/WebUserControls/cmp_batchList.ascx | 3 +- 5 files changed, 188 insertions(+), 64 deletions(-) diff --git a/AppData/DS_App.Designer.cs b/AppData/DS_App.Designer.cs index 05fe969..219e1fe 100644 --- a/AppData/DS_App.Designer.cs +++ b/AppData/DS_App.Designer.cs @@ -1015,6 +1015,8 @@ namespace AppData { private global::System.Data.DataColumn columnEnvNum; + private global::System.Data.DataColumn columnNumErrPre; + private global::System.Data.DataColumn columnNumErr; private global::System.Data.DataColumn columnNumOrders; @@ -1146,6 +1148,14 @@ namespace AppData { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn NumErrPreColumn { + get { + return this.columnNumErrPre; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public global::System.Data.DataColumn NumErrColumn { @@ -1223,7 +1233,23 @@ namespace AppData { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public BatchListRow AddBatchListRow(string Takt, System.DateTime DueDate, System.DateTime NestingReq, System.DateTime NestingResp, int STATUS, int Position, decimal TotalTime, System.DateTime ApprovDate, string ApprovUser, string EnvNum, int NumErr, int NumOrders, int NumItems, int NumStacks, int NumSheets) { + public BatchListRow AddBatchListRow( + string Takt, + System.DateTime DueDate, + System.DateTime NestingReq, + System.DateTime NestingResp, + int STATUS, + int Position, + decimal TotalTime, + System.DateTime ApprovDate, + string ApprovUser, + string EnvNum, + int NumErrPre, + int NumErr, + int NumOrders, + int NumItems, + int NumStacks, + int NumSheets) { BatchListRow rowBatchListRow = ((BatchListRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, @@ -1237,6 +1263,7 @@ namespace AppData { ApprovDate, ApprovUser, EnvNum, + NumErrPre, NumErr, NumOrders, NumItems, @@ -1282,6 +1309,7 @@ namespace AppData { this.columnApprovDate = base.Columns["ApprovDate"]; this.columnApprovUser = base.Columns["ApprovUser"]; this.columnEnvNum = base.Columns["EnvNum"]; + this.columnNumErrPre = base.Columns["NumErrPre"]; this.columnNumErr = base.Columns["NumErr"]; this.columnNumOrders = base.Columns["NumOrders"]; this.columnNumItems = base.Columns["NumItems"]; @@ -1314,6 +1342,8 @@ namespace AppData { base.Columns.Add(this.columnApprovUser); this.columnEnvNum = new global::System.Data.DataColumn("EnvNum", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnEnvNum); + this.columnNumErrPre = new global::System.Data.DataColumn("NumErrPre", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnNumErrPre); this.columnNumErr = new global::System.Data.DataColumn("NumErr", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnNumErr); this.columnNumOrders = new global::System.Data.DataColumn("NumOrders", typeof(int), null, global::System.Data.MappingType.Element); @@ -1342,6 +1372,7 @@ namespace AppData { this.columnApprovUser.MaxLength = 50; this.columnEnvNum.AllowDBNull = false; this.columnEnvNum.MaxLength = 50; + this.columnNumErrPre.ReadOnly = true; this.columnNumErr.ReadOnly = true; this.columnNumOrders.ReadOnly = true; this.columnNumItems.ReadOnly = true; @@ -7985,6 +8016,22 @@ namespace AppData { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public int NumErrPre { + get { + try { + return ((int)(this[this.tableBatchList.NumErrPreColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("Il valore della colonna \'NumErrPre\' nella tabella \'BatchList\' è DBNull.", e); + } + } + set { + this[this.tableBatchList.NumErrPreColumn] = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public int NumErr { @@ -8101,6 +8148,18 @@ namespace AppData { this[this.tableBatchList.ApprovDateColumn] = global::System.Convert.DBNull; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public bool IsNumErrPreNull() { + return this.IsNull(this.tableBatchList.NumErrPreColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public void SetNumErrPreNull() { + this[this.tableBatchList.NumErrPreColumn] = global::System.Convert.DBNull; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public bool IsNumErrNull() { @@ -11352,6 +11411,7 @@ namespace AppData.DS_AppTableAdapters { tableMapping.ColumnMappings.Add("ApprovDate", "ApprovDate"); tableMapping.ColumnMappings.Add("ApprovUser", "ApprovUser"); tableMapping.ColumnMappings.Add("EnvNum", "EnvNum"); + tableMapping.ColumnMappings.Add("NumErrPre", "NumErrPre"); tableMapping.ColumnMappings.Add("NumErr", "NumErr"); tableMapping.ColumnMappings.Add("NumOrders", "NumOrders"); tableMapping.ColumnMappings.Add("NumItems", "NumItems"); @@ -11370,10 +11430,10 @@ namespace AppData.DS_AppTableAdapters { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[8]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[9]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; - this._commandCollection[0].CommandText = "SELECT *\r\nFROM v_BatchList"; + this._commandCollection[0].CommandText = "SELECT * FROM v_BatchList"; this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[1].Connection = this.Connection; @@ -11402,24 +11462,30 @@ namespace AppData.DS_AppTableAdapters { this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Status", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[5].Connection = this.Connection; - this._commandCollection[5].CommandText = "dbo.stp_Batch_getNextAvailable"; + this._commandCollection[5].CommandText = "dbo.stp_Batch_getLastByTakt"; this._commandCollection[5].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Takt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[6].Connection = this.Connection; - this._commandCollection[6].CommandText = "dbo.stp_Batch_resetNesting"; + this._commandCollection[6].CommandText = "dbo.stp_Batch_getNextAvailable"; this._commandCollection[6].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[7] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[7].Connection = this.Connection; - this._commandCollection[7].CommandText = "dbo.stp_Batch_updateStatus"; + this._commandCollection[7].CommandText = "dbo.stp_Batch_resetNesting"; this._commandCollection[7].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Status", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EnvNum", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TotalTime", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 6, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[8].Connection = this.Connection; + this._commandCollection[8].CommandText = "dbo.stp_Batch_updateStatus"; + this._commandCollection[8].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Status", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EnvNum", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TotalTime", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 6, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -11501,8 +11567,25 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_App.BatchListDataTable getNextAvailable() { + public virtual DS_App.BatchListDataTable getLastByTakt(string Takt) { this.Adapter.SelectCommand = this.CommandCollection[5]; + if ((Takt == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(Takt)); + } + DS_App.BatchListDataTable dataTable = new DS_App.BatchListDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_App.BatchListDataTable getNextAvailable() { + this.Adapter.SelectCommand = this.CommandCollection[6]; DS_App.BatchListDataTable dataTable = new DS_App.BatchListDataTable(); this.Adapter.Fill(dataTable); return dataTable; @@ -11546,7 +11629,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int resetNesting(global::System.Nullable BatchID) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; if ((BatchID.HasValue == true)) { command.Parameters[1].Value = ((int)(BatchID.Value)); } @@ -11574,7 +11657,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateStatus(global::System.Nullable BatchID, global::System.Nullable Status, string EnvNum, global::System.Nullable TotalTime) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[8]; if ((BatchID.HasValue == true)) { command.Parameters[1].Value = ((int)(BatchID.Value)); } diff --git a/AppData/DS_App.xsd b/AppData/DS_App.xsd index 9de5c2b..9485971 100644 --- a/AppData/DS_App.xsd +++ b/AppData/DS_App.xsd @@ -12,8 +12,7 @@ - SELECT * -FROM v_BatchList + SELECT * FROM v_BatchList @@ -31,6 +30,7 @@ FROM v_BatchList + @@ -83,6 +83,17 @@ FROM v_BatchList + + + + dbo.stp_Batch_getLastByTakt + + + + + + + @@ -1823,7 +1834,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -1855,6 +1866,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( + @@ -1863,7 +1875,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -1885,7 +1897,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -1940,7 +1952,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2013,7 +2025,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2021,7 +2033,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2090,7 +2102,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2123,7 +2135,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2146,7 +2158,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2162,7 +2174,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2186,7 +2198,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2194,7 +2206,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2211,7 +2223,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2220,7 +2232,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2251,7 +2263,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2259,7 +2271,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2275,7 +2287,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2283,7 +2295,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2311,7 +2323,7 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - + @@ -2431,18 +2443,18 @@ SELECT ErrID, DtRif, ErrType, ParentUid, Uid, Description FROM ErrorsLog WHERE ( - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index ac6e39b..65640bc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=135']) { + withEnv(['NEXT_BUILD_NUMBER=136']) { // env.versionNumber = VersionNumber(versionNumberString : '0.7.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '0.7.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'NKC' diff --git a/NKC_WF/OrderManager.aspx.cs b/NKC_WF/OrderManager.aspx.cs index 22cb302..7737228 100644 --- a/NKC_WF/OrderManager.aspx.cs +++ b/NKC_WF/OrderManager.aspx.cs @@ -1,6 +1,7 @@ using AppData; using SteamWare; using System; +using System.Collections.Generic; using System.Web.UI; namespace NKC_WF @@ -42,10 +43,11 @@ namespace NKC_WF private void Cmp_fileUpload_eh_FileUploaded(object sender, WebUserContols.FileUploadEventArgs e) { bool dataValidated = true; - DateTime adesso = DateTime.Now; + DateTime adesso = DateTime.Now; string dirFrom = e.LocalPath; string dirTo = $"{_SqlCopyDir}{adesso.ToString("yyyy-MM")}\\"; string dirImport = $"{_SqlImportDir}{adesso.ToString("yyyy-MM")}\\"; + int batchID = 0; // copio su server SQL try { @@ -71,30 +73,43 @@ namespace NKC_WF DataLayer.man.taEL.insertQuery(DateTime.Now, "Upload CSV", $"{e.BatchName}", $"{e.BatchName}.{e.FileName}", $"Exception: {exc}"); dataValidated = false; } - if (dataValidated) + // recupero da batch la riga impostata... + try { - dataValidated = doValidations(e.BatchName); + var tabBatch = DataLayer.man.taBL.getLastByTakt(e.BatchName); + if (tabBatch != null) + { + if (tabBatch.Count > 0) + { + batchID = tabBatch[0].BatchID; + } + } + } + catch (Exception exc) + { + logger.lg.scriviLog($"Eccezione in verifica file:{Environment.NewLine}{exc}"); + dataValidated = false; + } + if (dataValidated && batchID > 0) + { + dataValidated = doValidations(batchID); } if (!dataValidated) { var newBatch = tabDati[0]; - // vado ad inserire status NON valido - int batchId = 0; - int.TryParse(e.BatchName, out batchId); int bStatus = 7; - DataLayer.man.taBL.updateStatus(batchId, bStatus, e.BatchName, -1); + DataLayer.man.taBL.updateStatus(batchID, bStatus, e.BatchName, -1); } doUpdate(); } /// /// Effettua validazione dati /// - private bool doValidations(string batchName) + private bool doValidations(int batchID) { bool allOk = true; + List missingDxfList = new List(); // faccio un ciclo su OGNI record Part --> cerco se mancassero dei file dxf... - int batchID = 0; - int.TryParse(batchName, out batchID); try { var tabParts = DataLayer.man.taIL.getByBatch(batchID); @@ -104,13 +119,26 @@ namespace NKC_WF string localPath = ""; foreach (var item in tabParts) { - // cerco file! sostituisco cadBaseBath --> srvCadBaseBath - localPath = item.CadFilePath.Replace(cadBaseBath, srvCadBaseBath); - fileOk = fileMover.obj.fileExist(localPath); - if (!fileOk) + // verifico SE già processato... + if (!missingDxfList.Contains(item.ItemExtCode)) { - DataLayer.man.taEL.insertQuery(DateTime.Now, "I.1", $"{batchName}", $"{localPath}", $"DXF File not found for part {item.ItemExtCode} | {item.ItemDesc}"); - allOk = false; + // cerco file! sostituisco cadBaseBath --> srvCadBaseBath + if (string.IsNullOrEmpty(item.CadFilePath)) + { + localPath = $"{srvCadBaseBath}{item.ItemExtCode}.dxf"; + } + else + { + localPath = item.CadFilePath.Replace(cadBaseBath, srvCadBaseBath); + } + // verifico + fileOk = fileMover.obj.fileExist(localPath); + if (!fileOk) + { + DataLayer.man.taEL.insertQuery(DateTime.Now, "I.1", $"B.{batchID}", $"{item.ItemExtCode}.dxf", $"DXF File not found for part {item.ItemExtCode} on {srvCadBaseBath} | {item.ItemDesc}"); + allOk = false; + missingDxfList.Add(item.ItemExtCode); + } } } } diff --git a/NKC_WF/WebUserControls/cmp_batchList.ascx b/NKC_WF/WebUserControls/cmp_batchList.ascx index a0322b8..a9046a6 100644 --- a/NKC_WF/WebUserControls/cmp_batchList.ascx +++ b/NKC_WF/WebUserControls/cmp_batchList.ascx @@ -57,7 +57,8 @@ - <%# Eval("NumErr") %> err + <%# Eval("NumErrPre") %> err + <%# Eval("NumErr") %> err