87 lines
3.0 KiB
C#
87 lines
3.0 KiB
C#
using MP.Data.DbModels;
|
|
using StackExchange.Redis;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MP.Data
|
|
{
|
|
public class Utils : MP.Core.Utils
|
|
{
|
|
#region Public Classes
|
|
|
|
public class POdlExt
|
|
{
|
|
#region Public Methods
|
|
|
|
/// <summary>
|
|
/// Clona un POdleExt, tutti i valori (compreso idxOdl)
|
|
/// </summary>
|
|
/// <param name="selRec"></param>
|
|
/// <returns></returns>
|
|
public static PODLExpModel clone(PODLExpModel selRec, bool resetOdl)
|
|
{
|
|
// creo record duplicato...
|
|
PODLExpModel newRec = new PODLExpModel()
|
|
{
|
|
Attivabile = resetOdl ? false : selRec.Attivabile,
|
|
CodArticolo = selRec.CodArticolo,
|
|
CodCli = selRec.CodCli,
|
|
CodGruppo = selRec.CodGruppo,
|
|
DueDate = selRec.DueDate,
|
|
IdxMacchina = selRec.IdxMacchina,
|
|
IdxOdl = resetOdl ? 0 : selRec.IdxOdl,
|
|
IdxPromessa = 0,
|
|
InsertDate = selRec.InsertDate,
|
|
KeyBCode = selRec.KeyBCode,
|
|
KeyRichiesta = selRec.KeyRichiesta,
|
|
Note = $"DUPLICATED - {selRec.Note}",
|
|
NumPezzi = selRec.NumPezzi,
|
|
Priorita = selRec.Priorita,
|
|
PzPallet = selRec.PzPallet,
|
|
Tcassegnato = selRec.Tcassegnato,
|
|
Recipe = selRec.Recipe
|
|
};
|
|
return newRec;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Clona un POdleExt a POdl
|
|
/// </summary>
|
|
/// <param name="selRec"></param>
|
|
/// <returns></returns>
|
|
public static PODLModel convertToPOdl(PODLExpModel selRec)
|
|
{
|
|
// creo record duplicato...
|
|
PODLModel newRec = new PODLModel()
|
|
{
|
|
Attivabile = selRec.Attivabile,
|
|
CodArticolo = selRec.CodArticolo,
|
|
CodCli = selRec.CodCli,
|
|
CodGruppo = selRec.CodGruppo,
|
|
DueDate = selRec.DueDate,
|
|
IdxMacchina = selRec.IdxMacchina,
|
|
IdxOdl = selRec.IdxOdl,
|
|
IdxPromessa = selRec.IdxPromessa,
|
|
InsertDate = selRec.InsertDate,
|
|
KeyBCode = selRec.KeyBCode,
|
|
KeyRichiesta = selRec.KeyRichiesta,
|
|
Note = selRec.Note,
|
|
NumPezzi = selRec.NumPezzi,
|
|
Priorita = selRec.Priorita,
|
|
PzPallet = selRec.PzPallet,
|
|
Tcassegnato = selRec.Tcassegnato,
|
|
Recipe = selRec.Recipe
|
|
};
|
|
return newRec;
|
|
}
|
|
|
|
#endregion Public Methods
|
|
}
|
|
|
|
#endregion Public Classes
|
|
}
|
|
} |