From 2226388f92a8832f7bda4e396a7ac2f4622b8a27 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 19 Mar 2025 12:11:28 +0100 Subject: [PATCH] Aggiunto modifiche testata-filtro --- NKC_WF/NKC_WF.csproj | 4 +- NKC_WF/site/OrderSearch.aspx | 48 ++++++- NKC_WF/site/OrderSearch.aspx.cs | 164 +++-------------------- NKC_WF/site/OrderSearch.aspx.designer.cs | 31 ++++- 4 files changed, 95 insertions(+), 152 deletions(-) diff --git a/NKC_WF/NKC_WF.csproj b/NKC_WF/NKC_WF.csproj index 27a6841..381724f 100644 --- a/NKC_WF/NKC_WF.csproj +++ b/NKC_WF/NKC_WF.csproj @@ -380,6 +380,9 @@ + + Always + @@ -1946,7 +1949,6 @@ - diff --git a/NKC_WF/site/OrderSearch.aspx b/NKC_WF/site/OrderSearch.aspx index 191c8f5..726f04a 100644 --- a/NKC_WF/site/OrderSearch.aspx +++ b/NKC_WF/site/OrderSearch.aspx @@ -1,17 +1,55 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="OrderSearch.aspx.cs" Inherits="NKC_WF.site.WebForm1" %> + <%@ Register Src="~/WebUserControls/cmp_fileUpload.ascx" TagPrefix="uc1" TagName="cmp_fileUpload" %> <%@ Register Src="~/WebUserControls/cmp_batchList.ascx" TagPrefix="uc1" TagName="cmp_batchList" %> -
+
-
-

<%: traduci("OrderManager") %>

+
+

<%: traduci("OrderSearch") %>

