fix PODL modifica e clona
This commit is contained in:
@@ -621,6 +621,7 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#if false
|
||||
|
||||
/// <summary>
|
||||
/// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato)
|
||||
@@ -643,7 +644,8 @@ namespace MP.Data.Controllers
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Elenco valori ammessi x tabella/colonna
|
||||
@@ -954,22 +956,42 @@ namespace MP.Data.Controllers
|
||||
public async Task<bool> PODL_startSetup(PODLExpModel editRec, int matrOpr, double tcRich, int pzPallet, string note)
|
||||
{
|
||||
bool answ = false;
|
||||
|
||||
PODLModel recPODL = new PODLModel()
|
||||
{
|
||||
IdxPromessa = editRec.IdxPromessa,
|
||||
KeyRichiesta = editRec.KeyRichiesta,
|
||||
KeyBCode = editRec.KeyBCode,
|
||||
IdxOdl = editRec.IdxOdl,
|
||||
CodArticolo = editRec.CodArticolo,
|
||||
CodGruppo = editRec.CodGruppo,
|
||||
IdxMacchina = editRec.IdxMacchina,
|
||||
NumPezzi = editRec.NumPezzi,
|
||||
Tcassegnato = editRec.Tcassegnato,
|
||||
DueDate = editRec.DueDate,
|
||||
Priorita = editRec.Priorita,
|
||||
PzPallet = editRec.PzPallet,
|
||||
Note = editRec.Note,
|
||||
CodCli = editRec.CodCli,
|
||||
InsertDate = editRec.InsertDate
|
||||
};
|
||||
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetPODLExp
|
||||
.DbSetPODL
|
||||
.AsNoTracking()
|
||||
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
|
||||
.Where(x => x.IdxPromessa == recPODL.IdxPromessa)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (currRec != null)
|
||||
{
|
||||
// eseguo stored attrezzaggio
|
||||
var IdxPromessa = new SqlParameter("@idxPromessa", editRec.IdxPromessa);
|
||||
var IdxPromessa = new SqlParameter("@idxPromessa", recPODL.IdxPromessa);
|
||||
var MatrOpr = new SqlParameter("@MatrOpr", matrOpr);
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", editRec.IdxMacchina);
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", recPODL.IdxMacchina);
|
||||
var TCRichAttr = new SqlParameter("@TCRichAttr", tcRich);
|
||||
var PzPallet = new SqlParameter("@PzPallet", pzPallet);
|
||||
var Note = new SqlParameter("@Note", note);
|
||||
@@ -996,17 +1018,35 @@ namespace MP.Data.Controllers
|
||||
/// <returns></returns>
|
||||
public async Task<bool> PODLDeleteRecord(PODLExpModel currRec)
|
||||
{
|
||||
PODLModel recPODL = new PODLModel()
|
||||
{
|
||||
IdxPromessa = currRec.IdxPromessa,
|
||||
KeyRichiesta = currRec.KeyRichiesta,
|
||||
KeyBCode = currRec.KeyBCode,
|
||||
IdxOdl = currRec.IdxOdl,
|
||||
CodArticolo = currRec.CodArticolo,
|
||||
CodGruppo = currRec.CodGruppo,
|
||||
IdxMacchina = currRec.IdxMacchina,
|
||||
NumPezzi = currRec.NumPezzi,
|
||||
Tcassegnato = currRec.Tcassegnato,
|
||||
DueDate = currRec.DueDate,
|
||||
Priorita = currRec.Priorita,
|
||||
PzPallet = currRec.PzPallet,
|
||||
Note = currRec.Note,
|
||||
CodCli = currRec.CodCli,
|
||||
InsertDate = currRec.InsertDate
|
||||
};
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currVal = dbCtx
|
||||
.DbSetPODLExp
|
||||
.Where(x => x.IdxPromessa == currRec.IdxPromessa)
|
||||
.DbSetPODL
|
||||
.Where(x => x.IdxPromessa == recPODL.IdxPromessa)
|
||||
.FirstOrDefault();
|
||||
dbCtx
|
||||
.DbSetPODLExp
|
||||
.DbSetPODL
|
||||
.Remove(currVal);
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
@@ -1032,7 +1072,7 @@ namespace MP.Data.Controllers
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetPODLExp
|
||||
.DbSetPODL
|
||||
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
@@ -1051,8 +1091,8 @@ namespace MP.Data.Controllers
|
||||
else
|
||||
{
|
||||
dbCtx
|
||||
.DbSetPODLExp
|
||||
.Add(editRec);
|
||||
.DbSetPODL
|
||||
.Add(currRec);
|
||||
}
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
|
||||
@@ -733,6 +733,7 @@ namespace MP.SPEC.Data
|
||||
return result;
|
||||
}
|
||||
|
||||
#if false
|
||||
|
||||
/// <summary>
|
||||
/// Elenco PODL avviati filtrati x articolo, KeyRich (che contiene stato)
|
||||
@@ -769,7 +770,8 @@ namespace MP.SPEC.Data
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ListPODLFiltNOOdl | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Elenco di tutte le macchine gestite
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.SPEC</RootNamespace>
|
||||
<Version>6.16.2211.2809</Version>
|
||||
<Version>6.16.2211.2817</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2211.2809</h4>
|
||||
<h4>Versione: 6.16.2211.2817</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2211.2809
|
||||
6.16.2211.2817
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2211.2809</version>
|
||||
<version>6.16.2211.2817</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user