e511aa2765
Update installer cronjob e testing vari versione IMPORT
78 lines
3.0 KiB
C#
78 lines
3.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using SteamWare;
|
|
using C2P_Data;
|
|
|
|
namespace C2P.WebUserControls
|
|
{
|
|
public partial class mod_TranspCostMan : System.Web.UI.UserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
mod_fileUploader1.eh_uploadDone += mod_fileUploader1_eh_uploadDone;
|
|
}
|
|
|
|
/// <summary>
|
|
/// file caricato
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
void mod_fileUploader1_eh_uploadDone(object sender, EventArgs e)
|
|
{
|
|
// caricato file su server, PROVA ad eseguire import tabella
|
|
string fileName = "TranspCostRaw";
|
|
string importDataFolder = memLayer.ML.confReadString("importDataFolder");
|
|
string archiveDataFolder = memLayer.ML.confReadString("archiveDataFolder");
|
|
string uplDir = memLayer.ML.confReadString("uplDir");
|
|
string archDir = memLayer.ML.confReadString("archDir");
|
|
string FIELDTERMINATOR = memLayer.ML.confReadString("FIELDTERMINATOR");
|
|
string ROWTERMINATOR = memLayer.ML.confReadString("ROWTERMINATOR");
|
|
string FIRSTROW = memLayer.ML.confReadString("FIRSTROW");
|
|
string CODEPAGE = memLayer.ML.confReadString("CODEPAGE");
|
|
bool flgUpdate = memLayer.ML.confReadBool("flgUpdate");
|
|
int numTicket = 0; // Convert.ToInt32(DateTime.Now.ToString("yyMMddHHmm"));
|
|
|
|
// calcolo nuova cartella archivio (anno/mese/gg_ora)
|
|
DateTime adesso = DateTime.Now;
|
|
archiveDataFolder = string.Format(@"{0}{1:yyyy}\{1:MM}\{1:dd}\{1:HHmmss}\", archiveDataFolder, adesso);
|
|
archDir = string.Format(@"{0}{1:yyyy}\{1:MM}\{1:dd}\{1:HHmmss}\", archDir, adesso);
|
|
// sposto i files da TEMP a cartella archive
|
|
fileMover.obj.muoviFile(importDataFolder, archiveDataFolder, "TranspCostRaw.csv");
|
|
// parto con la catena di esecuzione
|
|
try
|
|
{
|
|
DtProxy.man.taTCD.import(fileName, archDir, "TranspCostRaw.csv", FIELDTERMINATOR, ROWTERMINATOR, FIRSTROW, CODEPAGE, "errorTranspCost.log", numTicket);
|
|
}
|
|
catch
|
|
{ }
|
|
try
|
|
{
|
|
DtProxy.man.taTCD.convert(fileName, numTicket);
|
|
}
|
|
catch
|
|
{ }
|
|
try
|
|
{
|
|
DtProxy.man.taTCD.merge(fileName, numTicket, flgUpdate);
|
|
}
|
|
catch
|
|
{ }
|
|
lblUploadDone.Text = string.Format("Upload and Import done for {0}", fileName);
|
|
logger.lg.scriviLog(lblUploadDone.Text, tipoLog.INFO);
|
|
}
|
|
|
|
/// <summary>
|
|
/// wrapper traduzione
|
|
/// </summary>
|
|
/// <param name="lemma"></param>
|
|
/// <returns></returns>
|
|
public string traduci(string lemma)
|
|
{
|
|
return user_std.UtSn.Traduci(lemma);
|
|
}
|
|
}
|
|
} |