95 lines
2.6 KiB
C#
95 lines
2.6 KiB
C#
using AppData;
|
|
using SteamWare;
|
|
using System;
|
|
using System.Web.UI;
|
|
|
|
namespace NKC_WF
|
|
{
|
|
public partial class OrderManager : System.Web.UI.Page
|
|
{
|
|
#if false
|
|
/// <summary>
|
|
/// Hash redis per il canale di comunicazione dei comandi
|
|
/// </summary>
|
|
protected string batchCmdChannel = "NKC:CMD:batchReq";
|
|
/// <summary>
|
|
/// Hash redis per il canale di comunicazione dei batch da eseguire
|
|
/// </summary>
|
|
protected string batchOutChannel = "NKC:OUT:batchReq";
|
|
/// <summary>
|
|
/// Hash redis per il canale di comunicazione dei batch eseguiti/in esecuzione
|
|
/// </summary>
|
|
protected string batchInChannel = "NKC:IN:batchReq";
|
|
#endif
|
|
|
|
|
|
/// <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");
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
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;
|
|
}
|
|
/// <summary>
|
|
/// Ora continuo processing
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void Cmp_fileUpload_eh_FileUploaded(object sender, WebUserContols.FileUploadEventArgs e)
|
|
{
|
|
DateTime adesso = DateTime.Now;
|
|
string dirFrom = e.LocalPath;
|
|
string dirTo = $"{_SqlCopyDir}{adesso.ToString("yyyy-MM")}\\";
|
|
string dirImport = $"{_SqlImportDir}{adesso.ToString("yyyy-MM")}\\";
|
|
// copio su server SQL
|
|
try
|
|
{
|
|
// copio su SQL...
|
|
fileMover.obj.copiaFile(dirFrom, dirTo, e.FileName);
|
|
}
|
|
catch (Exception exc)
|
|
{
|
|
logger.lg.scriviLog($"Eccezione in Copia SQL file:{Environment.NewLine}{exc}");
|
|
}
|
|
// chiamo stored caricamento
|
|
try
|
|
{
|
|
// chiamo procedura SQL x import...
|
|
DataLayer.man.taImpLog.importCsvOrd($"{dirImport}", e.FileName, e.BatchName, ";", "\n", "2", 0, 0, 0);
|
|
}
|
|
catch (Exception exc)
|
|
{
|
|
logger.lg.scriviLog($"Eccezione in IMPORT file:{Environment.NewLine}{exc}");
|
|
}
|
|
doUpdate();
|
|
}
|
|
|
|
private void Cmp_fileUpload_eh_doRefresh(object sender, EventArgs e)
|
|
{
|
|
doUpdate();
|
|
}
|
|
|
|
private void Cmp_batchList_eh_doRefresh(object sender, EventArgs e)
|
|
{
|
|
doUpdate();
|
|
}
|
|
|
|
public void doUpdate()
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
} |