modifica per logo in cartella con meno di 5 caratteri
This commit is contained in:
parent
ec5dedaa75
commit
50b1223e30
@ -14325,16 +14325,28 @@ namespace ApiPolo.Controllers
|
||||
private async Task<DatiAzienda> readImgAndSave(string azienda, string tecnico, string pathSrv)
|
||||
{
|
||||
_VT_DatiAzi = _VT_DatiAzienda.Dati;
|
||||
var t = await _VT_DatiAzi.Where(t => t.azienda.Equals(azienda) && t.tecnico.Equals(tecnico)).ToListAsync();
|
||||
var t = await _VT_DatiAzi.Where(t => !string.IsNullOrEmpty(t.azienda) && t.azienda.Equals(azienda)
|
||||
&& !string.IsNullOrEmpty(t.tecnico) && t.tecnico.Equals(tecnico)).ToListAsync();
|
||||
|
||||
DatiAzienda model = t.First();
|
||||
|
||||
string path = string.Empty;
|
||||
string nomeFile = string.Empty;
|
||||
nomeFile = getNomeFile(model.url_logo);
|
||||
if(!string.IsNullOrEmpty(nomeFile))
|
||||
{
|
||||
nomeFile = nomeFile.Trim();
|
||||
}
|
||||
|
||||
|
||||
//previene aziende più corte di 5 caratteri
|
||||
string aziendaFolder = string.Empty;
|
||||
if (!string.IsNullOrEmpty(azienda))
|
||||
{
|
||||
aziendaFolder = azienda.Trim();
|
||||
}
|
||||
path = pathSrv;
|
||||
path = path +@"\"+azienda+ @"\" + nomeFile;
|
||||
path = path +@"\"+ aziendaFolder + @"\" + nomeFile;
|
||||
SaveByteArrayToFileWithBinaryWriter(model.logo, path);
|
||||
return model;
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ namespace ApiPolo
|
||||
string dt = oggi.ToString();
|
||||
gen.SwaggerDoc("v1", new OpenApiInfo { Title = "API VIRTUAL TASK - v.app 1.30", Version = dt });
|
||||
|
||||
var filePath = Path.Combine(System.AppContext.BaseDirectory, "ApiPolo.xml");
|
||||
var filePath = Path.Combine(System.AppContext.BaseDirectory, "Api_VT.xml");
|
||||
gen.IncludeXmlComments(filePath);
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user