PROG
- fix gestione display versioni fix update in selezione
This commit is contained in:
@@ -331,6 +331,11 @@ namespace MP.FileData.Controllers
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca il file x chiave ID
|
||||
/// </summary>
|
||||
/// <param name="FileId"></param>
|
||||
/// <returns></returns>
|
||||
public FileModel FileGetByKey(int FileId)
|
||||
{
|
||||
FileModel thisFile = null;
|
||||
@@ -344,6 +349,39 @@ namespace MP.FileData.Controllers
|
||||
return thisFile;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca un file dato un fice successivo specificando rev richiesta)
|
||||
/// </summary>
|
||||
/// <param name="FileId"></param>
|
||||
/// <param name="Rev"></param>
|
||||
/// <returns></returns>
|
||||
public FileModel FileGetByKeyRev(int FileId, int Rev)
|
||||
{
|
||||
FileModel oFile = null;
|
||||
FileModel tFile = null;
|
||||
using (MoonPro_ProgContext localDbCtx = new MoonPro_ProgContext(_configuration))
|
||||
{
|
||||
oFile = localDbCtx
|
||||
.DbSetProgFile
|
||||
.Where(x => x.FileId == FileId)
|
||||
.FirstOrDefault();
|
||||
// se la rev è diversa --> la cerco!
|
||||
if (oFile.Rev == Rev)
|
||||
{
|
||||
tFile = oFile;
|
||||
}
|
||||
else
|
||||
{
|
||||
tFile = localDbCtx
|
||||
.DbSetProgFile
|
||||
.Where(x => x.Name == oFile.Name && x.IdxMacchina == oFile.IdxMacchina && x.Path == oFile.Path)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
return tFile;
|
||||
}
|
||||
|
||||
|
||||
public List<DatabaseModels.FileModel> FileGetByPath(string path, bool onlyActive)
|
||||
{
|
||||
List<DatabaseModels.FileModel> dbResult = new List<DatabaseModels.FileModel>();
|
||||
|
||||
Reference in New Issue
Block a user