Correzione description con NOME FILE
This commit is contained in:
@@ -69,6 +69,18 @@ namespace WebLCP.WUC
|
||||
Response.Redirect("Default");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce il nome del JOB caricato come descrizione digitata + nome file uploaded
|
||||
/// </summary>
|
||||
protected string jobDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = $"{txtJobDescr.Text.Trim()} | {FUplCsv.FileName}";
|
||||
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAndUploadFile()
|
||||
{
|
||||
@@ -82,11 +94,11 @@ namespace WebLCP.WUC
|
||||
// STEP1: inizio controlli su nomi...
|
||||
if (FUplCsv.FileName != "" && (FUplCsv.FileName.EndsWith(".txt") || FUplCsv.FileName.EndsWith(".csv")))
|
||||
{
|
||||
newSuccessList.Add("DB_INPUT", "OK Filename DB INPUT");
|
||||
newSuccessList.Add("FILE INPUT", "OK Filename format");
|
||||
}
|
||||
else
|
||||
{
|
||||
newErrorList.Add("DB_INPUT", "WRONG Filename DB INPUT (only *.csv and *.txt)");
|
||||
newErrorList.Add("FILE INPUT", "WRONG Filename format (only *.csv and *.txt)");
|
||||
}
|
||||
|
||||
// STEP 2: se NON HO errori faccio controllo files
|
||||
@@ -106,7 +118,7 @@ namespace WebLCP.WUC
|
||||
if (newErrorList.Count == 0)
|
||||
{
|
||||
// creo record
|
||||
DS_App.JobsListDataTable tabJobs = dataLayer.man.taJL.insertNew(txtJobDescr.Text.Trim(), devicesAuthProxy.stObj.utente);
|
||||
DS_App.JobsListDataTable tabJobs = dataLayer.man.taJL.insertNew(jobDescription, devicesAuthProxy.stObj.utente);
|
||||
if (tabJobs.Count == 1)
|
||||
{
|
||||
/*************************************************
|
||||
@@ -269,7 +281,9 @@ namespace WebLCP.WUC
|
||||
fileMover.obj.setDirectory(sourceDir);
|
||||
fileMover.obj.checkDir();
|
||||
// proseguo con upload files...
|
||||
string fileName = Path.GetFileName(FUplCsv.FileName);
|
||||
#if false
|
||||
string fileName = Path.GetFileName(FUplCsv.FileName);
|
||||
#endif
|
||||
FUplCsv.SaveAs($"{sourceDir}DB_INPUT.csv");
|
||||
return sourceDir;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user