Update gestione disegni (mostra se sono esistenti) + fix gitignore
This commit is contained in:
+2
-1
@@ -62,7 +62,8 @@ MP/logs/*.zip
|
||||
/MP-Tablet/obj/*
|
||||
/MP-Tablet/WebCharts/*.png
|
||||
/MP-Tablet/images/macchine/*.*
|
||||
|
||||
/MP-Tablet/Files/Disegni/*.pdf
|
||||
!/MP-Tablet/Files/Disegni/ND.pdf
|
||||
|
||||
#--------------------------------
|
||||
# Area MoonPro
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
<!--impostazione cambio tempo calcolato tra minuti-ore-gg-->
|
||||
<add key="maxMinuti" value="60" />
|
||||
<add key="maxOre" value="1440" />
|
||||
<!--area gestione documenti/disegni -->
|
||||
<add key="urlDisegni" value="~/Files/Disegni/{0}.pdf" />
|
||||
<!--gestione check / warning-->
|
||||
<add key="durMinWarning" value="20"/>
|
||||
<!--refresh MSE-->
|
||||
|
||||
@@ -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