aggiunti metodi per controlli su db invece che ram
This commit is contained in:
@@ -37,9 +37,9 @@ namespace MP.Data.Controllers
|
||||
/// <param name="codLotto">Codice lotto</param>
|
||||
/// <param name="codMagazzino">Codice magazzino</param>
|
||||
/// <returns></returns>
|
||||
public List<AnagLottiArca> ListLottiEsterni(string codArt, string codLotto, string codMagazzino)
|
||||
public AnagLottiArca LottoEsterno(string codArt, string codLotto, string codMagazzino)
|
||||
{
|
||||
List<AnagLottiArca> dbResult = new List<AnagLottiArca>();
|
||||
AnagLottiArca dbResult = new AnagLottiArca();
|
||||
using (var dbCtx = new MoonPro_ISContext(_configuration))
|
||||
{
|
||||
var DataGiac = new SqlParameter("@DataGiac", DBNull.Value);
|
||||
@@ -52,7 +52,8 @@ namespace MP.Data.Controllers
|
||||
.DbLottoArca
|
||||
.FromSqlRaw("exec dbo.stp_GIAC_getByDate @DataGiac,@CodArt,@CodLotto,@CodMagaz,@OnlyTest", DataGiac, CodArt, CodLotto, CodMagaz, OnlyTest)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
.AsEnumerable()
|
||||
.FirstOrDefault();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
@@ -121,29 +122,36 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Elenco Scansioni Totali
|
||||
/// </summary>
|
||||
/// <param name="InveSessId"></param>
|
||||
/// <returns></returns>
|
||||
public List<ScanDataModel> ScanBySession(int InveSessId)
|
||||
public ScanDataModel ScanByUdcSession(string udc, int InveSessId)
|
||||
{
|
||||
List<ScanDataModel> dbResult = new List<ScanDataModel>();
|
||||
ScanDataModel dbResult = new ScanDataModel();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbScanData
|
||||
.AsNoTracking()
|
||||
.Where(x => x.InveSessID == InveSessId)
|
||||
.OrderByDescending(x => x.DtScan)
|
||||
.ToList();
|
||||
if (InveSessId != 0)
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbScanData
|
||||
.Where(x => (x.ScanValue == udc) && (x.InveSessID == InveSessId))
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtScan)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbScanData
|
||||
.Where(x => (x.ScanValue == udc))
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtScan)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Scansioni dato Id sessione inventario
|
||||
@@ -407,31 +415,25 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// check udc
|
||||
/// </summary>
|
||||
/// <param name="Udc"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsUDC(string Udc)
|
||||
public AnagUdcModel IsUDC(string Udc)
|
||||
{
|
||||
List<AnagUdcModel> dbResult = new List<AnagUdcModel>();
|
||||
bool answ = false;
|
||||
AnagUdcModel dbResult = new AnagUdcModel();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbUdcData
|
||||
.Where(x => x.UDC == Udc)
|
||||
.Include(m => m.lottoNav)
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.UDC)
|
||||
.ToList();
|
||||
|
||||
if (dbResult.Count == 1)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
.FirstOrDefault(); ;
|
||||
}
|
||||
return answ;
|
||||
return dbResult;
|
||||
}
|
||||
#endregion gestione UDC
|
||||
|
||||
@@ -453,17 +455,14 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// check lotto
|
||||
/// </summary>
|
||||
/// <param name="lotto"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsLotto(string lotto)
|
||||
public AnagLottoModel LottoInterno(string lotto)
|
||||
{
|
||||
List<AnagLottoModel> dbResult = new List<AnagLottoModel>();
|
||||
bool answ = false;
|
||||
AnagLottoModel dbResult = new AnagLottoModel();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -471,14 +470,9 @@ namespace MP.Data.Controllers
|
||||
.Where(x => x.Lotto == lotto)
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.Lotto)
|
||||
.ToList();
|
||||
|
||||
if (dbResult.Count == 1)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
.FirstOrDefault();
|
||||
}
|
||||
return answ;
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#endregion gestione lotti
|
||||
|
||||
Reference in New Issue
Block a user