Update gestione disegni (mostra se sono esistenti) + fix gitignore
This commit is contained in:
@@ -134,12 +134,48 @@ namespace MoonProTablet.WebUserControls
|
||||
public string urlDisegno(object _codArticolo)
|
||||
{
|
||||
// default è ND...
|
||||
string answ= "~/Files/Disegni/ND.pdf";
|
||||
string answ = "~/Files/Disegni/ND.pdf";
|
||||
// recupero da anagrafica articoli...
|
||||
try
|
||||
{
|
||||
DS_ProdTempi.AnagArticoliRow riga = DataLayer.obj.taAnagArt.getByCod(_codArticolo.ToString())[0];
|
||||
answ = string.Format("~/Files/Disegni/{0}.pdf", riga.Disegno);
|
||||
// se disegno presente...
|
||||
if (docPresente(riga.Disegno))
|
||||
{
|
||||
answ = string.Format("~/Files/Disegni/{0}.pdf", riga.Disegno);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
/// <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";
|
||||
// tolgo eventuale "~/" iniziale
|
||||
answ = answ.Replace("~/", "");
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se il documento sia presente
|
||||
/// </summary>
|
||||
public bool docPresente(string Disegno)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
fileMover.obj.setDirectory("");
|
||||
answ = fileMover.obj.fileExist(docFilePath(Disegno));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
Reference in New Issue
Block a user