aggiunti metodi x filtro PODL
This commit is contained in:
@@ -598,11 +598,25 @@ namespace MP.Data.Controllers
|
||||
/// <param name="codArt">Cod articolo</param>
|
||||
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||
/// <returns></returns>
|
||||
public List<PODLModel> ListPODLFilt(string codArt, string keyRichPart)
|
||||
public List<PODLExpModel> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo)
|
||||
{
|
||||
List<PODLModel> dbResult = new List<PODLModel>();
|
||||
|
||||
List<PODLExpModel> dbResult = new List<PODLExpModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var Lanciato = new SqlParameter("@Lanciato", lanciato);
|
||||
var CodGruppo = new SqlParameter("@CodGruppo", codGruppo);
|
||||
var KeyRich = new SqlParameter("@KeyRich", keyRichPart);
|
||||
var IdxMacc = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetPODLExp
|
||||
.FromSqlRaw("EXEC stp_PODL_getByFiltSpec @Lanciato, @KeyRich, @CodGruppo, @IdxMacchina", Lanciato, KeyRich, codGruppo, IdxMacc)
|
||||
.AsNoTracking()
|
||||
//.AsEnumerable()
|
||||
.ToList();
|
||||
}
|
||||
#if false
|
||||
dbResult = dbCtx
|
||||
.DbSetPODL
|
||||
.Where(x => (x.IdxOdl == 0) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (codArt == "*" || x.CodArticolo.Contains(codArt)))
|
||||
@@ -611,7 +625,7 @@ namespace MP.Data.Controllers
|
||||
.Include(a => a.ArticoloNav)
|
||||
.OrderByDescending(x => x.InsertDate)
|
||||
.ToList();
|
||||
}
|
||||
#endif
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
@@ -945,7 +959,7 @@ namespace MP.Data.Controllers
|
||||
/// <param name="pzPallet"></param>
|
||||
/// <param name="note"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> PODL_startSetup(PODLModel editRec, int matrOpr, double tcRich, int pzPallet, string note)
|
||||
public async Task<bool> PODL_startSetup(PODLExpModel editRec, int matrOpr, double tcRich, int pzPallet, string note)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
@@ -953,7 +967,7 @@ namespace MP.Data.Controllers
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetPODL
|
||||
.DbSetPODLExp
|
||||
.AsNoTracking()
|
||||
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
|
||||
.FirstOrDefault();
|
||||
@@ -988,7 +1002,7 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> PODLDeleteRecord(PODLModel currRec)
|
||||
public async Task<bool> PODLDeleteRecord(PODLExpModel currRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
@@ -996,11 +1010,11 @@ namespace MP.Data.Controllers
|
||||
try
|
||||
{
|
||||
var currVal = dbCtx
|
||||
.DbSetPODL
|
||||
.DbSetPODLExp
|
||||
.Where(x => x.IdxPromessa == currRec.IdxPromessa)
|
||||
.FirstOrDefault();
|
||||
dbCtx
|
||||
.DbSetPODL
|
||||
.DbSetPODLExp
|
||||
.Remove(currVal);
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
@@ -1018,7 +1032,7 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> PODLUpdateRecord(PODLModel editRec)
|
||||
public async Task<bool> PODLUpdateRecord(PODLExpModel editRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
@@ -1026,7 +1040,7 @@ namespace MP.Data.Controllers
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetPODL
|
||||
.DbSetPODLExp
|
||||
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
@@ -1045,7 +1059,7 @@ namespace MP.Data.Controllers
|
||||
else
|
||||
{
|
||||
dbCtx
|
||||
.DbSetPODL
|
||||
.DbSetPODLExp
|
||||
.Add(editRec);
|
||||
}
|
||||
await dbCtx.SaveChangesAsync();
|
||||
|
||||
Reference in New Issue
Block a user