-
- +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + + + + +
+
+
+
+ + + + + +
+
+
diff --git a/NKC_WF/site/OrderSearch.aspx.cs b/NKC_WF/site/OrderSearch.aspx.cs index 22a7868..34ecbca 100644 --- a/NKC_WF/site/OrderSearch.aspx.cs +++ b/NKC_WF/site/OrderSearch.aspx.cs @@ -1,4 +1,5 @@ using AppData; +using MongoDB.Driver.Search; using NKC_SDK; using SteamWare; using System; @@ -46,148 +47,6 @@ namespace NKC_WF.site doUpdate(); } - /// - /// Ora continuo processing - /// - /// - /// - private void Cmp_fileUpload_eh_FileUploaded(object sender, WebUserContols.FileUploadEventArgs e) - { - /*-------------------------------------------- - * Note validazione: - * - leggo CSV - * - carico su DB - * - verifico (come ora x DXF) TUTTI i particolari - * - cerco su tab ItemValidation - * --> NON TROVATO --> creo record IV + record Batch stato 8, con KitID = OrdID = 0, DA VALUTARE!!! - * - se valutazione tempo <= 1 sec --> NON VALIDO - * - se valutazione tempo > 1 sec --> VALIDO - * - * --> trovato - * - se valido --> check DXF, - * --> dxf ok --> finito - * --> dxf non trovato --> NON VALIDO, segnalo errore su part - * - se NON valido --> segnalo errore su part - * - *--------------------------------------------*/ - - bool dataValidated = true; - 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; - // recupero elenco parti validate... - DS_App.ItemListDataTable ItemValitadion = DLMan.taIL.GetData(); - // preporcessing file: leggo e correggo: - // - sostituisco "," --> ";" come separatore - // - tolgo "" e spazi da stringa - string[] rawLines = System.IO.File.ReadAllLines($"{e.LocalPath}{e.FileName}"); - string[] fixLines = new string[rawLines.Length]; - int numRow = 0; - if (memLayer.ML.CRB("preFixCsv")) - { - foreach (var riga in rawLines) - { - string newLine = ""; - // splitto con " - string[] rowPart = riga.Split('"'); - int i = 0; - foreach (var parte in rowPart) - { - if (i % 2 == 0) - { - // pari --> sostituisco , --> ; - newLine += parte.Replace(",", ";"); - } - else - { - // dispari: trimmo - newLine += parte.Trim(); - } - i++; - } - // ricombino! - fixLines[numRow] = newLine; - numRow++; - } - // salvo NUOVO file... - System.IO.File.WriteAllLines($"{e.LocalPath}{e.FileName}", fixLines); - } - // copio su server SQL - try - { - // copio su SQL... - fileMover.obj.copiaFile(dirFrom, dirTo, e.FileName); - } - catch (Exception exc) - { - Log.Instance.Error($"{traduci("ErrOrderCsvImp01")}:{Environment.NewLine}{exc}"); - DLMan.taEL.insertQuery(DateTime.Now, "Copy CSV", $"{e.BatchName}", $"{e.BatchName}.{e.FileName}", $"Exception: {exc}"); - } - // chiamo stored caricamento - DS_App.ImportLogDataTable tabDati = null; - try - { - // pulizia eventuali vecchi file errore in "dirTo" - string[] file2del = Directory.GetFiles(dirTo, "error*"); - if (file2del.Length > 0) - { - Log.Instance.Info($"Trovati {file2del.Length} file errore, li elimino"); - foreach (var item in file2del) - { - File.Delete(item); - Log.Instance.Info($"Eliminato {item}"); - } - } - - // chiamo procedura SQL x import... - tabDati = DLMan.taImpLog.importCsvOrd($"{dirImport}", e.FileName, e.BatchName, ";", "\n", "2", 0, 0, 0); - } - catch (Exception exc) - { - Log.Instance.Error($"{traduci("ErrOrderCsvImp02")}:{Environment.NewLine}{exc}"); - // salvo log errore... - DLMan.taEL.insertQuery(DateTime.Now, "Upload CSV", $"{e.BatchName}", $"{e.BatchName}.{e.FileName}", $"Exception: {exc}"); - dataValidated = false; - } - // FIX eventuali cadFilePath... - DLMan.taIL.updateCadPath(cadBasePath, 0, false); - // recupero da batch la riga impostata... - try - { - var tabBatch = DLMan.taBL.getLastByTakt(e.BatchName); - if (tabBatch != null) - { - if (tabBatch.Count > 0) - { - batchID = tabBatch[0].BatchID; - } - } - } - catch (Exception exc) - { - Log.Instance.Error($"{traduci("ErrOrderCsvImp03")}:{Environment.NewLine}{exc}"); - dataValidated = false; - } - if (dataValidated && batchID > 0) - { - dataValidated = doValidations(batchID); - } - if (!dataValidated) - { - try - { - var newBatch = tabDati[0]; - int bStatus = 7; - DLMan.taBL.updateStatus(batchID, bStatus, e.BatchName, -1); - } - catch - { } - } - Response.Redirect(Request.RawUrl); - } - /// /// Effettua validazione dati /// @@ -256,8 +115,6 @@ namespace NKC_WF.site doUpdate(); } cmp_batchList.eh_doRefresh += Cmp_batchList_eh_doRefresh; - cmp_fileUpload.eh_doRefresh += Cmp_fileUpload_eh_doRefresh; - cmp_fileUpload.eh_FileUploaded += Cmp_fileUpload_eh_FileUploaded; } #endregion Protected Methods @@ -273,5 +130,24 @@ namespace NKC_WF.site } #endregion Public Methods + + + + protected void ddlDest_SelectedIndexChanged(object sender, EventArgs e) + { + reqDest = ddlDest.SelectedValue; + doSearch(); + } + + /// + /// esegue ricerca effettiva + display + /// + protected void doSearch() + { + + } + + private string reqDest = ""; + } } \ No newline at end of file diff --git a/NKC_WF/site/OrderSearch.aspx.designer.cs b/NKC_WF/site/OrderSearch.aspx.designer.cs index 998a9b3..06305a0 100644 --- a/NKC_WF/site/OrderSearch.aspx.designer.cs +++ b/NKC_WF/site/OrderSearch.aspx.designer.cs @@ -15,13 +15,40 @@ namespace NKC_WF.site { /// - /// cmp_fileUpload control. + /// ddlModel control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::NKC_WF.WebUserContols.cmp_fileUpload cmp_fileUpload; + protected global::System.Web.UI.WebControls.DropDownList ddlModel; + + /// + /// odsModel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsModel; + + /// + /// ddlDest control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlDest; + + /// + /// odsDest control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsDest; /// /// divBatchList control.