add iniziale pagine nuove
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="DxfValidation.aspx.cs" Inherits="NKC_WF.site.DxfValidation" %>
|
||||
|
||||
<%@ Register Src="~/WebUserControls/cmp_fileUpload.ascx" TagPrefix="uc1" TagName="cmp_fileUpload" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<div class="container">
|
||||
<div class="card" style="width: 100%;">
|
||||
<div class="card-header">
|
||||
<h3><%: traduci("DxfValidation") %></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<uc1:cmp_fileUpload runat="server" ID="cmp_fileUpload" isWriteEnabled="true" fileSuffix=".dxf" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12" runat="server" id="divFileList">
|
||||
Dxf file List
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,178 @@
|
||||
using AppData;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
public partial class DxfValidation : BasePage
|
||||
{
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// Folder REMOTA x copia verso SQL
|
||||
/// </summary>
|
||||
protected string _SqlCopyDir = memLayer.ML.CRS("_SqlCopyDir");
|
||||
|
||||
/// <summary>
|
||||
/// Folder x SQL import
|
||||
/// </summary>
|
||||
protected string _SqlImportDir = memLayer.ML.CRS("_SqlImportDir");
|
||||
|
||||
/// <summary>
|
||||
/// Path base x nesting
|
||||
/// </summary>
|
||||
protected string cadBasePath = $"{memLayer.ML.CRS("nestBasePath")}{memLayer.ML.CRS("drawingFolder")}/";
|
||||
|
||||
/// <summary>
|
||||
/// Path base x server
|
||||
/// </summary>
|
||||
protected string srvCadBasePath = $"{memLayer.ML.CRS("servBasePath")}{memLayer.ML.CRS("drawingFolder")}/";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void Cmp_fileUpload_eh_FileUploaded(object sender, WebUserContols.FileUploadEventArgs e)
|
||||
{
|
||||
#if false
|
||||
/*--------------------------------------------
|
||||
* 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)
|
||||
{
|
||||
logger.lg.scriviLog($"{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
|
||||
{
|
||||
// chiamo procedura SQL x import...
|
||||
tabDati = DLMan.taImpLog.importCsvOrd($"{dirImport}", e.FileName, e.BatchName, ";", "\n", "2", 0, 0, 0);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"{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)
|
||||
{
|
||||
logger.lg.scriviLog($"{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);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
cmp_fileUpload.eh_FileUploaded += Cmp_fileUpload_eh_FileUploaded;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
|
||||
|
||||
public partial class DxfValidation
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo cmp_fileUpload.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserContols.cmp_fileUpload cmp_fileUpload;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divFileList.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divFileList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/SiteContent.master" AutoEventWireup="true" CodeBehind="OrderHistory.aspx.cs" Inherits="NKC_WF.site.OrderHistory" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<div class="container">
|
||||
<div class="card" style="width: 100%;">
|
||||
<div class="card-header">
|
||||
<h3><%: traduci("OrderHistory") %></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12" runat="server" id="divFileList">
|
||||
FULL orders List
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
public partial class OrderHistory : BasePage
|
||||
{
|
||||
#region Protected Methods
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
|
||||
|
||||
public partial class OrderHistory
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divFileList.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divFileList;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user