Aggiunto modifiche testata-filtro
This commit is contained in:
@@ -380,6 +380,9 @@
|
||||
</Content>
|
||||
<Content Include="App_Readme\SteamWare_demo\example-NLog.config" />
|
||||
<Content Include="App_Readme\SteamWare_demo\example-app.config" />
|
||||
<Content Include="FileUpload\.placeholder.file">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="Properties\PublishProfiles\IIS04.pubxml" />
|
||||
<Content Include="Reports\reportConf.json" />
|
||||
<None Include="Scripts\jquery-3.6.0.intellisense.js" />
|
||||
@@ -1946,7 +1949,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
<Folder Include="FileUpload\" />
|
||||
<Folder Include="Scripts\pdf.js\web\locale\ak\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -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" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid">
|
||||
<div class="card" style="width: 100%;">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<h3><%: traduci("OrderManager") %></h3>
|
||||
<div class="col-2">
|
||||
<h3><%: traduci("OrderSearch") %></h3>
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<uc1:cmp_fileUpload runat="server" ID="cmp_fileUpload" isWriteEnabled="true" filePrefix="CNC" fileSuffix=".csv" checkBatchAppr="true" checkRunning="false" />
|
||||
<div class="col-10">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="form-group mb-0">
|
||||
<label class="small mb-0">Parent Order Code</label>
|
||||
<input type="text" class="form-control form-control-sm" placeholder="Enter Parent Order Code" title="Parent Order Code (ex: 40P1CAN032425.001)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="form-group mb-0">
|
||||
<label class="small mb-0">Order Code</label>
|
||||
<input type="text" class="form-control form-control-sm" placeholder="Enter Order Code" title="Order Code (ex: 40P1CAN032425)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="form-group mb-0">
|
||||
<label class="small mb-0">Part Code</label>
|
||||
<input type="text" class="form-control form-control-sm" placeholder="MRP Part code" title="Order Code (ex: 143159)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="form-group mb-0">
|
||||
<label class="small mb-0">Model</label>
|
||||
<asp:DropDownList runat="server" ID="ddlModel" DataSourceID="odsModel" AutoPostBack="True" OnSelectedIndexChanged="ddlDest_SelectedIndexChanged" CssClass="form-control form-control-sm" DataTextField="ModelCod" DataValueField="ModelCod" AppendDataBoundItems="true">
|
||||
<asp:ListItem Value="" Text="--- ALL ---"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:ObjectDataSource ID="odsModel" runat="server" SelectMethod="GetData" TypeName="AppData.DS_AppTableAdapters.SpecialPartsTableAdapter"></asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<div class="form-group mb-0">
|
||||
<label class="small mb-0">Destination</label>
|
||||
<asp:DropDownList runat="server" ID="ddlDest" DataSourceID="odsDest" AutoPostBack="True" OnSelectedIndexChanged="ddlDest_SelectedIndexChanged" CssClass="form-control form-control-sm" DataTextField="PlantCod" DataValueField="PlantCod" AppendDataBoundItems="true">
|
||||
<asp:ListItem Value="" Text="--- ALL ---"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:ObjectDataSource ID="odsDest" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="AppData.DS_AppTableAdapters.PlantListTableAdapter"></asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+20
-144
@@ -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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ora continuo processing
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua validazione dati
|
||||
/// </summary>
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// esegue ricerca effettiva + display
|
||||
/// </summary>
|
||||
protected void doSearch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private string reqDest = "";
|
||||
|
||||
}
|
||||
}
|
||||
Generated
+29
-2
@@ -15,13 +15,40 @@ namespace NKC_WF.site
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// cmp_fileUpload control.
|
||||
/// ddlModel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserContols.cmp_fileUpload cmp_fileUpload;
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlModel;
|
||||
|
||||
/// <summary>
|
||||
/// odsModel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsModel;
|
||||
|
||||
/// <summary>
|
||||
/// ddlDest control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlDest;
|
||||
|
||||
/// <summary>
|
||||
/// odsDest control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsDest;
|
||||
|
||||
/// <summary>
|
||||
/// divBatchList control.
|
||||
|
||||
Reference in New Issue
Block a user