inizio nuova versioen e tolte chiamate verifica path inutili x disegni...
This commit is contained in:
@@ -140,63 +140,13 @@ namespace MoonProTablet.WebUserControls
|
||||
try
|
||||
{
|
||||
DS_ProdTempi.AnagArticoliRow riga = DataLayer.obj.taAnagArt.getByCod(_codArticolo.ToString())[0];
|
||||
#if false
|
||||
// se disegno presente...
|
||||
if (docPresente(riga.Disegno))
|
||||
{
|
||||
#endif
|
||||
outVal = string.Format("~/Files/Disegni/{0}.pdf", riga.Disegno);
|
||||
#if false
|
||||
outVal = string.Format("~/Files/Disegni/{0}.pdf", riga.Disegno);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore Articolo {0}: NON ho trovato il disegno {1}", riga.CodArticolo, riga.Disegno), tipoLog.INFO);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in ricostruzione URL disegno:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return outVal;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// path completo documento su filesystem
|
||||
/// </summary>
|
||||
/// <param name="Disegno">Nome disegno</param>
|
||||
/// <returns></returns>
|
||||
protected string docFilePath(string Disegno)
|
||||
{
|
||||
string answ = "";
|
||||
answ = string.Format(memLayer.ML.confReadString("urlDisegni"), Disegno);
|
||||
// rimetto ".pdf" finale se non ci fosse...
|
||||
if (answ.IndexOf(".pdf") < 0) Disegno += ".pdf";
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se il documento sia presente
|
||||
/// </summary>
|
||||
public bool docPresente(string Disegno)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
string filePath = docFilePath(Disegno).Replace("~/", "");
|
||||
// path SENZA "/"
|
||||
answ = fileMover.obj.fileExist(HttpRuntime.AppDomainAppPath, filePath);
|
||||
// provo con dir cablata da webconfig se non trovato...
|
||||
if (!answ)
|
||||
{
|
||||
answ = fileMover.obj.fileExist(HttpRuntime.AppDomainAppPath, filePath.Replace("~/", ""));
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in verifica docPresente:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user