diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index 62ade78..1462aae 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -15,12 +15,75 @@ namespace AppData /// public class ComLib { - #region Gestione persistenza risposte via REST da NESTING + #region Private Fields /// /// Database corrente MongoDB /// - IMongoDatabase database; + private IMongoDatabase database; + + #endregion Private Fields + + #region Protected Fields + + /// + /// Chiave primo bunk su redis + /// + protected static string redAllNextBunkKey = $"{redProdReq}:NextBunk"; + + /// + /// Chiave primo bunk su redis + /// + protected static string redFirstBunkKey = $"{redProdReq}:FirstBunk"; + + /// + /// TTL standard x dati da scambiare con PROD (30 gg) + /// + protected static int ttlProdData = 3600 * 24 * 30; + + #endregion Protected Fields + + #region Public Fields + + /// + /// Classe impiego sstatico ComLib... + /// + public static ComLib man = new ComLib(); + + public static string redMachUnloadCount = "NKC:SERV:MACH_UNLOAD:COUNT"; + + public static string redMachUnloadForce = "NKC:SERV:MACH_UNLOAD:FORCERELOAD"; + + public static string redMLCurrBunk = "NKC:SERV:TAKT:CurrBunk"; + + public static string redMsgCount = "NKC:SERV:BREQ:MCount"; + + public static string redMsgList = "NKC:SERV:BREQ:MList"; + + public static string redNestAnsw = "NKC:NEST:BANSW"; + + public static string redOutPath = "NKC:SERV:BREQ"; + + public static string redProdAnsw = "NKC:PROD:BUNKS"; + + public static string redProdReq = "NKC:SERV:BUNKS"; + + /// + /// chaive redis x cache conteggio coda PJQ + /// + public static string redQueueCount = "NKC:SERV:PJQ"; + + /// + /// chaive redis x cache conteggio coda PJQ composta da tante code + /// + public static string redQueueCountSet = "NKC:SERV:PJQCOUNT"; + + public static string redSecScreenReq = "NKC:SECSCREEN:REQ"; + + #endregion Public Fields + + #region Public Constructors + /// /// Init classe ComLib /// @@ -28,243 +91,583 @@ namespace AppData { database = memLayer.ML.getMongoDatabase("NKC"); } - /// - /// Classe impiego sstatico ComLib... - /// - public static ComLib man = new ComLib(); + + #endregion Public Constructors + + #region Private Properties /// - /// Salva una risposta ricevuta x STIMA + /// Cache redis del PRIMO bunk da lavorare /// - /// Stringa della risposta JSON ricevuta dal nesting - /// - public bool saveEstAnsw(nestReplyBatchInitial nestAnsw) + private static ProdBunk redisFirstBunk { - bool answ = false; - try + get { - // definisco filtro - var filtBuilder = Builders.Filter; - var filter = filtBuilder.Eq("BatchID", nestAnsw.BatchID); - var collRawData = database.GetCollection("EstimationArchive"); - // elimino old - collRawData.DeleteMany(filter); - // aggiungo - collRawData.InsertOne(nestAnsw); - - answ = true; - } - catch - { } - return answ; - } - /// - /// Salva una risposta ricevuta x NESTING - /// - /// Stringa della risposta JSON ricevuta dal nesting - /// - public bool saveNestAnsw(nestReplyBatchFinal nestAnsw) - { - bool answ = false; - try - { - // definisco filtro - var filtBuilder = Builders.Filter; - var filter = filtBuilder.Eq("BatchID", nestAnsw.BatchID); - var collRawData = database.GetCollection("NestingArchive"); - // elimino old - collRawData.DeleteMany(filter); - // aggiungo - collRawData.InsertOne(nestAnsw); - answ = true; - } - catch - { } - return answ; - } - /// - /// Salva una risposta ricevuta x OfflineOrder - /// - /// Stringa della risposta JSON ricevuta dal nesting - /// - public bool saveOffOrdAnsw(nestReplyOffOrd offOrdAnsw) - { - bool answ = false; - try - { - // definisco filtro - var filtBuilder = Builders.Filter; - var filter = filtBuilder.Eq("BatchID", offOrdAnsw.BatchID); - var collRawData = database.GetCollection("OfflineArchive"); - // elimino old - collRawData.DeleteMany(filter); - // aggiungo - collRawData.InsertOne(offOrdAnsw); - - answ = true; - } - catch - { } - return answ; - } - /// - /// Recupero risposta stima salvata - /// - /// - /// - public nestReplyBatchInitial getEstAnsw(int BatchID) - { - nestReplyBatchInitial answ = null; - try - { - // definisco filtro - var filtBuilder = Builders.Filter; - var filter = filtBuilder.Eq("BatchID", BatchID); - var collRawData = database.GetCollection("EstimationArchive"); - // recupero - answ = collRawData.Find(filter).Project("{_id: 0}").FirstOrDefault(); - } - catch - { } - return answ; - } - /// - /// Recupero risposta nesting salvata - /// - /// - /// - public nestReplyBatchFinal getNestAnsw(int BatchID) - { - nestReplyBatchFinal answ = null; - try - { - // definisco filtro - var filtBuilder = Builders.Filter; - var filter = filtBuilder.Eq("BatchID", BatchID); - FindOptions opz = new FindOptions { ShowRecordId = false }; - var collRawData = database.GetCollection("NestingArchive"); - // recupero - answ = collRawData.Find(filter).Project("{_id: 0}").FirstOrDefault(); - } - catch - { } - return answ; - } - - /// - /// restitusice ultima chiamata REST registrata su REDIS - /// - /// - public static string lastRestAnsw() - { - string answ = ""; - // recupero ultima call - string redKey = $"{redNestAnsw}:LAST_CALL"; - answ = memLayer.ML.getRSV(redKey); - return answ; - } - - - /// - /// Salva una risposta ricevuta dal PROD - /// - /// Stringa della risposta JSON ricevuta dal PROD - /// - public bool saveProdAnsw(SheetWorkList prodAnsw) - { - bool answ = false; - try - { - // definisco filtro - var filtBuilder = Builders.Filter; - // filtro vuoto x svuotare sempre - var filter = filtBuilder.Empty; - var collRawData = database.GetCollection("ProdArchive"); - // elimino old (TUTTI!!!) - collRawData.DeleteMany(filter); - // aggiungo - collRawData.InsertOne(prodAnsw); - // fatto! - answ = true; - } - catch - { } - return answ; - } - - #endregion - - /// - /// Wrapper traduzione termini - /// - /// - /// - public static string traduci(string lemma) - { - return user_std.UtSn.Traduci(lemma); - } - - #region conf posizioni redis - - public static string redOutPath = "NKC:SERV:BREQ"; - public static string redMsgCount = "NKC:SERV:BREQ:MCount"; - public static string redMsgList = "NKC:SERV:BREQ:MList"; - public static string redMLCurrBunk = "NKC:SERV:TAKT:CurrBunk"; - - public static string redNestAnsw = "NKC:NEST:BANSW"; - - public static string redProdReq = "NKC:SERV:BUNKS"; - public static string redProdAnsw = "NKC:PROD:BUNKS"; - public static string redSecScreenReq = "NKC:SECSCREEN:REQ"; - - public static string redMachUnloadCount = "NKC:SERV:MACH_UNLOAD:COUNT"; - public static string redMachUnloadForce = "NKC:SERV:MACH_UNLOAD:FORCERELOAD"; - - - /// - /// chaive redis x cache conteggio coda PJQ - /// - public static string redQueueCount = "NKC:SERV:PJQ"; - /// - /// chaive redis x cache conteggio coda PJQ composta da tante code - /// - public static string redQueueCountSet = "NKC:SERV:PJQCOUNT"; - - #endregion - - #region definizione classi impiegate con PROD - - public static string PositionStatusDescr(object value) - { - string answ = ""; - try - { - BatchPosition pStatus = (BatchPosition)Enum.Parse(typeof(BatchPosition), value.ToString()); - switch (pStatus) + ProdBunk answ = null; + string rawData = memLayer.ML.getRSV(redFirstBunkKey); + if (!string.IsNullOrEmpty(rawData)) { - case BatchPosition.NotStarted: - answ = traduci("NotStarted"); - break; - case BatchPosition.StackStarted: - answ = traduci("Stacking"); - break; - case BatchPosition.StackDone: - answ = traduci("StackDone"); - break; - case BatchPosition.Current: - answ = traduci("BatchCurrent"); - break; - case BatchPosition.Completed: - answ = traduci("BatchCompleted"); - break; - default: - break; + // provo a deserializzare + try + { + answ = JsonConvert.DeserializeObject(rawData); + } + catch + { } + } + return answ; + } + set + { + if (value != null) + { + string redVal = JsonConvert.SerializeObject(value); + // default lascio x 5 minuti... + memLayer.ML.setRSV(redFirstBunkKey, redVal, ttlProdData); + } + else + // se null elimino da redis + { + memLayer.ML.setRSV(redFirstBunkKey, ""); + // elimino TUTTI i next... + memLayer.ML.redFlushKey(redAllNextBunkKey); + // imposto force reload UNLOAD + setReloadMU(); + } + } + } + + #endregion Private Properties + + #region Protected Properties + + /// + /// Recupera prossimo batch da DB (NEXT... da db x status... ok SOLO x singola macchina) + /// + protected int getNextBatch + { + get + { + DataLayer DLMan = new DataLayer(); + int answ = 0; + try + { + var currData = DLMan.taBL.getNextAvailable(); + if (currData.Count > 0) + { + answ = currData[0].BatchID; + } + } + catch + { } + return answ; + } + } + + #endregion Protected Properties + + #region Public Properties + + /// + /// verifica se sia avviabile un nuovo task nesting controllando cache Redis o tabelle batch/offlineOrders + /// + public static bool canStartNew + { + get + { + DataLayer DLMan = new DataLayer(); + bool answ = false; + bool valido = false; + // cerco in redis + if (memLayer.ML.redKeyPresent(canStartNewKey)) + { + string rawData = memLayer.ML.getRSV(canStartNewKey); + valido = bool.TryParse(rawData, out answ); + } + if (!valido) + { + // in primis controllo SE ci siano task running, nel qual caso è false e basta... + int numEst = DLMan.taBL.getByStatus((int)BatchStatus.EstimationRequested, "", 0).Count; + int numNest = DLMan.taBL.getByStatus((int)BatchStatus.NestRequested, "", 0).Count; + // ora controllo anche offline orders... + int numOffOrd = DLMan.taOffOL.getRunning().Count; + // ora la somma di tutti DEVE essere zero... + answ = ((numEst + numNest + numOffOrd) == 0); + // salvo in redis + memLayer.ML.setRSV(canStartNewKey, answ.ToString(), 2); + } + return answ; + } + } + + public static string canStartNewKey + { + get + { + return $"{redOutPath}:CanStartNew"; + } + } + + /// + /// Valore della richiesta corrente di elaborazione batch + /// + public static string currBatchReq + { + get + { + return memLayer.ML.getRSV(currBatchReqKey); + } + set + { + // scrivo su REDIS + memLayer.ML.setRSV(currBatchReqKey, value); + } + } + + public static string currBatchReqKey + { + get + { + return $"{redOutPath}:CURR"; + } + } + + /// + /// ID del BUNK correntemente in processing per ML (MachineLoad) + /// + public static string taktMLCurrBunk + { + get + { + return memLayer.ML.getRSV(redMLCurrBunk); + } + set + { + memLayer.ML.setRSV(redMLCurrBunk, value); + } + } + + #endregion Public Properties + + #region Private Methods + + /// + /// Transcodifica dati da format DB a formato PROD + /// + /// Elenco fogli da DB + /// + private static SheetWorkList convertSheetWorkList(List sheetList) + { + SheetWorkList answ; + List elSheet = new List(); + string nestBasePath = memLayer.ML.CRS("nestBasePath").ToLower(); + string servBasePath = memLayer.ML.CRS("servBasePath").ToLower(); + string prodBasePath = memLayer.ML.CRS("prodBasePath").ToLower(); + DateTime dataStart = DateTime.Now; + ProdSheetExt currPanel; + // ciclo elenco fogli x escludere lavorati... + foreach (var item in sheetList) + { + // converto i workData con check null sul campo data + WorkData wdPrint = new WorkData() + { + DtStart = item.IsPrntStartNull() ? null : (DateTime?)item.PrntStart, + DtEnd = item.IsPrntEndNull() ? null : (DateTime?)item.PrntEnd, + ProgramPath = item.PrintFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) + }; + WorkData wdMachining = new WorkData() + { + DtStart = item.IsWrkStartNull() ? null : (DateTime?)item.WrkStart, + DtEnd = item.IsWrkEndNull() ? null : (DateTime?)item.WrkEnd, + ProgramPath = item.CncFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) + }; + WorkData wdUnload = new WorkData() + { + DtStart = item.IsUnlStartNull() ? null : (DateTime?)item.UnlStart, + DtEnd = item.IsUnlEndNull() ? null : (DateTime?)item.UnlEnd + }; + MaterialData material = new MaterialData() + { + MaterialId = item.MatID, + MaterialDescription = item.MatDesc, + MaterialPN = item.MatExtCode.ToString() + }; + PStatus currPnlStatus = PStatus.Programmed; + Enum.TryParse(item.ShStatus.ToString(), out currPnlStatus); + currPanel = new ProdSheetExt() + { + BunkId = item.StackID, + Printing = wdPrint, + Machining = wdMachining, + Material = material, + SheetId = item.SheetID, + SheetIndex = item.SheetIndex, + Status = currPnlStatus, + Unloading = wdUnload + }; + elSheet.Add(currPanel); + if (!item.IsPrntStartNull()) + { + dataStart = item.PrntStart < dataStart ? item.PrntStart : dataStart; + } + } + // compongo il bunk... + answ = new SheetWorkList() + { + SheetList = elSheet + }; + return answ; + } + + /// + /// Recupera e transcodifica DA DB i dati di UN SINGOLO bunk + /// + /// + /// + private static ProdBunk getBunkFromDb(DS_App.StackListRow currBunk) + { + DataLayer DLMan = new DataLayer(); + ProdBunk answ; + // calcolo attributi oggetti + CStatus currSt = CStatus.Programmed; + if (currBunk.Position == 5) + { + currSt = CStatus.Running; + } + else + { + currSt = CStatus.Done; + } + List elSheet = new List(); + // recupero gli sheets di questo stack... + DS_App.SheetListDataTable tabSheets = DLMan.taSHL.getByStack(currBunk.StackID); + DateTime dataStart = DateTime.Now; + ProdSheet currPanel; + string nestBasePath = memLayer.ML.CRS("nestBasePath").ToLower(); + string servBasePath = memLayer.ML.CRS("servBasePath").ToLower(); + string prodBasePath = memLayer.ML.CRS("prodBasePath").ToLower(); + foreach (var item in tabSheets) + { + // converto i workData con check null sul campo data + WorkData wdPrint = new WorkData() + { + DtStart = item.IsPrntStartNull() ? null : (DateTime?)item.PrntStart, + DtEnd = item.IsPrntEndNull() ? null : (DateTime?)item.PrntEnd, + ProgramPath = item.PrintFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) + }; + WorkData wdMachining = new WorkData() + { + DtStart = item.IsWrkStartNull() ? null : (DateTime?)item.WrkStart, + DtEnd = item.IsWrkEndNull() ? null : (DateTime?)item.WrkEnd, + ProgramPath = item.CncFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) + }; + WorkData wdUnload = new WorkData() + { + DtStart = item.IsUnlStartNull() ? null : (DateTime?)item.UnlStart, + DtEnd = item.IsUnlEndNull() ? null : (DateTime?)item.UnlEnd + }; + MaterialData material = new MaterialData() + { + MaterialId = item.MatID, + MaterialDescription = item.MatDesc, + MaterialPN = item.MatExtCode.ToString() + }; + PStatus currPnlStatus = PStatus.Programmed; + Enum.TryParse(item.ShStatus.ToString(), out currPnlStatus); + currPanel = new ProdSheet() + { + Printing = wdPrint, + Machining = wdMachining, + Unloading = wdUnload, + Material = material, + SheetId = item.SheetID, + Status = currPnlStatus + }; + elSheet.Add(currPanel); + if (!item.IsPrntStartNull()) + { + dataStart = item.PrntStart < dataStart ? item.PrntStart : dataStart; + } + } + // compongo il bunk... + answ = new ProdBunk() + { + BunkId = currBunk.StackID, + Status = currSt, + DataMatrix = currBunk.StackDtmx, + SheetList = elSheet, + DtStart = dataStart + }; + return answ; + } + + /// + /// Recupero da Redis del SUCCESSIVO bunk da lavorare + /// + /// + /// + private static ProdBunk getRedisNextBunk(int currBunkId) + { + ProdBunk answ = null; + string rawData = memLayer.ML.getRSV(redNextBunkKey(currBunkId)); + if (rawData != "") + { + // provo a deserializzare + try + { + answ = JsonConvert.DeserializeObject(rawData); + } + catch + { } + } + return answ; + } + + /// + /// Salvo in Redis il SUCCESSIVO bunk da lavorare + /// + /// + /// + private static void setRedisNextBunk(int currBunkId, ProdBunk value) + { + if (value != null) + { + string redVal = JsonConvert.SerializeObject(value); + // default lascio x 5 minuti... + memLayer.ML.setRSV(redNextBunkKey(currBunkId), redVal, ttlProdData); + } + else + // se null elimino da redis + { + memLayer.ML.setRSV(redNextBunkKey(currBunkId), ""); + } + } + + #endregion Private Methods + + #region Protected Methods + + /// + /// lettura currBunk table da cache + /// + /// + /// + protected static DS_App.StackListDataTable getCurrBunkTab(string machine) + { + DS_App.StackListDataTable answ = null; + string rawData = memLayer.ML.getRSV(redCurrBunkTabKey(machine)); + if (!string.IsNullOrEmpty(rawData)) + { + try + { + // deserializzo... + answ = JsonConvert.DeserializeObject(rawData); + } + catch + { } + } + return answ; + } + + /// + /// Recupero da redis tab fogli correnti + /// + protected static DS_App.SheetListDataTable getCurrSheetTab(string machine) + { + DS_App.SheetListDataTable answ = null; + string rawData = memLayer.ML.getRSV(redCurrSheetTabKey(machine)); + if (!string.IsNullOrEmpty(rawData)) + { + try + { + // deserializzo... + answ = JsonConvert.DeserializeObject(rawData); + } + catch + { } + } + return answ; + } + + /// + /// Chiave BATCH corrente su redis + /// + /// + /// + protected static string redCurrBatchId(string machine) + { + string answ = ""; + if (string.IsNullOrEmpty(machine)) + { + answ = $"{redProdReq}:CurrBatchID"; + } + else + { + answ = $"{redProdReq}:CurrBatchID:{machine}"; + } + return answ; + } + + /// + /// Chiave Bunk corrente su redis + /// + /// + /// + protected static string redCurrBunkId(string machine) + { + string answ = ""; + if (string.IsNullOrEmpty(machine)) + { + answ = $"{redProdReq}:CurrBunkID"; + } + else + { + answ = $"{redProdReq}:CurrBunkID:{machine}"; + } + return answ; + } + + /// + /// Chiave bunk corrente su redis + /// + /// + /// + protected static string redCurrBunkTabKey(string machine) + { + string answ = ""; + if (string.IsNullOrEmpty(machine)) + { + answ = $"{redProdReq}:CurrBunks"; + } + else + { + answ = $"{redProdReq}:CurrBunks:{machine}"; + } + return answ; + } + + /// + /// Chiave Sheets corrente su redis + /// + /// + /// + protected static string redCurrSheetId(string machine) + { + string answ = ""; + if (string.IsNullOrEmpty(machine)) + { + answ = $"{redProdReq}:CurrSheetID"; + } + else + { + answ = $"{redProdReq}:CurrSheetID:{machine}"; + } + return answ; + } + + /// + /// Chiave sheets correnti su redis + /// + /// + /// + protected static string redCurrSheetTabKey(string machine) + { + string answ = ""; + if (string.IsNullOrEmpty(machine)) + { + answ = $"{redProdReq}:CurrSheets"; + } + else + { + answ = $"{redProdReq}:CurrSheets:{machine}"; + } + return answ; + } + + /// + /// Chiave primo bunk su redis + /// + protected static string redNextBunkKey(int BunkID) + { + return $"{redProdReq}:NextBunk:{BunkID}"; + } + + /// + /// salvataggio inc ache currBunk table + /// + /// + /// + protected static void setCurrBunkTab(string machine, DS_App.StackListDataTable tabBunks) + { + string rawData = JsonConvert.SerializeObject(tabBunks); + // TTL 15 sec + memLayer.ML.setRSV(redCurrBunkTabKey(machine), rawData, 15); + } + + /// + /// Salvataggio in redis tab fogli correnti + /// + /// + /// + protected static void setCurrSheetTab(string machine, DS_App.SheetListDataTable tabella) + { + string rawData = JsonConvert.SerializeObject(tabella); + // TTL 5 sec + memLayer.ML.setRSV(redCurrSheetTabKey(machine), rawData, 2); + } + + /// + /// Recupera SHEET da batch e sstati permessi... + /// + /// + /// + /// + /// + protected int getSheetIdByBatch(int BatchID, int minVal, int maxVal) + { + int answ = 0; + try + { + DataLayer DLMan = new DataLayer(); + var tabSheet = DLMan.taSHL.getByMLStatus(BatchID, minVal, maxVal); + if (tabSheet.Count > 0) + { + answ = tabSheet[0].SheetID; } } catch { } return answ; } + + #endregion Protected Methods + + #region Public Methods + + /// + /// Aggiorna revisione indice sheet x BUNK (cambio foglio) + /// + /// + /// + public static long advaceSheetRevByBunk(int BunkID) + { + long answ = 0; + if (BunkID > 0) + { + // recupero da REDIS! + string redKeyExp = memLayer.ML.redHash($"DataExp"); + string redKeyRev = $"{ComLib.machineUnloadBunkArea(BunkID)}:Rev"; + // incremento... + answ = memLayer.ML.setRCntI(redKeyRev); + // se > 999 --> resetto + if (answ > 999) + { + memLayer.ML.resetRCnt(redKeyRev); + } + } + return answ; + } + public static string BatchStatusDescr(object value) { string answ = ""; @@ -276,36 +679,47 @@ namespace AppData case BatchStatus.Imported: answ = traduci("Imported"); break; + case BatchStatus.EstimationRequested: answ = traduci("EstimationRequested"); break; + case BatchStatus.EstimationDone: answ = traduci("EstimationCompleted"); break; + case BatchStatus.NestRequested: answ = traduci("NestingRequested"); break; + case BatchStatus.NestDone: answ = traduci("NestingCompleted"); break; + case BatchStatus.Approved: answ = traduci("NestingApproved"); break; + case BatchStatus.Discarded: answ = traduci("NestingDiscarded"); break; + case BatchStatus.Errors: answ = traduci("NestingPrelimErrors"); break; + case BatchStatus.PartEval: answ = traduci("NestPartEvaluating"); break; + case BatchStatus.PartOk: answ = traduci("NestPartValidated"); break; + case BatchStatus.PartKo: answ = traduci("NestPartNotValidated"); break; + default: answ = traduci("NestStateUnk"); break; @@ -317,76 +731,343 @@ namespace AppData } /// - /// Oggetto globale TAKT - /// - public class Takt - { - /// - /// Codice univoco oggetto TAKT (data.num) - /// - public string TaktId { get; set; } - /// - /// Stato del TAKT - /// - public CStatus Status { get; set; } - /// - /// Elenco degli Stack da lavorare - /// - public List StackList { get; set; } - /// - /// Numero di Stack da lavorare - /// - public int NumStack - { - get - { - int answ = 0; - try - { - answ = StackList.Count; - } - catch - { } - return answ; - } - } - } - - #endregion - - #region definizione classi impiegate con NEST - - - public class Parte - { - public int PartId { get; set; } - public string DataMatrix { get; set; } - public string ExtCode { get; set; } - public string Description { get; set; } - public int MatId { get; set; } - public string PostProc { get; set; } - public string ProcessReq { get; set; } - public string CadFilePath { get; set; } - public int Qty { get; set; } - } - /// - /// Salva su redis l'oggetto dei materiali serializzato + /// Verifica lo stato di una richiesta di esecuzione BATCH x stima/nesting /// + /// OfflineOrder di cui si chiede processing + /// note opzionali /// - public static bool sendMaterials() + public static bool checkBatchReq(int OffOrderID) { bool answ = false; - // leggo tab MATERIALS da DB - DataLayer DLMan = new DataLayer(); - var table = DLMan.taMat.GetData(); - // serializzo - string redVal = JsonConvert.SerializeObject(table); - // salvo - string redKey = $"NKC:SERV:CONF:MATERIALS"; - // scrivo per ora solo su REDIS - memLayer.ML.setRSV(redKey, redVal); + // restituisco ok return answ; } + + /// + /// Verifica lo stato di una richiesta di esecuzione + /// + /// OfflineOrder di cui si chiede processing + /// note opzionali + /// + public static bool checkOfflineOrderReq(int OffOrderID) + { + DataLayer DLMan = new DataLayer(); + bool answ = false; + string typeSearch = "OffOrdCalculation"; + string keyEnv = ""; + // recupero lista dei vari task APERTI... + KeyValuePair[] comAperte = getEnvList(); + // processo x cercare ordine... + foreach (var item in comAperte) + { + // cerco dove sia quello richiesto + if (item.Value.Contains(typeSearch)) + { + // controllo SE sia quello richiesto + if (item.Value == $"{OffOrderID}|{typeSearch}") + { + keyEnv = item.Key; + break; + } + } + } + // controllo e se c'è risposta --> update DB + string redKey = $"{redNestAnsw}:FULL:{keyEnv}"; + string rawAnsw = memLayer.ML.getRSV(redKey); + if (rawAnsw != "") + { + // cerco risposta come stack --> disegno... + var offOrder = deserializeOfflineOrder(rawAnsw); + // se ho in risposta drawing + if (!string.IsNullOrEmpty(offOrder.DrawingPath)) + { + DLMan.taOffOL.updateDrawing(OffOrderID, offOrder.DrawingPath, offOrder.CncPath); + } + } + // restituisco ok + return answ; + } + + /// + /// Deserializza un ordine offline + /// + /// + /// + public static nestReplyOffOrd deserializeOfflineOrder(string rawData) + { + nestReplyOffOrd answ = null; + try + { + answ = JsonConvert.DeserializeObject(rawData); + } + catch + { } + return answ; + } + + /// + /// Helper x deserializzare l'oggetto + /// + /// + /// + public static Takt deserializeTakt(string rawData) + { + Takt answ = JsonConvert.DeserializeObject(rawData); + return answ; + } + + /// + /// Cache redis del BunkID in lavorazione sulla macchina + /// + /// + public static int getCurrBatchId(string macchina) + { + int answ = -1; + string rawData = memLayer.ML.getRSV(redCurrBatchId(macchina)); + int.TryParse(rawData, out answ); + return answ; + } + + /// + /// BUNK corrente (x ora copia di first, poi sarà quello SELEZIONATO tra quelli SELEZIONABILI) + /// + /// + public static DS_App.StackListRow getCurrBunk(string machine = "WRK001") + { + DS_App.StackListRow answ = null; + DS_App.StackListDataTable tabBunk = null; + DataLayer DLMan = new DataLayer(); + // cerco in cache.... + if (getCurrBunkTab(machine) != null) + { + tabBunk = getCurrBunkTab(machine); + } + else + { + tabBunk = DLMan.taSTL.getLoaded(); + // salvo in redis + setCurrBunkTab(machine, tabBunk); + } + if (tabBunk != null && tabBunk.Count > 0) + { + answ = tabBunk[0]; + } + return answ; + } + + /// + /// Cache redis del BunkID in lavorazione sulla macchina + /// + /// + public static int getCurrBunkId(string macchina) + { + int answ = -1; + string rawData = memLayer.ML.getRSV(redCurrBunkId(macchina)); + int.TryParse(rawData, out answ); + return answ; + } + + /// + /// + /// + /// + /// + public static string getCurrentCss(int sheetID) + { + DataLayer DLMan = new DataLayer(); + // area REDIS! + string redKeyBase = $"{machineUnloadArea(sheetID)}"; + // TTL standard + int dataCacheTTL = memLayer.ML.cdvi("cssCacheTTL"); + dataCacheTTL = dataCacheTTL <= 0 ? 60 : dataCacheTTL; + // files + string filename = HttpContext.Current.Server.MapPath("~/Content/SheetColor.css"); + string answ = File.ReadAllText(filename); + // solo se sheet > 0... + if (sheetID > 0) + { + try + { + // elenco items da foglio!!! + var tabItems = DLMan.taIL.getBySheet(sheetID); + List itemsAll = new List(); + List itemsDepo = new List(); + List itemsCart = new List(); + List itemsBin = new List(); + List itemsSecOp = new List(); + List itemsScrap = new List(); + List itemsSelect = new List(); + + //se ho items... + if (tabItems.Count > 0) + { + // ciclo! + foreach (var item in tabItems) + { + // aggiungoncomunque a lista generale... + itemsAll.Add(item.ItemDtmx); + // controllo se sia SCRAP + if (item.StatusID >= 990) + { + itemsScrap.Add(item.ItemDtmx); + } + // controllo SE sia stato depositato... check status 3/4 + else if (item.StatusID == 3 || item.StatusID == 4) + { + itemsDepo.Add(item.ItemDtmx); + } + else if (item.ProcessesReq.Contains("PaintFlag")) + { + itemsBin.Add(item.ItemDtmx); + } + else + { + itemsCart.Add(item.ItemDtmx); + } + // controllo ANCHE postprocessing + if (item.PostProcList != "") + { + itemsSecOp.Add(item.ItemDtmx); + } + // se selezionato status 2... + if (item.StatusID == 2) + { + itemsSelect.Add(item.ItemDtmx); + } + } + } + + // FIX BIN + answ = updateCssByItemList(answ, redKeyBase, "ItemsBin", itemsBin, dataCacheTTL); + + // FIX CART + answ = updateCssByItemList(answ, redKeyBase, "ItemsCart", itemsCart, dataCacheTTL); + + // FIX Scaricati + answ = updateCssByItemList(answ, redKeyBase, "ItemsDepo", itemsDepo, dataCacheTTL); + + // FIX SEC-OP + answ = updateCssByItemList(answ, redKeyBase, "ItemsSecOp", itemsSecOp, dataCacheTTL); + + // FIX SCRAP + answ = updateCssByItemList(answ, redKeyBase, "ItemsScrap", itemsScrap, dataCacheTTL); + + // FIXED SEL da array oggetti selezionati... + answ = updateCssByItemList(answ, redKeyBase, "ItemsSel", itemsSelect, dataCacheTTL); + //answ = updateCssByPickedItems(answ, redKeyBase, "ItemsSel", dataCacheTTL); + + // INFINE serializzo e salvo tutti gli items trovati... + string serVal = JsonConvert.SerializeObject(itemsAll); + memLayer.ML.setRSV($"{redKeyBase}:ItemsAll", serVal, dataCacheTTL); + + // salvo redis css! + memLayer.ML.setRSV($"{redKeyBase}:Css", answ, dataCacheTTL); + } + catch + { } + } + + return answ; + } + + /// + /// PackList corrente (running in KIT) + /// + /// + public static DS_App.PackListRow getCurrPackList() + { + DataLayer DLMan = new DataLayer(); + DS_App.PackListRow answ = null; + var tabPLD = DLMan.taPL.getRunning(); + if (tabPLD.Count > 0) + { + answ = tabPLD[0]; + } + return answ; + } + + /// + /// Recupera lo sheet corrente da un BUNK come quello in status 5... + /// + /// + /// + /// + public static DS_App.SheetListRow getCurrSheet(int BatchID, string machine) + { + DS_App.SheetListRow answ = null; + if (BatchID > 0) + { + try + { + DS_App.SheetListDataTable tabSheets = null; + // cerco in cache.... + if (getCurrSheetTab(machine) != null) + { + tabSheets = getCurrSheetTab(machine); + } + else + { + // recupero sheet corrente da Bunk... + DataLayer DLMan = new DataLayer(); + tabSheets = DLMan.taSHL.getByMLStatus(BatchID, 5, 5); + // salvo in redis + setCurrSheetTab(machine, tabSheets); + } + // leggo prima riga --> foglio corrente + if (tabSheets != null && tabSheets.Count > 0) + { + answ = tabSheets[0]; + } + } + catch + { } + } + return answ; + } + + /// + /// Cache redis del SheetID in lavorazione sulla macchina + /// + /// + public static int getCurrSheetId(string macchina) + { + int answ = -1; + string rawData = memLayer.ML.getRSV(redCurrSheetId(macchina)); + int.TryParse(rawData, out answ); + return answ; + } + + /// + /// Restituisce elenco KVP delle buste ancora "pending" (quando processate le elimina da elenco...) + /// + /// + public static KeyValuePair[] getEnvList() + { + KeyValuePair[] answ = memLayer.ML.redGetHash(redMsgList); + return answ; + } + + /// + /// IP del device + /// + /// + public static string GetIPAddress() + { + HttpContext context = HttpContext.Current; + string ipAddress = context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; + + if (!string.IsNullOrEmpty(ipAddress)) + { + string[] addresses = ipAddress.Split(','); + if (addresses.Length != 0) + { + return addresses[0]; + } + } + + return context.Request.ServerVariables["REMOTE_ADDR"]; + } + /// /// Restituisce il prossimo codice di envelope per comunicare con sistemi esterni /// @@ -405,15 +1086,478 @@ namespace AppData // ritorno return answ; } + /// - /// Restituisce elenco KVP delle buste ancora "pending" (quando processate le elimina da elenco...) + /// Recupera file pdf /// + /// /// - public static KeyValuePair[] getEnvList() + public static string getPdfFilePath(Dictionary optParameters) { - KeyValuePair[] answ = memLayer.ML.redGetHash(redMsgList); + string answ = ""; + if (optParameters.ContainsKey("PdfLink")) + { + answ = optParameters["PdfLink"]; + } return answ; } + + /// + /// Recupera le operazioni di PostProcessing, esempio: + /// - T-Nut + /// - Round + /// - Chop + /// + /// + /// + public static string getPostProcList(Dictionary optParameters) + { + string answ = ""; + foreach (var currOpt in optParameters) + { + switch (currOpt.Key) + { + case "ChopAtTab": + case "RoundEdge": + case "TNutFlag": + // se contiene YES aggiungo... + if (currOpt.Value.ToLower() == "yes") + { + answ += $"{currOpt.Key}#"; + } + break; + } + } + // se finisce per "#" trimmo... + if (answ.EndsWith("#")) + { + answ = answ.Substring(0, answ.Length - 1); + } + return answ; + } + + /// + /// Recupera le operazioni RICHIESTE a valle + /// - Paint + /// - Assembly + /// - SecOp + /// + /// + /// + public static string getProcessesReq(Dictionary optParameters) + { + string answ = ""; + foreach (var currOpt in optParameters) + { + switch (currOpt.Key) + { + case "AssemblyCell": + case "PaintFlag": + // se contiene YES aggiungo... + if (currOpt.Value.ToLower() == "yes") + { + answ += $"{currOpt.Key}#"; + } + break; + } + } + // se finisce per "#" trimmo... + if (answ.EndsWith("#")) + { + answ = answ.Substring(0, answ.Length - 1); + } + return answ; + } + + public static int getSecScreenCode() + { + int answ = 0; + Random rnd = new Random(); + answ = rnd.Next(1000000); + return answ; + } + + /// + /// Restitusice il path del PDF richeisto su una data SecScreen come salvato su REDIS + /// + /// cod schermo, formato SSC000000 + /// + public static string getSecScreenRequest(string secScreenCode) + { + string answ = ""; + // recupero ultima call + string redKey = $"{redSecScreenReq}:{secScreenCode}"; + answ = memLayer.ML.getRSV(redKey); + return answ; + } + + /// + /// Recupera da REDIS info indice revisione x BUNK (cambio foglio) + /// + /// + /// + public static int getSheetRevByBunk(int BunkID) + { + int answ = 0; + if (BunkID > 0) + { + // recupero da REDIS! + string redKeyExp = memLayer.ML.redHash($"DataExp"); + string redKeyRev = $"{ComLib.machineUnloadBunkArea(BunkID)}:Rev"; + // controllo expiry globale... se manca SVUOTO area + string rawData = memLayer.ML.getRSV(redKeyExp); + if (string.IsNullOrEmpty(rawData)) + { + // svuoto e scrivo... + memLayer.ML.redFlushKey(memLayer.ML.redHash($"MachineUnload")); + memLayer.ML.redFlushKey(memLayer.ML.redHash($"TabSheets")); + memLayer.ML.setRSV(redKeyExp, $"Reload Data {DateTime.Now}", 3600); + } + answ = memLayer.ML.getRCnt(redKeyRev); + } + return answ; + } + + /// + /// restitusice ultima chiamata REST registrata su REDIS + /// + /// + public static string lastRestAnsw() + { + string answ = ""; + // recupero ultima call + string redKey = $"{redNestAnsw}:LAST_CALL"; + answ = memLayer.ML.getRSV(redKey); + return answ; + } + + /// + /// Calcola area REDIS per MACCHINA + /// + /// + /// + public static string machineArea(string machineCod) + { + string answ = memLayer.ML.redHash($"currMachineData:{machineCod}"); + return answ; + } + + /// + /// Calcola area REDIS per FOGLIO in fase di scarico + /// + /// + /// + public static string machineUnloadArea(int SheetID) + { + // se 0 --> tutto l'albero, sennò solo area corrente... + string answ = ""; + if (SheetID > 0) + { + answ = memLayer.ML.redHash($"MachineUnload:{SheetID}"); + } + else + { + answ = memLayer.ML.redHash($"MachineUnload"); + } + return answ; + } + + /// + /// Calcola area REDIS per BUNK in fase di scarico + /// + /// + /// + public static string machineUnloadBunkArea(int BunkID) + { + // se 0 --> tutto l'albero, sennò solo area corrente... + string answ = ""; + if (BunkID > 0) + { + answ = memLayer.ML.redHash($"MachineUnload:Bunk:{BunkID}"); + } + else + { + answ = memLayer.ML.redHash($"MachineUnload:Bunk"); + } + return answ; + } + + public static string PositionStatusDescr(object value) + { + string answ = ""; + try + { + BatchPosition pStatus = (BatchPosition)Enum.Parse(typeof(BatchPosition), value.ToString()); + switch (pStatus) + { + case BatchPosition.NotStarted: + answ = traduci("NotStarted"); + break; + + case BatchPosition.StackStarted: + answ = traduci("Stacking"); + break; + + case BatchPosition.StackDone: + answ = traduci("StackDone"); + break; + + case BatchPosition.Current: + answ = traduci("BatchCurrent"); + break; + + case BatchPosition.Completed: + answ = traduci("BatchCompleted"); + break; + + default: + break; + } + } + catch + { } + return answ; + } + + /// + /// Esegue richieste lettura da PROD + /// + public static void procProdReadReq() + { + // !!!FIXME!!! + } + + /// + /// Esegue richieste scrittura da PROD + /// + public static void procProdWriteReq() + { + // !!!FIXME!!! + } + + /// + /// Recupera e transcodifica DA DB i dati di UN SINGOLO bunk + /// + /// + /// + public static ProdBunk prodGetBunk(int StackID) + { + DataLayer DLMan = new DataLayer(); + ProdBunk answ = null; + List elSheet = new List(); + var tabBunks = DLMan.taSTL.getByKey(StackID); + if (tabBunks.Count == 1) + { + DS_App.StackListRow currBunk = tabBunks[0]; + // calcolo attributi oggetti + CStatus currSt = CStatus.Programmed; + if (currBunk.Position == 5) + { + currSt = CStatus.Running; + } + else + { + currSt = CStatus.Done; + } + // recupero gli sheets di questo stack... + DS_App.SheetListDataTable tabSheets = DLMan.taSHL.getByStack(StackID); + DateTime dataStart = DateTime.Now; + ProdSheet currPanel; + string nestBasePath = memLayer.ML.CRS("nestBasePath").ToLower(); + string servBasePath = memLayer.ML.CRS("servBasePath").ToLower(); + string prodBasePath = memLayer.ML.CRS("prodBasePath").ToLower(); + foreach (var item in tabSheets) + { + // converto i workData + WorkData wdPrint = new WorkData() + { + DtStart = item.IsPrntStartNull() ? null : (DateTime?)item.PrntStart, + DtEnd = item.IsPrntEndNull() ? null : (DateTime?)item.PrntEnd, + ProgramPath = item.PrintFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) + }; + WorkData wdMachining = new WorkData() + { + DtStart = item.IsWrkStartNull() ? null : (DateTime?)item.WrkStart, + DtEnd = item.IsWrkEndNull() ? null : (DateTime?)item.WrkEnd, + ProgramPath = item.CncFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) + }; + WorkData wdUnload = new WorkData() + { + DtStart = item.IsUnlStartNull() ? null : (DateTime?)item.UnlStart, + DtEnd = item.IsUnlEndNull() ? null : (DateTime?)item.UnlEnd + }; + MaterialData material = new MaterialData() + { + MaterialId = item.MatID, + MaterialDescription = item.MatDesc, + MaterialPN = item.MatExtCode.ToString() + }; + PStatus currPnlStatus = PStatus.Programmed; + Enum.TryParse(item.ShStatus.ToString(), out currPnlStatus); + currPanel = new ProdSheet() + { + Printing = wdPrint, + Machining = wdMachining, + Unloading = wdUnload, + Material = material, + SheetId = item.StackID, + Status = currPnlStatus + }; + elSheet.Add(currPanel); + if (!item.IsPrntStartNull()) + { + dataStart = item.PrntStart < dataStart ? item.PrntStart : dataStart; + } + } + // compongo il bunk... + answ = new ProdBunk() + { + BunkId = currBunk.StackID, + Status = currSt, + DataMatrix = currBunk.StackDtmx, + SheetList = elSheet, + DtStart = dataStart + }; + } + return answ; + } + + /// + /// Restituisce il BUNK che è il primo della lista: + /// - posizione = 3 (ho letto da webApp il BUNK e preso in carico) + /// - NumSheet > NumSheetUnload + /// - Ordinato per StackIndex (crescente) x avere il più VECCHIO + /// + /// + public static ProdBunk prodGetFirstBunk() + { + DataLayer DLMan = new DataLayer(); + // cerco prima su REDIS... + ProdBunk answ = redisFirstBunk; + if (answ == null) + { + // vado sul DB e leggo ... + DS_App.StackListDataTable tabBunks = DLMan.taSTL.getLoaded(); + // controllo di averne almeno 1... + if (tabBunks.Count > 0) + { + DS_App.StackListRow currBunk = tabBunks[0]; + answ = getBunkFromDb(currBunk); + // se ho qualcosa salvo su REDIS + redisFirstBunk = answ; + } + } + return answ; + } + + /// + /// Restituisce il PROSSIMO bunk secondo criterio: + /// - posizione = 5 (ho letto da webApp il BUNK e preso in carico) + /// - NumSheet > NumSheetUnload + /// - Ordinato per StackIndex (crescente) x avere il più VECCHIO + /// - SUCCESSIVO al BunkID(=StackID) ricevuto + /// + /// + public static ProdBunk prodGetNextBunk(int BunkID) + { + DataLayer DLMan = new DataLayer(); + ProdBunk answ = getRedisNextBunk(BunkID); + if (answ == null) + { + // vado sul DB e leggo ... + DS_App.StackListDataTable tabBunks = DLMan.taSTL.getLoaded(); + // controllo di averne almeno 1... + if (tabBunks.Count > 0) + { + DS_App.StackListRow currBunk = null; + bool trovato = false; + // ciclo + foreach (var item in tabBunks) + { + if (trovato) + { + currBunk = item; + break; + } + // controllo se sia quello richiesto + if (item.StackID == BunkID) + { + trovato = true; + } + } + // se c'è un bunk trovato --> carico + if (currBunk != null) + { + answ = getBunkFromDb(currBunk); + // salvo su redis + setRedisNextBunk(BunkID, answ); + } + } + } + return answ; + } + + /// + /// Elenco di sheet in lavorazione su una data macchina: + /// - da macchina recupera il BATCH + /// - dal batch prende i BUNK CARICATI sulla macchina (posizione 5) + /// - filtra i fogli già lavorati + /// + /// + /// + public static SheetWorkList prodGetSheetWorkList(string codPost) + { + DataLayer DLMan = new DataLayer(); + // init out + SheetWorkList answ = null; + // recupero batch corrente + DS_App.BatchListDataTable currBatch = DLMan.taBL.getCurrentByMachine(codPost); + try + { + if (currBatch != null) + { + // come batch DOVREI averne solo 1 in corso... + DS_App.BatchListRow batchRow = currBatch[0]; + // recupero i vari SHEETS del batch... + DS_App.SheetListDataTable sheetTable = DLMan.taSHL.getCurrentByBatch(batchRow.BatchID); + List sheetList = new List(); + // controllo che SIA NULL la data di unload --> NON ancora scaricato + foreach (var item in sheetTable) + { + // metto in elenco SOLO se NON nulla data fine unload + if (item.IsUnlEndNull()) + { + sheetList.Add(item); + } + } + answ = convertSheetWorkList(sheetList); + } + } + catch + { } + return answ; + } + + /// + /// Leggo il Takt inviato + /// + /// Origine del dato: SERV / PROD / NEST + /// + /// + public static Takt readTakt(string origin, string TaktId) + { + Takt answ = null; + try + { + string redKey = $"NKC:{origin.ToUpper()}:TAKT:{TaktId}"; + string redVal = memLayer.ML.getRSV(redKey); + answ = deserializeTakt(redVal); + } + catch + { } + return answ; + } + /// /// resetta la richeista corrente in modo che non ce ne siano altre in coda /// @@ -430,68 +1574,164 @@ namespace AppData { } return answ; } - public static string currBatchReqKey - { - get - { - return $"{redOutPath}:CURR"; - } - } + /// - /// Valore della richiesta corrente di elaborazione batch + /// resetto curr bunk /// - public static string currBatchReq + /// + public static void resetCurrBunk(string machine = "WRK001") { - get - { - return memLayer.ML.getRSV(currBatchReqKey); - } - set - { - // scrivo su REDIS - memLayer.ML.setRSV(currBatchReqKey, value); - } + // svuoto" + memLayer.ML.redFlushKey(redCurrBunkTabKey(machine)); } + /// - /// Manda il primo batch di VALIDAZIONE al NESTING... + /// resetto curr sheets /// + /// + public static void resetCurrSheet(string machine = "WRK001") + { + // svuoto" + memLayer.ML.redFlushKey(redCurrSheetTabKey(machine)); + } + + /// + /// Registra che un dato ITEM è stato prelevato in fase di scarico da ID foglio + datamatrix + /// + /// ID foglio + /// Cod del device di scarico /// - public static bool sendFirstValidationBatch() + public static bool resetItemPickup(int sheetID, string deviceId) { - DataLayer DLMan = new DataLayer(); - bool answ = false; - // verifico se NON CI SIANO GIA' validazioni in corso... - var tabBatchRunning = DLMan.taBL.getByStatus(1, "", 0); - if (tabBatchRunning.Count == 0) + // area REDIS! + string redKeyBase = $"{machineUnloadArea(sheetID)}"; + bool answ = false; + string rawData = memLayer.ML.getRSV($"{redKeyBase}:ItemsSel"); + if (!string.IsNullOrEmpty(rawData)) { - // ora verifico, se ci sono batch in stato 8 (da validare) --> metto in coda! - var tabBatch = DLMan.taBL.getByStatus(8, "", 1); - bool hasValReq = tabBatch.Count > 0; - if (hasValReq) + try { - // invia a redis una richiesta... - sendMaterials(); - // recupero PRIMO batchID da validare - int nextBatchId = 0; - try + Dictionary dictData = JsonConvert.DeserializeObject>(rawData); + // cerco chiave device... + if (dictData.ContainsKey(deviceId)) { - nextBatchId = tabBatch[0].BatchID; - } - catch - { } - if (nextBatchId > 0) - { - // richiedo! - sendBatchReq(nextBatchId, "Estimation", 1); - // registro su DB nesting iniziato... QUANDO MI RISPONDE dovrò verificare che era un batch x VALIDAZIONE - DLMan.taBL.updateStatus(nextBatchId, (int)BatchStatus.EstimationRequested, "", 0); - answ = true; + // sostituisco + dictData.Remove(deviceId); } + // salvo! + rawData = JsonConvert.SerializeObject(dictData); + memLayer.ML.setRSV($"{redKeyBase}:ItemsSel", rawData); + answ = true; } + catch + { } } - // resituisco + // reset memoria redis del CSS x obbligare refresh... + memLayer.ML.setRSV($"{redKeyBase}:Css", ""); return answ; } + + /// + /// Resetto i dati PRIMA di salvare i nuovi dati dal nesting + /// + /// + /// + public static void resetPrevDataFromNesting(int BatchID) + { + //elimino dati child MA NON il batch... + DataLayer DLMan = new DataLayer(); + DLMan.taBL.deleteTree(BatchID, 0); + } + + /// + /// Resetto in REDIS i dati di bunk (corrente e successivi) + /// + public static void resetRedisBunkData(string machine) + { + resetCurrBunk(); + resetCurrSheet(); + setCurrBatchId(machine, 0); + setCurrBunkId(machine, 0); + setCurrSheetId(machine, 0); + redisFirstBunk = null; + } + + /// + /// Annulla (Svuota) richiesta di esecuzione di CAM + /// + /// + public static bool resetRequestToNest() + { + bool answ = false; + + return answ; + } + + /// + /// Registra che un dato ITEM è stato prelevato in fase di scarico da ID foglio + datamatrix + /// + /// ID foglio + /// Cod del device di scarico + /// Cod datamatrix ITEM + /// + public static bool saveItemPickup(int sheetID, string deviceId, string itemDtmx) + { + // area REDIS! + string redKeyBase = $"{machineUnloadArea(sheetID)}"; + bool answ = false; + string rawData = memLayer.ML.getRSV($"{redKeyBase}:ItemsSel"); + Dictionary dictData = new Dictionary(); + try + { + if (!string.IsNullOrEmpty(rawData)) + { + dictData = JsonConvert.DeserializeObject>(rawData); + } + // cerco chiave device... + if (dictData.ContainsKey(deviceId)) + { + // sostituisco + dictData[deviceId] = itemDtmx; + } + else + { + dictData.Add(deviceId, itemDtmx); + } + // salvo! + rawData = JsonConvert.SerializeObject(dictData); + memLayer.ML.setRSV($"{redKeyBase}:ItemsSel", rawData); + answ = true; + // reset memoria redis del CSS x obbligare refresh... + memLayer.ML.setRSV($"{redKeyBase}:Css", ""); + } + catch + { } + return answ; + } + + /// + /// Salvo il Takt inviato + /// + /// Origine del dato: SERV / PROD / NEST + /// + /// + public static bool saveTakt(string origin, Takt currData) + { + bool answ = false; + try + { + // calcolo valori redis + string redKey = $"NKC:{origin.ToUpper()}:TAKT:{currData.TaktId}"; + string redVal = serializeTakt(currData); + // scrivo per ora solo su REDIS + memLayer.ML.setRSV(redKey, redVal); + answ = true; + } + catch + { } + return answ; + } + /// /// Invia una richiesta di esecuzione di Nesting x un Batch /// @@ -505,7 +1745,7 @@ namespace AppData bool answ = false; // per prima cosa mi serve una "nuova busta" per inviare i messaggi string nextEnv = getNextEnv(BatchID, note); - // preparo il contenuto della busta ed invio i messaggi... + // preparo il contenuto della busta ed invio i messaggi... try { // in base allo stato del BATCH corrente determino il tempo e le opzioni da inviare... @@ -607,67 +1847,71 @@ namespace AppData // restituisco ok return answ; } - public static string canStartNewKey - { - get - { - return $"{redOutPath}:CanStartNew"; - } - } + /// - /// verifica se sia avviabile un nuovo task nesting controllando cache Redis o tabelle batch/offlineOrders + /// Manda il primo batch di VALIDAZIONE al NESTING... /// - public static bool canStartNew + /// + public static bool sendFirstValidationBatch() { - get + DataLayer DLMan = new DataLayer(); + bool answ = false; + // verifico se NON CI SIANO GIA' validazioni in corso... + var tabBatchRunning = DLMan.taBL.getByStatus(1, "", 0); + if (tabBatchRunning.Count == 0) { - DataLayer DLMan = new DataLayer(); - bool answ = false; - bool valido = false; - // cerco in redis - if (memLayer.ML.redKeyPresent(canStartNewKey)) + // ora verifico, se ci sono batch per FILE (dxf) VALIDATION in stato 8 (da validare) --> metto in coda! + DS_App.BatchListDataTable tabBatch = DLMan.taBL.getByStatus(8, "", 2); + // se non ne ho cerco nei PartValidation + if (tabBatch.Count == 0) { - string rawData = memLayer.ML.getRSV(canStartNewKey); - valido = bool.TryParse(rawData, out answ); + tabBatch = DLMan.taBL.getByStatus(8, "", 1); } - if (!valido) + if (tabBatch.Count > 0) { - // in primis controllo SE ci siano task running, nel qual caso è false e basta... - int numEst = DLMan.taBL.getByStatus((int)BatchStatus.EstimationRequested, "", 0).Count; - int numNest = DLMan.taBL.getByStatus((int)BatchStatus.NestRequested, "", 0).Count; - // ora controllo anche offline orders... - int numOffOrd = DLMan.taOffOL.getRunning().Count; - // ora la somma di tutti DEVE essere zero... - answ = ((numEst + numNest + numOffOrd) == 0); - // salvo in redis - memLayer.ML.setRSV(canStartNewKey, answ.ToString(), 2); + // invia a redis una richiesta... + sendMaterials(); + // recupero PRIMO batchID da validare + int nextBatchId = 0; + try + { + nextBatchId = tabBatch[0].BatchID; + } + catch + { } + if (nextBatchId > 0) + { + // richiedo! + sendBatchReq(nextBatchId, "Estimation", 1); + // registro su DB nesting iniziato... QUANDO MI RISPONDE dovrò verificare che era un batch x VALIDAZIONE + DLMan.taBL.updateStatus(nextBatchId, (int)BatchStatus.EstimationRequested, "", 0); + answ = true; + } } - return answ; } + // resituisco + return answ; } /// - /// Verifica lo stato di una richiesta di esecuzione BATCH x stima/nesting + /// Salva su redis l'oggetto dei materiali serializzato /// - /// OfflineOrder di cui si chiede processing - /// note opzionali /// - public static bool checkBatchReq(int OffOrderID) + public static bool sendMaterials() { bool answ = false; - // restituisco ok + // leggo tab MATERIALS da DB + DataLayer DLMan = new DataLayer(); + var table = DLMan.taMat.GetData(); + // serializzo + string redVal = JsonConvert.SerializeObject(table); + // salvo + string redKey = $"NKC:SERV:CONF:MATERIALS"; + // scrivo per ora solo su REDIS + memLayer.ML.setRSV(redKey, redVal); return answ; } - /// - /// Annulla (Svuota) richiesta di esecuzione di CAM - /// - /// - public static bool resetRequestToNest() - { - bool answ = false; - return answ; - } /// /// Invia una richiesta di esecuzione di CAM x un ordine offline /// @@ -680,7 +1924,7 @@ namespace AppData bool answ = false; // per prima cosa mi serve una "nuova busta" per inviare i messaggi string nextEnv = getNextEnv(OffOrderID, note); - // preparo il contenuto della busta ed invio i messaggi... + // preparo il contenuto della busta ed invio i messaggi... try { int mTime = 5; @@ -731,8 +1975,6 @@ namespace AppData }; listOrder.Add(currOrder); - - // ora versione gerarchica batchRequest newBatchreq = new batchRequest() { @@ -764,60 +2006,145 @@ namespace AppData } /// - /// Verifica lo stato di una richiesta di esecuzione + /// Helper x serializzare l'oggetto /// - /// OfflineOrder di cui si chiede processing - /// note opzionali + /// /// - public static bool checkOfflineOrderReq(int OffOrderID) + public static string serializeTakt(Takt currData) + { + string answ = JsonConvert.SerializeObject(currData); + return answ; + } + + /// + /// Salvataggio in redis del BunkID in lavorazione sulla macchina + /// + public static void setCurrBatchId(string macchina, int BatchID) + { + memLayer.ML.setRSV(redCurrBatchId(macchina), BatchID.ToString()); + } + + /// + /// Salvataggio in redis del BunkID in lavorazione sulla macchina + /// + public static void setCurrBunkId(string macchina, int BunkID) + { + memLayer.ML.setRSV(redCurrBunkId(macchina), BunkID.ToString()); + } + + /// + /// Salvataggio in redis del SheetID in lavorazione sulla macchina + /// + public static void setCurrSheetId(string macchina, int SheetID) + { + memLayer.ML.setRSV(redCurrSheetId(macchina), SheetID.ToString()); + } + + /// + /// Salva per 5 sec la richiesta di reload delle pagine MachineUnload + /// + public static void setReloadMU() + { + memLayer.ML.setRSV(redMachUnloadForce, "true", 5); + } + + /// + /// Salva su REDIS richiesta visualizzaizone SecondScreen x + /// + /// cod schermo, formato SSC000000 + /// Path file richiesto (pdf) + /// durata in redis della richiesta + /// + public static bool setSecScreenRequest(string secScreenCode, string filePath, int ttl_sec) + { + bool answ = false; + // recupero ultima call + string redKey = $"{redSecScreenReq}:{secScreenCode}"; + answ = memLayer.ML.setRSV(redKey, filePath, ttl_sec); + return answ; + } + + /// + /// Wrapper traduzione termini + /// + /// + /// + public static string traduci(string lemma) + { + return user_std.UtSn.Traduci(lemma); + } + + /// + /// Aggiorna la POSITION del BATCH a aprtire dallo stato DI TUTTI i bunk + /// 0 = not started, 1 = STACKS started, 2 = STACKS done, 3 = Current, 4 = Completed + /// + /// + /// + public static void updateBatchPosition(int BatchID) { DataLayer DLMan = new DataLayer(); - bool answ = false; - string typeSearch = "OffOrdCalculation"; - string keyEnv = ""; - // recupero lista dei vari task APERTI... - KeyValuePair[] comAperte = getEnvList(); - // processo x cercare ordine... - foreach (var item in comAperte) + // chiamo stored x checkPosition + DLMan.taBL.checkPosition(BatchID); + } + + /// + /// Aggiorna la POSITION del BATCH a partire dallo stato dei bunk/stack selezionato + /// 0 = not started, 1 = STACKS started, 2 = STACKS done, 3 = Current, 4 = Completed + /// + /// + /// + public static void updateBatchPositionByBunk(int BunkID) + { + DataLayer DLMan = new DataLayer(); + // recupero il BatchID + DS_App.StackListDataTable tabBunk = DLMan.taSTL.getByKey(BunkID); + if (tabBunk.Count > 0) { - // cerco dove sia quello richiesto - if (item.Value.Contains(typeSearch)) + try { - // controllo SE sia quello richiesto - if (item.Value == $"{OffOrderID}|{typeSearch}") + int BatchID = tabBunk[0].BatchID; + // chiamo procedura di check sull'intero bunk + updateBatchPosition(BatchID); + } + catch + { } + } + } + + /// + /// Salvo dati su PartList ricevuti da Nesting (COMPETATO) + /// + /// + /// + public static void updateBinsFromNesting(int BatchID, List BinList) + { + DataLayer DLMan = new DataLayer(); + // inizio a processare... bunks! + if (BinList != null) + { + foreach (var item in BinList) + { + // creo il BIN! + object newBin = DLMan.taBN.insertAndReturn(item.BinIndex); + int BinID = 0; + bool valOk = int.TryParse(newBin.ToString(), out BinID); + // se ho un BIN in risposta... + if (valOk) { - keyEnv = item.Key; - break; + // processo sheets + if (item.PartList != null) + { + foreach (var part in item.PartList) + { + // creo lo sheet... + var newB2I = DLMan.taBNLS.insertAndReturn(BinID, part.PartId); + } + } } } } - // controllo e se c'è risposta --> update DB - string redKey = $"{redNestAnsw}:FULL:{keyEnv}"; - string rawAnsw = memLayer.ML.getRSV(redKey); - if (rawAnsw != "") - { - // cerco risposta come stack --> disegno... - var offOrder = deserializeOfflineOrder(rawAnsw); - // se ho in risposta drawing - if (!string.IsNullOrEmpty(offOrder.DrawingPath)) - { - DLMan.taOffOL.updateDrawing(OffOrderID, offOrder.DrawingPath, offOrder.CncPath); - } - } - // restituisco ok - return answ; - } - /// - /// Resetto i dati PRIMA di salvare i nuovi dati dal nesting - /// - /// - /// - public static void resetPrevDataFromNesting(int BatchID) - { - //elimino dati child MA NON il batch... - DataLayer DLMan = new DataLayer(); - DLMan.taBL.deleteTree(BatchID, 0); } + /// /// Salvo dati Bunks/Sheets/Parts ricevuti da Nesting (COMPETATO) /// @@ -869,39 +2196,7 @@ namespace AppData } } } - /// - /// Salvo dati su PartList ricevuti da Nesting (COMPETATO) - /// - /// - /// - public static void updateBinsFromNesting(int BatchID, List BinList) - { - DataLayer DLMan = new DataLayer(); - // inizio a processare... bunks! - if (BinList != null) - { - foreach (var item in BinList) - { - // creo il BIN! - object newBin = DLMan.taBN.insertAndReturn(item.BinIndex); - int BinID = 0; - bool valOk = int.TryParse(newBin.ToString(), out BinID); - // se ho un BIN in risposta... - if (valOk) - { - // processo sheets - if (item.PartList != null) - { - foreach (var part in item.PartList) - { - // creo lo sheet... - var newB2I = DLMan.taBNLS.insertAndReturn(BinID, part.PartId); - } - } - } - } - } - } + /// /// Salvo dati su PartList ricevuti da Nesting (COMPETATO) /// @@ -934,1344 +2229,6 @@ namespace AppData } } } - /// - /// Salvo dati su PartList ricevuti da Nesting (stima) - /// - /// - public static void updatePartsFromNesting(List PartList) - { - DataLayer DLMan = new DataLayer(); - string PostProcList = ""; - string ProcessesReq = ""; - string pdfFilePath = ""; - // salvo elenco materiali x ogni item... - foreach (Part currItem in PartList) - { - // calcolo parametri... - PostProcList = getPostProcList(currItem.OptParameters); - ProcessesReq = getProcessesReq(currItem.OptParameters); - pdfFilePath = getPdfFilePath(currItem.OptParameters); - DLMan.taIL.updateFromNesting(currItem.PartId, currItem.MatId, PostProcList, ProcessesReq, pdfFilePath); - } - } - - /// - /// Recupera le operazioni di PostProcessing, esempio: - /// - T-Nut - /// - Round - /// - Chop - /// - /// - /// - public static string getPostProcList(Dictionary optParameters) - { - string answ = ""; - foreach (var currOpt in optParameters) - { - switch (currOpt.Key) - { - case "ChopAtTab": - case "RoundEdge": - case "TNutFlag": - // se contiene YES aggiungo... - if (currOpt.Value.ToLower() == "yes") - { - answ += $"{currOpt.Key}#"; - } - break; - } - } - // se finisce per "#" trimmo... - if (answ.EndsWith("#")) - { - answ = answ.Substring(0, answ.Length - 1); - } - return answ; - } - /// - /// Recupera le operazioni RICHIESTE a valle - /// - Paint - /// - Assembly - /// - SecOp - /// - /// - /// - public static string getProcessesReq(Dictionary optParameters) - { - string answ = ""; - foreach (var currOpt in optParameters) - { - switch (currOpt.Key) - { - case "AssemblyCell": - case "PaintFlag": - // se contiene YES aggiungo... - if (currOpt.Value.ToLower() == "yes") - { - answ += $"{currOpt.Key}#"; - } - break; - } - } - // se finisce per "#" trimmo... - if (answ.EndsWith("#")) - { - answ = answ.Substring(0, answ.Length - 1); - } - return answ; - } - /// - /// Recupera file pdf - /// - /// - /// - public static string getPdfFilePath(Dictionary optParameters) - { - string answ = ""; - if (optParameters.ContainsKey("PdfLink")) - { - answ = optParameters["PdfLink"]; - } - return answ; - } - - #endregion - - #region metodi helper di conversione - - /// - /// Helper x serializzare l'oggetto - /// - /// - /// - public static string serializeTakt(Takt currData) - { - string answ = JsonConvert.SerializeObject(currData); - return answ; - } - /// - /// Helper x deserializzare l'oggetto - /// - /// - /// - public static Takt deserializeTakt(string rawData) - { - Takt answ = JsonConvert.DeserializeObject(rawData); - return answ; - } - /// - /// Deserializza un ordine offline - /// - /// - /// - public static nestReplyOffOrd deserializeOfflineOrder(string rawData) - { - nestReplyOffOrd answ = null; - try - { - answ = JsonConvert.DeserializeObject(rawData); - } - catch - { } - return answ; - } - - #endregion - - #region metodi x data persistence - - /// - /// Salvo il Takt inviato - /// - /// Origine del dato: SERV / PROD / NEST - /// - /// - public static bool saveTakt(string origin, Takt currData) - { - bool answ = false; - try - { - // calcolo valori redis - string redKey = $"NKC:{origin.ToUpper()}:TAKT:{currData.TaktId}"; - string redVal = serializeTakt(currData); - // scrivo per ora solo su REDIS - memLayer.ML.setRSV(redKey, redVal); - answ = true; - } - catch - { } - return answ; - } - - /// - /// Leggo il Takt inviato - /// - /// Origine del dato: SERV / PROD / NEST - /// - /// - public static Takt readTakt(string origin, string TaktId) - { - Takt answ = null; - try - { - string redKey = $"NKC:{origin.ToUpper()}:TAKT:{TaktId}"; - string redVal = memLayer.ML.getRSV(redKey); - answ = deserializeTakt(redVal); - } - catch - { } - return answ; - } - - - - #endregion - - #region metodi per PROD - - /// - /// Salva per 5 sec la richiesta di reload delle pagine MachineUnload - /// - public static void setReloadMU() - { - memLayer.ML.setRSV(redMachUnloadForce, "true", 5); - } - - /// - /// Esegue richieste lettura da PROD - /// - public static void procProdReadReq() - { - // !!!FIXME!!! - } - /// - /// Esegue richieste scrittura da PROD - /// - public static void procProdWriteReq() - { - // !!!FIXME!!! - } - - /// - /// Fornisce il prossimo TAKT da elaborare oppure null se non ce ne fossero altri da elaborare per la data CORRENTE - /// - /// - public Takt prodGetNextTakt() - { - return null; - } - /// - /// Chiave primo bunk su redis - /// - protected static string redFirstBunkKey = $"{redProdReq}:FirstBunk"; - /// - /// Chiave primo bunk su redis - /// - protected static string redAllNextBunkKey = $"{redProdReq}:NextBunk"; - /// - /// TTL standard x dati da scambiare con PROD (30 gg) - /// - protected static int ttlProdData = 3600 * 24 * 30; - /// - /// Chiave primo bunk su redis - /// - protected static string redNextBunkKey(int BunkID) - { - return $"{redProdReq}:NextBunk:{BunkID}"; - } - /// - /// Chiave bunk corrente su redis - /// - /// - /// - protected static string redCurrBunkTabKey(string machine) - { - string answ = ""; - if (string.IsNullOrEmpty(machine)) - { - answ = $"{redProdReq}:CurrBunks"; - } - else - { - answ = $"{redProdReq}:CurrBunks:{machine}"; - } - return answ; - } - /// - /// Chiave sheets correnti su redis - /// - /// - /// - protected static string redCurrSheetTabKey(string machine) - { - string answ = ""; - if (string.IsNullOrEmpty(machine)) - { - answ = $"{redProdReq}:CurrSheets"; - } - else - { - answ = $"{redProdReq}:CurrSheets:{machine}"; - } - return answ; - } - /// - /// Chiave BATCH corrente su redis - /// - /// - /// - protected static string redCurrBatchId(string machine) - { - string answ = ""; - if (string.IsNullOrEmpty(machine)) - { - answ = $"{redProdReq}:CurrBatchID"; - } - else - { - answ = $"{redProdReq}:CurrBatchID:{machine}"; - } - return answ; - } - /// - /// Chiave Bunk corrente su redis - /// - /// - /// - protected static string redCurrBunkId(string machine) - { - string answ = ""; - if (string.IsNullOrEmpty(machine)) - { - answ = $"{redProdReq}:CurrBunkID"; - } - else - { - answ = $"{redProdReq}:CurrBunkID:{machine}"; - } - return answ; - } - /// - /// Chiave Sheets corrente su redis - /// - /// - /// - protected static string redCurrSheetId(string machine) - { - string answ = ""; - if (string.IsNullOrEmpty(machine)) - { - answ = $"{redProdReq}:CurrSheetID"; - } - else - { - answ = $"{redProdReq}:CurrSheetID:{machine}"; - } - return answ; - } - /// - /// Resetto in REDIS i dati di bunk (corrente e successivi) - /// - public static void resetRedisBunkData(string machine) - { - resetCurrBunk(); - resetCurrSheet(); - setCurrBatchId(machine, 0); - setCurrBunkId(machine, 0); - setCurrSheetId(machine, 0); - redisFirstBunk = null; - } - /// - /// Cache redis del BunkID in lavorazione sulla macchina - /// - /// - public static int getCurrBatchId(string macchina) - { - int answ = -1; - string rawData = memLayer.ML.getRSV(redCurrBatchId(macchina)); - int.TryParse(rawData, out answ); - return answ; - } - /// - /// Salvataggio in redis del BunkID in lavorazione sulla macchina - /// - public static void setCurrBatchId(string macchina, int BatchID) - { - memLayer.ML.setRSV(redCurrBatchId(macchina), BatchID.ToString()); - } - /// - /// Cache redis del BunkID in lavorazione sulla macchina - /// - /// - public static int getCurrBunkId(string macchina) - { - int answ = -1; - string rawData = memLayer.ML.getRSV(redCurrBunkId(macchina)); - int.TryParse(rawData, out answ); - return answ; - } - /// - /// Salvataggio in redis del BunkID in lavorazione sulla macchina - /// - public static void setCurrBunkId(string macchina, int BunkID) - { - memLayer.ML.setRSV(redCurrBunkId(macchina), BunkID.ToString()); - } - /// - /// Cache redis del SheetID in lavorazione sulla macchina - /// - /// - public static int getCurrSheetId(string macchina) - { - int answ = -1; - string rawData = memLayer.ML.getRSV(redCurrSheetId(macchina)); - int.TryParse(rawData, out answ); - return answ; - } - /// - /// Salvataggio in redis del SheetID in lavorazione sulla macchina - /// - public static void setCurrSheetId(string macchina, int SheetID) - { - memLayer.ML.setRSV(redCurrSheetId(macchina), SheetID.ToString()); - } - /// - /// Cache redis del PRIMO bunk da lavorare - /// - private static ProdBunk redisFirstBunk - { - get - { - ProdBunk answ = null; - string rawData = memLayer.ML.getRSV(redFirstBunkKey); - if (!string.IsNullOrEmpty(rawData)) - { - // provo a deserializzare - try - { - answ = JsonConvert.DeserializeObject(rawData); - } - catch - { } - } - return answ; - } - set - { - if (value != null) - { - string redVal = JsonConvert.SerializeObject(value); - // default lascio x 5 minuti... - memLayer.ML.setRSV(redFirstBunkKey, redVal, ttlProdData); - } - else - // se null elimino da redis - { - memLayer.ML.setRSV(redFirstBunkKey, ""); - // elimino TUTTI i next... - memLayer.ML.redFlushKey(redAllNextBunkKey); - // imposto force reload UNLOAD - setReloadMU(); - } - } - } - /// - /// Aggiorna la POSITION del BATCH a aprtire dallo stato DI TUTTI i bunk - /// 0 = not started, 1 = STACKS started, 2 = STACKS done, 3 = Current, 4 = Completed - /// - /// - /// - public static void updateBatchPosition(int BatchID) - { - DataLayer DLMan = new DataLayer(); - // chiamo stored x checkPosition - DLMan.taBL.checkPosition(BatchID); - } - /// - /// Aggiorna la POSITION del BATCH a partire dallo stato dei bunk/stack selezionato - /// 0 = not started, 1 = STACKS started, 2 = STACKS done, 3 = Current, 4 = Completed - /// - /// - /// - public static void updateBatchPositionByBunk(int BunkID) - { - DataLayer DLMan = new DataLayer(); - // recupero il BatchID - DS_App.StackListDataTable tabBunk = DLMan.taSTL.getByKey(BunkID); - if (tabBunk.Count > 0) - { - try - { - int BatchID = tabBunk[0].BatchID; - // chiamo procedura di check sull'intero bunk - updateBatchPosition(BatchID); - } - catch - { } - } - } - /// - /// Recupero da Redis del SUCCESSIVO bunk da lavorare - /// - /// - /// - private static ProdBunk getRedisNextBunk(int currBunkId) - { - ProdBunk answ = null; - string rawData = memLayer.ML.getRSV(redNextBunkKey(currBunkId)); - if (rawData != "") - { - // provo a deserializzare - try - { - answ = JsonConvert.DeserializeObject(rawData); - } - catch - { } - } - return answ; - } - /// - /// Salvo in Redis il SUCCESSIVO bunk da lavorare - /// - /// - /// - private static void setRedisNextBunk(int currBunkId, ProdBunk value) - { - if (value != null) - { - string redVal = JsonConvert.SerializeObject(value); - // default lascio x 5 minuti... - memLayer.ML.setRSV(redNextBunkKey(currBunkId), redVal, ttlProdData); - } - else - // se null elimino da redis - { - memLayer.ML.setRSV(redNextBunkKey(currBunkId), ""); - } - } - /// - /// Elenco di sheet in lavorazione su una data macchina: - /// - da macchina recupera il BATCH - /// - dal batch prende i BUNK CARICATI sulla macchina (posizione 5) - /// - filtra i fogli già lavorati - /// - /// - /// - public static SheetWorkList prodGetSheetWorkList(string codPost) - { - DataLayer DLMan = new DataLayer(); - // init out - SheetWorkList answ = null; - // recupero batch corrente - DS_App.BatchListDataTable currBatch = DLMan.taBL.getCurrentByMachine(codPost); - try - { - if (currBatch != null) - { - // come batch DOVREI averne solo 1 in corso... - DS_App.BatchListRow batchRow = currBatch[0]; - // recupero i vari SHEETS del batch... - DS_App.SheetListDataTable sheetTable = DLMan.taSHL.getCurrentByBatch(batchRow.BatchID); - List sheetList = new List(); - // controllo che SIA NULL la data di unload --> NON ancora scaricato - foreach (var item in sheetTable) - { - // metto in elenco SOLO se NON nulla data fine unload - if (item.IsUnlEndNull()) - { - sheetList.Add(item); - } - } - answ = convertSheetWorkList(sheetList); - } - } - catch - { } - return answ; - } - - - /// - /// Rranscodifica dati da format DB a formato PROD - /// - /// Elenco fogli da DB - /// - private static SheetWorkList convertSheetWorkList(List sheetList) - { - SheetWorkList answ; - List elSheet = new List(); - string nestBasePath = memLayer.ML.CRS("nestBasePath").ToLower(); - string servBasePath = memLayer.ML.CRS("servBasePath").ToLower(); - string prodBasePath = memLayer.ML.CRS("prodBasePath").ToLower(); - DateTime dataStart = DateTime.Now; - ProdSheetExt currPanel; - // ciclo elenco fogli x escludere lavorati... - foreach (var item in sheetList) - { - // converto i workData con check null sul campo data - WorkData wdPrint = new WorkData() - { - DtStart = item.IsPrntStartNull() ? null : (DateTime?)item.PrntStart, - DtEnd = item.IsPrntEndNull() ? null : (DateTime?)item.PrntEnd, - ProgramPath = item.PrintFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) - }; - WorkData wdMachining = new WorkData() - { - DtStart = item.IsWrkStartNull() ? null : (DateTime?)item.WrkStart, - DtEnd = item.IsWrkEndNull() ? null : (DateTime?)item.WrkEnd, - ProgramPath = item.CncFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) - }; - WorkData wdUnload = new WorkData() - { - DtStart = item.IsUnlStartNull() ? null : (DateTime?)item.UnlStart, - DtEnd = item.IsUnlEndNull() ? null : (DateTime?)item.UnlEnd - }; - MaterialData material = new MaterialData() - { - MaterialId = item.MatID, - MaterialDescription = item.MatDesc, - MaterialPN = item.MatExtCode.ToString() - }; - PStatus currPnlStatus = PStatus.Programmed; - Enum.TryParse(item.ShStatus.ToString(), out currPnlStatus); - currPanel = new ProdSheetExt() - { - BunkId = item.StackID, - Printing = wdPrint, - Machining = wdMachining, - Material = material, - SheetId = item.SheetID, - SheetIndex = item.SheetIndex, - Status = currPnlStatus, - Unloading = wdUnload - }; - elSheet.Add(currPanel); - if (!item.IsPrntStartNull()) - { - dataStart = item.PrntStart < dataStart ? item.PrntStart : dataStart; - } - } - // compongo il bunk... - answ = new SheetWorkList() - { - SheetList = elSheet - }; - return answ; - } - - - /// - /// Restituisce il BUNK che è il primo della lista: - /// - posizione = 3 (ho letto da webApp il BUNK e preso in carico) - /// - NumSheet > NumSheetUnload - /// - Ordinato per StackIndex (crescente) x avere il più VECCHIO - /// - /// - public static ProdBunk prodGetFirstBunk() - { - DataLayer DLMan = new DataLayer(); - // cerco prima su REDIS... - ProdBunk answ = redisFirstBunk; - if (answ == null) - { - // vado sul DB e leggo ... - DS_App.StackListDataTable tabBunks = DLMan.taSTL.getLoaded(); - // controllo di averne almeno 1... - if (tabBunks.Count > 0) - { - DS_App.StackListRow currBunk = tabBunks[0]; - answ = getBunkFromDb(currBunk); - // se ho qualcosa salvo su REDIS - redisFirstBunk = answ; - } - } - return answ; - } - /// - /// BUNK corrente (x ora copia di first, poi sarà quello SELEZIONATO tra quelli SELEZIONABILI) - /// - /// - public static DS_App.StackListRow getCurrBunk(string machine = "WRK001") - { - DS_App.StackListRow answ = null; - DS_App.StackListDataTable tabBunk = null; - DataLayer DLMan = new DataLayer(); - // cerco in cache.... - if (getCurrBunkTab(machine) != null) - { - tabBunk = getCurrBunkTab(machine); - } - else - { - tabBunk = DLMan.taSTL.getLoaded(); - // salvo in redis - setCurrBunkTab(machine, tabBunk); - } - if (tabBunk != null && tabBunk.Count > 0) - { - answ = tabBunk[0]; - } - return answ; - } - /// - /// resetto curr bunk - /// - /// - public static void resetCurrBunk(string machine = "WRK001") - { - // svuoto" - memLayer.ML.redFlushKey(redCurrBunkTabKey(machine)); - } - /// - /// lettura currBunk table da cache - /// - /// - /// - protected static DS_App.StackListDataTable getCurrBunkTab(string machine) - { - DS_App.StackListDataTable answ = null; - string rawData = memLayer.ML.getRSV(redCurrBunkTabKey(machine)); - if (!string.IsNullOrEmpty(rawData)) - { - try - { - // deserializzo... - answ = JsonConvert.DeserializeObject(rawData); - } - catch - { } - } - return answ; - } - /// - /// salvataggio inc ache currBunk table - /// - /// - /// - protected static void setCurrBunkTab(string machine, DS_App.StackListDataTable tabBunks) - { - string rawData = JsonConvert.SerializeObject(tabBunks); - // TTL 15 sec - memLayer.ML.setRSV(redCurrBunkTabKey(machine), rawData, 15); - } - - /// - /// PackList corrente (running in KIT) - /// - /// - public static DS_App.PackListRow getCurrPackList() - { - DataLayer DLMan = new DataLayer(); - DS_App.PackListRow answ = null; - var tabPLD = DLMan.taPL.getRunning(); - if (tabPLD.Count > 0) - { - answ = tabPLD[0]; - } - return answ; - } - - - /// - /// Recupera lo sheet corrente da un BUNK come quello in status 5... - /// - /// - /// - /// - public static DS_App.SheetListRow getCurrSheet(int BatchID, string machine) - { - DS_App.SheetListRow answ = null; - if (BatchID > 0) - { - try - { - DS_App.SheetListDataTable tabSheets = null; - // cerco in cache.... - if (getCurrSheetTab(machine) != null) - { - tabSheets = getCurrSheetTab(machine); - } - else - { - // recupero sheet corrente da Bunk... - DataLayer DLMan = new DataLayer(); - tabSheets = DLMan.taSHL.getByMLStatus(BatchID, 5, 5); - // salvo in redis - setCurrSheetTab(machine, tabSheets); - } - // leggo prima riga --> foglio corrente - if (tabSheets != null && tabSheets.Count > 0) - { - answ = tabSheets[0]; - } - } - catch - { } - } - return answ; - } - /// - /// resetto curr sheets - /// - /// - public static void resetCurrSheet(string machine = "WRK001") - { - // svuoto" - memLayer.ML.redFlushKey(redCurrSheetTabKey(machine)); - } - /// - /// Recupero da redis tab fogli correnti - /// - protected static DS_App.SheetListDataTable getCurrSheetTab(string machine) - { - DS_App.SheetListDataTable answ = null; - string rawData = memLayer.ML.getRSV(redCurrSheetTabKey(machine)); - if (!string.IsNullOrEmpty(rawData)) - { - try - { - // deserializzo... - answ = JsonConvert.DeserializeObject(rawData); - } - catch - { } - } - return answ; - } - /// - /// Salvataggio in redis tab fogli correnti - /// - /// - /// - protected static void setCurrSheetTab(string machine, DS_App.SheetListDataTable tabella) - { - string rawData = JsonConvert.SerializeObject(tabella); - // TTL 5 sec - memLayer.ML.setRSV(redCurrSheetTabKey(machine), rawData, 2); - } - /// - /// Restituisce il PROSSIMO bunk secondo criterio: - /// - posizione = 5 (ho letto da webApp il BUNK e preso in carico) - /// - NumSheet > NumSheetUnload - /// - Ordinato per StackIndex (crescente) x avere il più VECCHIO - /// - SUCCESSIVO al BunkID(=StackID) ricevuto - /// - /// - public static ProdBunk prodGetNextBunk(int BunkID) - { - DataLayer DLMan = new DataLayer(); - ProdBunk answ = getRedisNextBunk(BunkID); - if (answ == null) - { - // vado sul DB e leggo ... - DS_App.StackListDataTable tabBunks = DLMan.taSTL.getLoaded(); - // controllo di averne almeno 1... - if (tabBunks.Count > 0) - { - DS_App.StackListRow currBunk = null; - bool trovato = false; - // ciclo - foreach (var item in tabBunks) - { - if (trovato) - { - currBunk = item; - break; - } - // controllo se sia quello richiesto - if (item.StackID == BunkID) - { - trovato = true; - } - } - // se c'è un bunk trovato --> carico - if (currBunk != null) - { - answ = getBunkFromDb(currBunk); - // salvo su redis - setRedisNextBunk(BunkID, answ); - } - } - } - return answ; - } - /// - /// Recupera e transcodifica DA DB i dati di UN SINGOLO bunk - /// - /// - /// - private static ProdBunk getBunkFromDb(DS_App.StackListRow currBunk) - { - DataLayer DLMan = new DataLayer(); - ProdBunk answ; - // calcolo attributi oggetti - CStatus currSt = CStatus.Programmed; - if (currBunk.Position == 5) - { - currSt = CStatus.Running; - } - else - { - currSt = CStatus.Done; - } - List elSheet = new List(); - // recupero gli sheets di questo stack... - DS_App.SheetListDataTable tabSheets = DLMan.taSHL.getByStack(currBunk.StackID); - DateTime dataStart = DateTime.Now; - ProdSheet currPanel; - string nestBasePath = memLayer.ML.CRS("nestBasePath").ToLower(); - string servBasePath = memLayer.ML.CRS("servBasePath").ToLower(); - string prodBasePath = memLayer.ML.CRS("prodBasePath").ToLower(); - foreach (var item in tabSheets) - { - // converto i workData con check null sul campo data - WorkData wdPrint = new WorkData() - { - DtStart = item.IsPrntStartNull() ? null : (DateTime?)item.PrntStart, - DtEnd = item.IsPrntEndNull() ? null : (DateTime?)item.PrntEnd, - ProgramPath = item.PrintFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) - }; - WorkData wdMachining = new WorkData() - { - DtStart = item.IsWrkStartNull() ? null : (DateTime?)item.WrkStart, - DtEnd = item.IsWrkEndNull() ? null : (DateTime?)item.WrkEnd, - ProgramPath = item.CncFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) - }; - WorkData wdUnload = new WorkData() - { - DtStart = item.IsUnlStartNull() ? null : (DateTime?)item.UnlStart, - DtEnd = item.IsUnlEndNull() ? null : (DateTime?)item.UnlEnd - }; - MaterialData material = new MaterialData() - { - MaterialId = item.MatID, - MaterialDescription = item.MatDesc, - MaterialPN = item.MatExtCode.ToString() - }; - PStatus currPnlStatus = PStatus.Programmed; - Enum.TryParse(item.ShStatus.ToString(), out currPnlStatus); - currPanel = new ProdSheet() - { - Printing = wdPrint, - Machining = wdMachining, - Unloading = wdUnload, - Material = material, - SheetId = item.SheetID, - Status = currPnlStatus - }; - elSheet.Add(currPanel); - if (!item.IsPrntStartNull()) - { - dataStart = item.PrntStart < dataStart ? item.PrntStart : dataStart; - } - } - // compongo il bunk... - answ = new ProdBunk() - { - BunkId = currBunk.StackID, - Status = currSt, - DataMatrix = currBunk.StackDtmx, - SheetList = elSheet, - DtStart = dataStart - }; - return answ; - } - /// - /// Recupera e transcodifica DA DB i dati di UN SINGOLO bunk - /// - /// - /// - public static ProdBunk prodGetBunk(int StackID) - { - DataLayer DLMan = new DataLayer(); - ProdBunk answ = null; - List elSheet = new List(); - var tabBunks = DLMan.taSTL.getByKey(StackID); - if (tabBunks.Count == 1) - { - DS_App.StackListRow currBunk = tabBunks[0]; - // calcolo attributi oggetti - CStatus currSt = CStatus.Programmed; - if (currBunk.Position == 5) - { - currSt = CStatus.Running; - } - else - { - currSt = CStatus.Done; - } - // recupero gli sheets di questo stack... - DS_App.SheetListDataTable tabSheets = DLMan.taSHL.getByStack(StackID); - DateTime dataStart = DateTime.Now; - ProdSheet currPanel; - string nestBasePath = memLayer.ML.CRS("nestBasePath").ToLower(); - string servBasePath = memLayer.ML.CRS("servBasePath").ToLower(); - string prodBasePath = memLayer.ML.CRS("prodBasePath").ToLower(); - foreach (var item in tabSheets) - { - // converto i workData - WorkData wdPrint = new WorkData() - { - DtStart = item.IsPrntStartNull() ? null : (DateTime?)item.PrntStart, - DtEnd = item.IsPrntEndNull() ? null : (DateTime?)item.PrntEnd, - ProgramPath = item.PrintFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) - }; - WorkData wdMachining = new WorkData() - { - DtStart = item.IsWrkStartNull() ? null : (DateTime?)item.WrkStart, - DtEnd = item.IsWrkEndNull() ? null : (DateTime?)item.WrkEnd, - ProgramPath = item.CncFilePath.ToLower().Replace(nestBasePath, prodBasePath).Replace(servBasePath, prodBasePath) - }; - WorkData wdUnload = new WorkData() - { - DtStart = item.IsUnlStartNull() ? null : (DateTime?)item.UnlStart, - DtEnd = item.IsUnlEndNull() ? null : (DateTime?)item.UnlEnd - }; - MaterialData material = new MaterialData() - { - MaterialId = item.MatID, - MaterialDescription = item.MatDesc, - MaterialPN = item.MatExtCode.ToString() - }; - PStatus currPnlStatus = PStatus.Programmed; - Enum.TryParse(item.ShStatus.ToString(), out currPnlStatus); - currPanel = new ProdSheet() - { - Printing = wdPrint, - Machining = wdMachining, - Unloading = wdUnload, - Material = material, - SheetId = item.StackID, - Status = currPnlStatus - }; - elSheet.Add(currPanel); - if (!item.IsPrntStartNull()) - { - dataStart = item.PrntStart < dataStart ? item.PrntStart : dataStart; - } - } - // compongo il bunk... - answ = new ProdBunk() - { - BunkId = currBunk.StackID, - Status = currSt, - DataMatrix = currBunk.StackDtmx, - SheetList = elSheet, - DtStart = dataStart - }; - } - return answ; - } - /// - /// ID del BUNK correntemente in processing per ML (MachineLoad) - /// - public static string taktMLCurrBunk - { - get - { - return memLayer.ML.getRSV(redMLCurrBunk); - } - set - { - memLayer.ML.setRSV(redMLCurrBunk, value); - } - } - - #endregion - - #region metodi x UNLOAD - - /// - /// Calcola area REDIS per FOGLIO in fase di scarico - /// - /// - /// - public static string machineUnloadArea(int SheetID) - { - // se 0 --> tutto l'albero, sennò solo area corrente... - string answ = ""; - if (SheetID > 0) - { - answ = memLayer.ML.redHash($"MachineUnload:{SheetID}"); - } - else - { - answ = memLayer.ML.redHash($"MachineUnload"); - } - return answ; - } - /// - /// Calcola area REDIS per BUNK in fase di scarico - /// - /// - /// - public static string machineUnloadBunkArea(int BunkID) - { - // se 0 --> tutto l'albero, sennò solo area corrente... - string answ = ""; - if (BunkID > 0) - { - answ = memLayer.ML.redHash($"MachineUnload:Bunk:{BunkID}"); - } - else - { - answ = memLayer.ML.redHash($"MachineUnload:Bunk"); - } - return answ; - } - - - /// - /// Recupera da REDIS info indice revisione x BUNK (cambio foglio) - /// - /// - /// - public static int getSheetRevByBunk(int BunkID) - { - int answ = 0; - if (BunkID > 0) - { - // recupero da REDIS! - string redKeyExp = memLayer.ML.redHash($"DataExp"); - string redKeyRev = $"{ComLib.machineUnloadBunkArea(BunkID)}:Rev"; - // controllo expiry globale... se manca SVUOTO area - string rawData = memLayer.ML.getRSV(redKeyExp); - if (string.IsNullOrEmpty(rawData)) - { - // svuoto e scrivo... - memLayer.ML.redFlushKey(memLayer.ML.redHash($"MachineUnload")); - memLayer.ML.redFlushKey(memLayer.ML.redHash($"TabSheets")); - memLayer.ML.setRSV(redKeyExp, $"Reload Data {DateTime.Now}", 3600); - } - answ = memLayer.ML.getRCnt(redKeyRev); - } - return answ; - } - - - /// - /// Aggiorna revisione indice sheet x BUNK (cambio foglio) - /// - /// - /// - public static long advaceSheetRevByBunk(int BunkID) - { - long answ = 0; - if (BunkID > 0) - { - // recupero da REDIS! - string redKeyExp = memLayer.ML.redHash($"DataExp"); - string redKeyRev = $"{ComLib.machineUnloadBunkArea(BunkID)}:Rev"; - // incremento... - answ = memLayer.ML.setRCntI(redKeyRev); - // se > 999 --> resetto - if (answ > 999) - { - memLayer.ML.resetRCnt(redKeyRev); - } - } - return answ; - } - - - /// - /// Svuota elenco pezzi nella postazione di unload - /// - /// - /// - public bool resetSheetUnload(int SheetID = 0) - { - bool answ = false; - try - { - memLayer.ML.redFlushKey(machineUnloadArea(SheetID)); - answ = true; - } - catch - { } - return answ; - } - /// - /// - /// - /// - /// - public static string getCurrentCss(int sheetID) - { - DataLayer DLMan = new DataLayer(); - // area REDIS! - string redKeyBase = $"{machineUnloadArea(sheetID)}"; - // TTL standard - int dataCacheTTL = memLayer.ML.cdvi("cssCacheTTL"); - dataCacheTTL = dataCacheTTL <= 0 ? 60 : dataCacheTTL; - // files - string filename = HttpContext.Current.Server.MapPath("~/Content/SheetColor.css"); - string answ = File.ReadAllText(filename); - // solo se sheet > 0... - if (sheetID > 0) - { - try - { - // elenco items da foglio!!! - var tabItems = DLMan.taIL.getBySheet(sheetID); - List itemsAll = new List(); - List itemsDepo = new List(); - List itemsCart = new List(); - List itemsBin = new List(); - List itemsSecOp = new List(); - List itemsScrap = new List(); - List itemsSelect = new List(); - - //se ho items... - if (tabItems.Count > 0) - { - // ciclo! - foreach (var item in tabItems) - { - // aggiungoncomunque a lista generale... - itemsAll.Add(item.ItemDtmx); - // controllo se sia SCRAP - if (item.StatusID >= 990) - { - itemsScrap.Add(item.ItemDtmx); - } - // controllo SE sia stato depositato... check status 3/4 - else if (item.StatusID == 3 || item.StatusID == 4) - { - itemsDepo.Add(item.ItemDtmx); - } - else if (item.ProcessesReq.Contains("PaintFlag")) - { - itemsBin.Add(item.ItemDtmx); - } - else - { - itemsCart.Add(item.ItemDtmx); - } - // controllo ANCHE postprocessing - if (item.PostProcList != "") - { - itemsSecOp.Add(item.ItemDtmx); - } - // se selezionato status 2... - if (item.StatusID == 2) - { - itemsSelect.Add(item.ItemDtmx); - } - } - } - - - // FIX BIN - answ = updateCssByItemList(answ, redKeyBase, "ItemsBin", itemsBin, dataCacheTTL); - - // FIX CART - answ = updateCssByItemList(answ, redKeyBase, "ItemsCart", itemsCart, dataCacheTTL); - - // FIX Scaricati - answ = updateCssByItemList(answ, redKeyBase, "ItemsDepo", itemsDepo, dataCacheTTL); - - // FIX SEC-OP - answ = updateCssByItemList(answ, redKeyBase, "ItemsSecOp", itemsSecOp, dataCacheTTL); - - // FIX SCRAP - answ = updateCssByItemList(answ, redKeyBase, "ItemsScrap", itemsScrap, dataCacheTTL); - - // FIXED SEL da array oggetti selezionati... - answ = updateCssByItemList(answ, redKeyBase, "ItemsSel", itemsSelect, dataCacheTTL); - //answ = updateCssByPickedItems(answ, redKeyBase, "ItemsSel", dataCacheTTL); - - - // INFINE serializzo e salvo tutti gli items trovati... - string serVal = JsonConvert.SerializeObject(itemsAll); - memLayer.ML.setRSV($"{redKeyBase}:ItemsAll", serVal, dataCacheTTL); - - // salvo redis css! - memLayer.ML.setRSV($"{redKeyBase}:Css", answ, dataCacheTTL); - } - catch - { } - } - - return answ; - } - /// - /// Registra che un dato ITEM è stato prelevato in fase di scarico da ID foglio + datamatrix - /// - /// ID foglio - /// Cod del device di scarico - /// Cod datamatrix ITEM - /// - public static bool saveItemPickup(int sheetID, string deviceId, string itemDtmx) - { - // area REDIS! - string redKeyBase = $"{machineUnloadArea(sheetID)}"; - bool answ = false; - string rawData = memLayer.ML.getRSV($"{redKeyBase}:ItemsSel"); - Dictionary dictData = new Dictionary(); - try - { - if (!string.IsNullOrEmpty(rawData)) - { - dictData = JsonConvert.DeserializeObject>(rawData); - } - // cerco chiave device... - if (dictData.ContainsKey(deviceId)) - { - // sostituisco - dictData[deviceId] = itemDtmx; - } - else - { - dictData.Add(deviceId, itemDtmx); - } - // salvo! - rawData = JsonConvert.SerializeObject(dictData); - memLayer.ML.setRSV($"{redKeyBase}:ItemsSel", rawData); - answ = true; - // reset memoria redis del CSS x obbligare refresh... - memLayer.ML.setRSV($"{redKeyBase}:Css", ""); - } - catch - { } - return answ; - } - /// - /// Registra che un dato ITEM è stato prelevato in fase di scarico da ID foglio + datamatrix - /// - /// ID foglio - /// Cod del device di scarico - /// - public static bool resetItemPickup(int sheetID, string deviceId) - { - // area REDIS! - string redKeyBase = $"{machineUnloadArea(sheetID)}"; - bool answ = false; - string rawData = memLayer.ML.getRSV($"{redKeyBase}:ItemsSel"); - if (!string.IsNullOrEmpty(rawData)) - { - try - { - Dictionary dictData = JsonConvert.DeserializeObject>(rawData); - // cerco chiave device... - if (dictData.ContainsKey(deviceId)) - { - // sostituisco - dictData.Remove(deviceId); - } - // salvo! - rawData = JsonConvert.SerializeObject(dictData); - memLayer.ML.setRSV($"{redKeyBase}:ItemsSel", rawData); - answ = true; - } - catch - { } - } - // reset memoria redis del CSS x obbligare refresh... - memLayer.ML.setRSV($"{redKeyBase}:Css", ""); - return answ; - } /// /// Processa elenco items e salva in redis valori x css, elenchi, ... @@ -2335,87 +2292,31 @@ namespace AppData } catch { } - } return currCss; } /// - /// IP del device + /// Salvo dati su PartList ricevuti da Nesting (stima) /// - /// - public static string GetIPAddress() + /// + public static void updatePartsFromNesting(List PartList) { - HttpContext context = HttpContext.Current; - string ipAddress = context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; - - if (!string.IsNullOrEmpty(ipAddress)) + DataLayer DLMan = new DataLayer(); + string PostProcList = ""; + string ProcessesReq = ""; + string pdfFilePath = ""; + // salvo elenco materiali x ogni item... + foreach (Part currItem in PartList) { - string[] addresses = ipAddress.Split(','); - if (addresses.Length != 0) - { - return addresses[0]; - } - } - - return context.Request.ServerVariables["REMOTE_ADDR"]; - } - - /// - /// Calcola area REDIS per MACCHINA - /// - /// - /// - public static string machineArea(string machineCod) - { - string answ = memLayer.ML.redHash($"currMachineData:{machineCod}"); - return answ; - } - /// - /// Recupera prossimo batch da DB (NEXT... da db x status... ok SOLO x singola macchina) - /// - protected int getNextBatch - { - get - { - DataLayer DLMan = new DataLayer(); - int answ = 0; - try - { - var currData = DLMan.taBL.getNextAvailable(); - if (currData.Count > 0) - { - answ = currData[0].BatchID; - } - } - catch - { } - return answ; + // calcolo parametri... + PostProcList = getPostProcList(currItem.OptParameters); + ProcessesReq = getProcessesReq(currItem.OptParameters); + pdfFilePath = getPdfFilePath(currItem.OptParameters); + DLMan.taIL.updateFromNesting(currItem.PartId, currItem.MatId, PostProcList, ProcessesReq, pdfFilePath); } } - /// - /// Recupera SHEET da batch e sstati permessi... - /// - /// - /// - /// - /// - protected int getSheetIdByBatch(int BatchID, int minVal, int maxVal) - { - int answ = 0; - try - { - DataLayer DLMan = new DataLayer(); - var tabSheet = DLMan.taSHL.getByMLStatus(BatchID, minVal, maxVal); - if (tabSheet.Count > 0) - { - answ = tabSheet[0].SheetID; - } - } - catch - { } - return answ; - } + /// /// Fornisce un dictionary di valori ATTUALI per una specifica macchina /// @@ -2446,6 +2347,105 @@ namespace AppData // restituisco! return answ; } + + /// + /// Recupero risposta stima salvata + /// + /// + /// + public nestReplyBatchInitial getEstAnsw(int BatchID) + { + nestReplyBatchInitial answ = null; + try + { + // definisco filtro + var filtBuilder = Builders.Filter; + var filter = filtBuilder.Eq("BatchID", BatchID); + var collRawData = database.GetCollection("EstimationArchive"); + // recupero + answ = collRawData.Find(filter).Project("{_id: 0}").FirstOrDefault(); + } + catch + { } + return answ; + } + + /// + /// Recupero risposta nesting salvata + /// + /// + /// + public nestReplyBatchFinal getNestAnsw(int BatchID) + { + nestReplyBatchFinal answ = null; + try + { + // definisco filtro + var filtBuilder = Builders.Filter; + var filter = filtBuilder.Eq("BatchID", BatchID); + FindOptions opz = new FindOptions { ShowRecordId = false }; + var collRawData = database.GetCollection("NestingArchive"); + // recupero + answ = collRawData.Find(filter).Project("{_id: 0}").FirstOrDefault(); + } + catch + { } + return answ; + } + + /// + /// Fornisce il prossimo TAKT da elaborare oppure null se non ce ne fossero altri da elaborare per la data CORRENTE + /// + /// + public Takt prodGetNextTakt() + { + return null; + } + + /// + /// Svuota elenco pezzi nella postazione di unload + /// + /// + /// + public bool resetSheetUnload(int SheetID = 0) + { + bool answ = false; + try + { + memLayer.ML.redFlushKey(machineUnloadArea(SheetID)); + answ = true; + } + catch + { } + return answ; + } + + /// + /// Salva una risposta ricevuta x STIMA + /// + /// Stringa della risposta JSON ricevuta dal nesting + /// + public bool saveEstAnsw(nestReplyBatchInitial nestAnsw) + { + bool answ = false; + try + { + // definisco filtro + var filtBuilder = Builders.Filter; + var filter = filtBuilder.Eq("BatchID", nestAnsw.BatchID); + var collRawData = database.GetCollection("EstimationArchive"); + // elimino old + collRawData.DeleteMany(filter); + // aggiungo + collRawData.InsertOne(nestAnsw); + + answ = true; + } + catch + { } + return answ; + } + /// /// Salvataggio array dati di una macchina /// @@ -2467,6 +2467,7 @@ namespace AppData // restituisco! return answ; } + /// /// Fornisce un dictionary di valori ATTUALI per una specifica macchina /// @@ -2500,48 +2501,148 @@ namespace AppData return answ; } - #endregion - - #region metodi per SecScreen - - public static int getSecScreenCode() - { - int answ = 0; - Random rnd = new Random(); - answ = rnd.Next(1000000); - return answ; - } - /// - /// Restitusice il path del PDF richeisto su una data SecScreen come salvato su REDIS + /// Salva una risposta ricevuta x NESTING /// - /// cod schermo, formato SSC000000 + /// Stringa della risposta JSON ricevuta dal nesting /// - public static string getSecScreenRequest(string secScreenCode) - { - string answ = ""; - // recupero ultima call - string redKey = $"{redSecScreenReq}:{secScreenCode}"; - answ = memLayer.ML.getRSV(redKey); - return answ; - } - /// - /// Salva su REDIS richiesta visualizzaizone SecondScreen x - /// - /// cod schermo, formato SSC000000 - /// Path file richiesto (pdf) - /// durata in redis della richiesta - /// - public static bool setSecScreenRequest(string secScreenCode, string filePath, int ttl_sec) + public bool saveNestAnsw(nestReplyBatchFinal nestAnsw) { bool answ = false; - // recupero ultima call - string redKey = $"{redSecScreenReq}:{secScreenCode}"; - answ = memLayer.ML.setRSV(redKey, filePath, ttl_sec); + try + { + // definisco filtro + var filtBuilder = Builders.Filter; + var filter = filtBuilder.Eq("BatchID", nestAnsw.BatchID); + var collRawData = database.GetCollection("NestingArchive"); + // elimino old + collRawData.DeleteMany(filter); + // aggiungo + collRawData.InsertOne(nestAnsw); + answ = true; + } + catch + { } return answ; } - #endregion + /// + /// Salva una risposta ricevuta x OfflineOrder + /// + /// Stringa della risposta JSON ricevuta dal nesting + /// + public bool saveOffOrdAnsw(nestReplyOffOrd offOrdAnsw) + { + bool answ = false; + try + { + // definisco filtro + var filtBuilder = Builders.Filter; + var filter = filtBuilder.Eq("BatchID", offOrdAnsw.BatchID); + var collRawData = database.GetCollection("OfflineArchive"); + // elimino old + collRawData.DeleteMany(filter); + // aggiungo + collRawData.InsertOne(offOrdAnsw); + answ = true; + } + catch + { } + return answ; + } + + /// + /// Salva una risposta ricevuta dal PROD + /// + /// Stringa della risposta JSON ricevuta dal PROD + /// + public bool saveProdAnsw(SheetWorkList prodAnsw) + { + bool answ = false; + try + { + // definisco filtro + var filtBuilder = Builders.Filter; + // filtro vuoto x svuotare sempre + var filter = filtBuilder.Empty; + var collRawData = database.GetCollection("ProdArchive"); + // elimino old (TUTTI!!!) + collRawData.DeleteMany(filter); + // aggiungo + collRawData.InsertOne(prodAnsw); + // fatto! + answ = true; + } + catch + { } + return answ; + } + + #endregion Public Methods + + #region Public Classes + + public class Parte + { + #region Public Properties + + public string CadFilePath { get; set; } + public string DataMatrix { get; set; } + public string Description { get; set; } + public string ExtCode { get; set; } + public int MatId { get; set; } + public int PartId { get; set; } + public string PostProc { get; set; } + public string ProcessReq { get; set; } + public int Qty { get; set; } + + #endregion Public Properties + } + + /// + /// Oggetto globale TAKT + /// + public class Takt + { + #region Public Properties + + /// + /// Numero di Stack da lavorare + /// + public int NumStack + { + get + { + int answ = 0; + try + { + answ = StackList.Count; + } + catch + { } + return answ; + } + } + + /// + /// Elenco degli Stack da lavorare + /// + public List StackList { get; set; } + + /// + /// Stato del TAKT + /// + public CStatus Status { get; set; } + + /// + /// Codice univoco oggetto TAKT (data.num) + /// + public string TaktId { get; set; } + + #endregion Public Properties + } + + #endregion Public Classes } -} +} \ No newline at end of file diff --git a/AppData/DS_App.Designer.cs b/AppData/DS_App.Designer.cs index 21d5fd4..94085ba 100644 --- a/AppData/DS_App.Designer.cs +++ b/AppData/DS_App.Designer.cs @@ -96,6 +96,8 @@ namespace AppData { private CartIRKDataTable tableCartIRK; + private FileValidationDataTable tableFileValidation; + private global::System.Data.DataRelation relationFK_BatchReqList_OrderList; private global::System.Data.DataRelation relationFK_ItemList_Materials1; @@ -256,6 +258,9 @@ namespace AppData { if ((ds.Tables["CartIRK"] != null)) { base.Tables.Add(new CartIRKDataTable(ds.Tables["CartIRK"])); } + if ((ds.Tables["FileValidation"] != null)) { + base.Tables.Add(new FileValidationDataTable(ds.Tables["FileValidation"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -634,6 +639,16 @@ namespace AppData { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public FileValidationDataTable FileValidation { + get { + return this.tableFileValidation; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.BrowsableAttribute(true)] @@ -809,6 +824,9 @@ namespace AppData { if ((ds.Tables["CartIRK"] != null)) { base.Tables.Add(new CartIRKDataTable(ds.Tables["CartIRK"])); } + if ((ds.Tables["FileValidation"] != null)) { + base.Tables.Add(new FileValidationDataTable(ds.Tables["FileValidation"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -1058,6 +1076,12 @@ namespace AppData { this.tableCartIRK.InitVars(); } } + this.tableFileValidation = ((FileValidationDataTable)(base.Tables["FileValidation"])); + if ((initTable == true)) { + if ((this.tableFileValidation != null)) { + this.tableFileValidation.InitVars(); + } + } this.relationFK_BatchReqList_OrderList = this.Relations["FK_BatchReqList_OrderList"]; this.relationFK_ItemList_Materials1 = this.Relations["FK_ItemList_Materials1"]; this.relationFK_OffOrd2Item_OfflineOrderList = this.Relations["FK_OffOrd2Item_OfflineOrderList"]; @@ -1152,6 +1176,8 @@ namespace AppData { base.Tables.Add(this.tablePack2Cart); this.tableCartIRK = new CartIRKDataTable(); base.Tables.Add(this.tableCartIRK); + this.tableFileValidation = new FileValidationDataTable(); + base.Tables.Add(this.tableFileValidation); this.relationFK_BatchReqList_OrderList = new global::System.Data.DataRelation("FK_BatchReqList_OrderList", new global::System.Data.DataColumn[] { this.tableOrderList.OrdIDColumn}, new global::System.Data.DataColumn[] { this.tableBatchReqList.OrdIDColumn}, false); @@ -1418,6 +1444,12 @@ namespace AppData { return false; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + private bool ShouldSerializeFileValidation() { + return false; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { @@ -1581,6 +1613,9 @@ namespace AppData { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public delegate void CartIRKRowChangeEventHandler(object sender, CartIRKRowChangeEvent e); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public delegate void FileValidationRowChangeEventHandler(object sender, FileValidationRowChangeEvent e); + /// ///Represents the strongly named DataTable class. /// @@ -16368,6 +16403,324 @@ namespace AppData { } } + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class FileValidationDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnItemExtCode; + + private global::System.Data.DataColumn columnBatchID; + + private global::System.Data.DataColumn columnEvalDate; + + private global::System.Data.DataColumn columnStatus; + + private global::System.Data.DataColumn columnEstimTime; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public FileValidationDataTable() { + this.TableName = "FileValidation"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + internal FileValidationDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + protected FileValidationDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn ItemExtCodeColumn { + get { + return this.columnItemExtCode; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn BatchIDColumn { + get { + return this.columnBatchID; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn EvalDateColumn { + get { + return this.columnEvalDate; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn StatusColumn { + get { + return this.columnStatus; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn EstimTimeColumn { + get { + return this.columnEstimTime; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public FileValidationRow this[int index] { + get { + return ((FileValidationRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public event FileValidationRowChangeEventHandler FileValidationRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public event FileValidationRowChangeEventHandler FileValidationRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public event FileValidationRowChangeEventHandler FileValidationRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public event FileValidationRowChangeEventHandler FileValidationRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public void AddFileValidationRow(FileValidationRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public FileValidationRow AddFileValidationRow(string ItemExtCode, int BatchID, System.DateTime EvalDate, int Status, double EstimTime) { + FileValidationRow rowFileValidationRow = ((FileValidationRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + ItemExtCode, + BatchID, + EvalDate, + Status, + EstimTime}; + rowFileValidationRow.ItemArray = columnValuesArray; + this.Rows.Add(rowFileValidationRow); + return rowFileValidationRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public FileValidationRow FindByItemExtCode(string ItemExtCode) { + return ((FileValidationRow)(this.Rows.Find(new object[] { + ItemExtCode}))); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public override global::System.Data.DataTable Clone() { + FileValidationDataTable cln = ((FileValidationDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new FileValidationDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + internal void InitVars() { + this.columnItemExtCode = base.Columns["ItemExtCode"]; + this.columnBatchID = base.Columns["BatchID"]; + this.columnEvalDate = base.Columns["EvalDate"]; + this.columnStatus = base.Columns["Status"]; + this.columnEstimTime = base.Columns["EstimTime"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + private void InitClass() { + this.columnItemExtCode = new global::System.Data.DataColumn("ItemExtCode", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnItemExtCode); + this.columnBatchID = new global::System.Data.DataColumn("BatchID", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnBatchID); + this.columnEvalDate = new global::System.Data.DataColumn("EvalDate", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnEvalDate); + this.columnStatus = new global::System.Data.DataColumn("Status", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnStatus); + this.columnEstimTime = new global::System.Data.DataColumn("EstimTime", typeof(double), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnEstimTime); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnItemExtCode}, true)); + this.columnItemExtCode.AllowDBNull = false; + this.columnItemExtCode.Unique = true; + this.columnItemExtCode.MaxLength = 250; + this.columnBatchID.AllowDBNull = false; + this.columnStatus.AllowDBNull = false; + this.columnEstimTime.AllowDBNull = false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public FileValidationRow NewFileValidationRow() { + return ((FileValidationRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new FileValidationRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(FileValidationRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.FileValidationRowChanged != null)) { + this.FileValidationRowChanged(this, new FileValidationRowChangeEvent(((FileValidationRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.FileValidationRowChanging != null)) { + this.FileValidationRowChanging(this, new FileValidationRowChangeEvent(((FileValidationRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.FileValidationRowDeleted != null)) { + this.FileValidationRowDeleted(this, new FileValidationRowChangeEvent(((FileValidationRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.FileValidationRowDeleting != null)) { + this.FileValidationRowDeleting(this, new FileValidationRowChangeEvent(((FileValidationRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public void RemoveFileValidationRow(FileValidationRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { + global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); + global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); + DS_App ds = new DS_App(); + global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); + any1.Namespace = "http://www.w3.org/2001/XMLSchema"; + any1.MinOccurs = new decimal(0); + any1.MaxOccurs = decimal.MaxValue; + any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any1); + global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); + any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; + any2.MinOccurs = new decimal(1); + any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any2); + global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute1.Name = "namespace"; + attribute1.FixedValue = ds.Namespace; + type.Attributes.Add(attribute1); + global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute2.Name = "tableTypeName"; + attribute2.FixedValue = "FileValidationDataTable"; + type.Attributes.Add(attribute2); + type.Particle = sequence; + global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); + if (xs.Contains(dsSchema.TargetNamespace)) { + global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); + global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); + try { + global::System.Xml.Schema.XmlSchema schema = null; + dsSchema.Write(s1); + for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { + schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); + s2.SetLength(0); + schema.Write(s2); + if ((s1.Length == s2.Length)) { + s1.Position = 0; + s2.Position = 0; + for (; ((s1.Position != s1.Length) + && (s1.ReadByte() == s2.ReadByte())); ) { + ; + } + if ((s1.Position == s1.Length)) { + return type; + } + } + } + } + finally { + if ((s1 != null)) { + s1.Close(); + } + if ((s2 != null)) { + s2.Close(); + } + } + } + xs.Add(dsSchema); + return type; + } + } + /// ///Represents strongly named DataRow class. /// @@ -23766,6 +24119,93 @@ namespace AppData { } } + /// + ///Represents strongly named DataRow class. + /// + public partial class FileValidationRow : global::System.Data.DataRow { + + private FileValidationDataTable tableFileValidation; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + internal FileValidationRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableFileValidation = ((FileValidationDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public string ItemExtCode { + get { + return ((string)(this[this.tableFileValidation.ItemExtCodeColumn])); + } + set { + this[this.tableFileValidation.ItemExtCodeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public int BatchID { + get { + return ((int)(this[this.tableFileValidation.BatchIDColumn])); + } + set { + this[this.tableFileValidation.BatchIDColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public System.DateTime EvalDate { + get { + try { + return ((global::System.DateTime)(this[this.tableFileValidation.EvalDateColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("Il valore della colonna \'EvalDate\' nella tabella \'FileValidation\' è DBNull.", e); + } + } + set { + this[this.tableFileValidation.EvalDateColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public int Status { + get { + return ((int)(this[this.tableFileValidation.StatusColumn])); + } + set { + this[this.tableFileValidation.StatusColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public double EstimTime { + get { + return ((double)(this[this.tableFileValidation.EstimTimeColumn])); + } + set { + this[this.tableFileValidation.EstimTimeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public bool IsEvalDateNull() { + return this.IsNull(this.tableFileValidation.EvalDateColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public void SetEvalDateNull() { + this[this.tableFileValidation.EvalDateColumn] = global::System.Convert.DBNull; + } + } + /// ///Row event argument class /// @@ -24989,6 +25429,40 @@ namespace AppData { } } } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public class FileValidationRowChangeEvent : global::System.EventArgs { + + private FileValidationRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public FileValidationRowChangeEvent(FileValidationRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public FileValidationRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } } } namespace AppData.DS_AppTableAdapters { @@ -25148,7 +25622,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[23]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[24]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT *\r\nFROM v_BatchList"; @@ -25168,125 +25642,132 @@ namespace AppData.DS_AppTableAdapters { this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[3].Connection = this.Connection; - this._commandCollection[3].CommandText = "dbo.stp_Batch_createPartValBatch"; + this._commandCollection[3].CommandText = "dbo.stp_Batch_createFileValBatch"; this._commandCollection[3].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ItemExtCode", global::System.Data.SqlDbType.NVarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BasePath", global::System.Data.SqlDbType.NVarChar, 500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[4].Connection = this.Connection; - this._commandCollection[4].CommandText = "dbo.stp_Batch_deleteTree"; + this._commandCollection[4].CommandText = "dbo.stp_Batch_createPartValBatch"; this._commandCollection[4].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ForceDelete", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BasePath", global::System.Data.SqlDbType.NVarChar, 500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[5].Connection = this.Connection; - this._commandCollection[5].CommandText = "dbo.stp_Batch_fixRedoSheet"; + this._commandCollection[5].CommandText = "dbo.stp_Batch_deleteTree"; this._commandCollection[5].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ForceDelete", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[6].Connection = this.Connection; - this._commandCollection[6].CommandText = "dbo.stp_Batch_fixRedoSheetOnEnd"; + this._commandCollection[6].CommandText = "dbo.stp_Batch_fixRedoSheet"; this._commandCollection[6].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[7] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[7].Connection = this.Connection; - this._commandCollection[7].CommandText = "dbo.stp_Batch_fixSched"; + this._commandCollection[7].CommandText = "dbo.stp_Batch_fixRedoSheetOnEnd"; this._commandCollection[7].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[8] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[8].Connection = this.Connection; - this._commandCollection[8].CommandText = "dbo.stp_Batch_getByKey"; + this._commandCollection[8].CommandText = "dbo.stp_Batch_fixSched"; this._commandCollection[8].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[9] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[9].Connection = this.Connection; - this._commandCollection[9].CommandText = "dbo.stp_Batch_getByStatus"; + this._commandCollection[9].CommandText = "dbo.stp_Batch_getByKey"; this._commandCollection[9].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Status", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SearchVal", global::System.Data.SqlDbType.NVarChar, 500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PartValid", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[10] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[10].Connection = this.Connection; - this._commandCollection[10].CommandText = "dbo.stp_Batch_getCurrentByMachine"; + this._commandCollection[10].CommandText = "dbo.stp_Batch_getByStatus"; this._commandCollection[10].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodPosition", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Status", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SearchVal", global::System.Data.SqlDbType.NVarChar, 500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PartValid", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[11] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[11].Connection = this.Connection; - this._commandCollection[11].CommandText = "dbo.stp_Batch_getForBunkMan"; + this._commandCollection[11].CommandText = "dbo.stp_Batch_getCurrentByMachine"; this._commandCollection[11].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaxPosition", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodPosition", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[12] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[12].Connection = this.Connection; - this._commandCollection[12].CommandText = "dbo.stp_Batch_getLastByTakt"; + this._commandCollection[12].CommandText = "dbo.stp_Batch_getForBunkMan"; this._commandCollection[12].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[12].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[12].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Takt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[12].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaxPosition", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[13] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[13].Connection = this.Connection; - this._commandCollection[13].CommandText = "dbo.stp_Batch_getNextAvailable"; + this._commandCollection[13].CommandText = "dbo.stp_Batch_getLastByTakt"; this._commandCollection[13].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[13].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[13].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Takt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[14] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[14].Connection = this.Connection; - this._commandCollection[14].CommandText = "dbo.stp_Batch_getRunning"; + this._commandCollection[14].CommandText = "dbo.stp_Batch_getNextAvailable"; this._commandCollection[14].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[14].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[15] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[15].Connection = this.Connection; - this._commandCollection[15].CommandText = "dbo.stp_Batch_getSched"; + this._commandCollection[15].CommandText = "dbo.stp_Batch_getRunning"; this._commandCollection[15].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[15].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[16] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[16].Connection = this.Connection; - this._commandCollection[16].CommandText = "dbo.stp_Batch_redoPartValid"; + this._commandCollection[16].CommandText = "dbo.stp_Batch_getSched"; this._commandCollection[16].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[16].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[16].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Takt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[17] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[17].Connection = this.Connection; - this._commandCollection[17].CommandText = "dbo.stp_Batch_resetAllNesting"; + this._commandCollection[17].CommandText = "dbo.stp_Batch_redoPartValid"; this._commandCollection[17].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[17].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[17].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[17].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Takt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[18] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[18].Connection = this.Connection; - this._commandCollection[18].CommandText = "dbo.stp_Batch_resetPartUnValid"; + this._commandCollection[18].CommandText = "dbo.stp_Batch_resetAllNesting"; this._commandCollection[18].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[18].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[18].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[19] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[19].Connection = this.Connection; - this._commandCollection[19].CommandText = "dbo.stp_zzz_resetProdCall"; + this._commandCollection[19].CommandText = "dbo.stp_Batch_resetPartUnValid"; this._commandCollection[19].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[20] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[20].Connection = this.Connection; - this._commandCollection[20].CommandText = "dbo.stp_Batch_resetTree"; + this._commandCollection[20].CommandText = "dbo.stp_zzz_resetProdCall"; this._commandCollection[20].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[20].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[20].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[21] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[21].Connection = this.Connection; - this._commandCollection[21].CommandText = "dbo.stp_Batch_updateSchedPrior"; + this._commandCollection[21].CommandText = "dbo.stp_Batch_resetTree"; this._commandCollection[21].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[21].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[21].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[21].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SchedPrio", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[21].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[22] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[22].Connection = this.Connection; - this._commandCollection[22].CommandText = "dbo.stp_Batch_updateStatus"; + this._commandCollection[22].CommandText = "dbo.stp_Batch_updateSchedPrior"; this._commandCollection[22].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[22].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[22].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[22].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Status", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[22].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EnvNum", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[22].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TotalTime", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 6, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[22].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SchedPrio", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[23] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[23].Connection = this.Connection; + this._commandCollection[23].CommandText = "dbo.stp_Batch_updateStatus"; + this._commandCollection[23].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[23].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[23].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[23].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Status", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[23].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EnvNum", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[23].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TotalTime", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 6, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -25318,7 +25799,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_App.BatchListDataTable getByKey(global::System.Nullable BatchID) { - this.Adapter.SelectCommand = this.CommandCollection[8]; + this.Adapter.SelectCommand = this.CommandCollection[9]; if ((BatchID.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(BatchID.Value)); } @@ -25335,7 +25816,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_App.BatchListDataTable getByStatus(global::System.Nullable Status, string SearchVal, global::System.Nullable PartValid) { - this.Adapter.SelectCommand = this.CommandCollection[9]; + this.Adapter.SelectCommand = this.CommandCollection[10]; if ((Status.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(Status.Value)); } @@ -25364,7 +25845,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_App.BatchListDataTable getCurrentByMachine(string CodPosition) { - this.Adapter.SelectCommand = this.CommandCollection[10]; + this.Adapter.SelectCommand = this.CommandCollection[11]; if ((CodPosition == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -25381,7 +25862,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_App.BatchListDataTable getForBunkMan(global::System.Nullable MaxPosition) { - this.Adapter.SelectCommand = this.CommandCollection[11]; + this.Adapter.SelectCommand = this.CommandCollection[12]; if ((MaxPosition.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(MaxPosition.Value)); } @@ -25398,7 +25879,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_App.BatchListDataTable getLastByTakt(string Takt) { - this.Adapter.SelectCommand = this.CommandCollection[12]; + this.Adapter.SelectCommand = this.CommandCollection[13]; if ((Takt == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -25415,17 +25896,6 @@ namespace AppData.DS_AppTableAdapters { [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_App.BatchListDataTable getNextAvailable() { - this.Adapter.SelectCommand = this.CommandCollection[13]; - DS_App.BatchListDataTable dataTable = new DS_App.BatchListDataTable(); - this.Adapter.Fill(dataTable); - return dataTable; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_App.BatchListDataTable getRunning() { this.Adapter.SelectCommand = this.CommandCollection[14]; DS_App.BatchListDataTable dataTable = new DS_App.BatchListDataTable(); this.Adapter.Fill(dataTable); @@ -25436,13 +25906,24 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_App.BatchListDataTable getSched() { + public virtual DS_App.BatchListDataTable getRunning() { this.Adapter.SelectCommand = this.CommandCollection[15]; DS_App.BatchListDataTable dataTable = new DS_App.BatchListDataTable(); this.Adapter.Fill(dataTable); return dataTable; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_App.BatchListDataTable getSched() { + this.Adapter.SelectCommand = this.CommandCollection[16]; + DS_App.BatchListDataTable dataTable = new DS_App.BatchListDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] @@ -25508,8 +25989,42 @@ namespace AppData.DS_AppTableAdapters { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int createPartValBatch(string BasePath) { + public virtual int createFileValBatch(string ItemExtCode, string BasePath) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; + if ((ItemExtCode == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(ItemExtCode)); + } + if ((BasePath == null)) { + command.Parameters[2].Value = global::System.DBNull.Value; + } + else { + command.Parameters[2].Value = ((string)(BasePath)); + } + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int createPartValBatch(string BasePath) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; if ((BasePath == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -25537,7 +26052,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int deleteTree(global::System.Nullable Original_BatchID, global::System.Nullable ForceDelete) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5]; if ((Original_BatchID.HasValue == true)) { command.Parameters[1].Value = ((int)(Original_BatchID.Value)); } @@ -25571,34 +26086,6 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int fixRedoSheet(global::System.Nullable BatchID) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5]; - if ((BatchID.HasValue == true)) { - command.Parameters[1].Value = ((int)(BatchID.Value)); - } - else { - command.Parameters[1].Value = global::System.DBNull.Value; - } - global::System.Data.ConnectionState previousConnectionState = command.Connection.State; - if (((command.Connection.State & global::System.Data.ConnectionState.Open) - != global::System.Data.ConnectionState.Open)) { - command.Connection.Open(); - } - int returnValue; - try { - returnValue = command.ExecuteNonQuery(); - } - finally { - if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { - command.Connection.Close(); - } - } - return returnValue; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int fixRedoSheetOnEnd(global::System.Nullable BatchID) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; if ((BatchID.HasValue == true)) { command.Parameters[1].Value = ((int)(BatchID.Value)); @@ -25626,8 +26113,36 @@ namespace AppData.DS_AppTableAdapters { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int fixSched() { + public virtual int fixRedoSheetOnEnd(global::System.Nullable BatchID) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; + if ((BatchID.HasValue == true)) { + command.Parameters[1].Value = ((int)(BatchID.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int fixSched() { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[8]; global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) != global::System.Data.ConnectionState.Open)) { @@ -25649,7 +26164,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int redoPartValid(string Takt) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[16]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[17]; if ((Takt == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -25677,7 +26192,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int resetNesting(global::System.Nullable BatchID) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[17]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[18]; if ((BatchID.HasValue == true)) { command.Parameters[1].Value = ((int)(BatchID.Value)); } @@ -25705,28 +26220,6 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int resetPartUnValid() { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[18]; - global::System.Data.ConnectionState previousConnectionState = command.Connection.State; - if (((command.Connection.State & global::System.Data.ConnectionState.Open) - != global::System.Data.ConnectionState.Open)) { - command.Connection.Open(); - } - int returnValue; - try { - returnValue = command.ExecuteNonQuery(); - } - finally { - if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { - command.Connection.Close(); - } - } - return returnValue; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int resetProdCall() { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[19]; global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) @@ -25748,8 +26241,30 @@ namespace AppData.DS_AppTableAdapters { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int resetTree(global::System.Nullable Original_BatchID) { + public virtual int resetProdCall() { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[20]; + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int resetTree(global::System.Nullable Original_BatchID) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[21]; if ((Original_BatchID.HasValue == true)) { command.Parameters[1].Value = ((int)(Original_BatchID.Value)); } @@ -25777,7 +26292,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateSchedPrior(global::System.Nullable BatchID, global::System.Nullable SchedPrio) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[21]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[22]; if ((BatchID.HasValue == true)) { command.Parameters[1].Value = ((int)(BatchID.Value)); } @@ -25811,7 +26326,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateStatus(global::System.Nullable BatchID, global::System.Nullable Status, string EnvNum, global::System.Nullable TotalTime) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[22]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[23]; if ((BatchID.HasValue == true)) { command.Parameters[1].Value = ((int)(BatchID.Value)); } @@ -38023,6 +38538,286 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W } } + /// + ///Represents the connection and commands used to retrieve and save data. + /// + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.ComponentModel.DataObjectAttribute(true)] + [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" + + ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public partial class FileValidationTableAdapter : global::System.ComponentModel.Component { + + private global::System.Data.SqlClient.SqlDataAdapter _adapter; + + private global::System.Data.SqlClient.SqlConnection _connection; + + private global::System.Data.SqlClient.SqlTransaction _transaction; + + private global::System.Data.SqlClient.SqlCommand[] _commandCollection; + + private bool _clearBeforeFill; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public FileValidationTableAdapter() { + this.ClearBeforeFill = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter { + get { + if ((this._adapter == null)) { + this.InitAdapter(); + } + return this._adapter; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + internal global::System.Data.SqlClient.SqlConnection Connection { + get { + if ((this._connection == null)) { + this.InitConnection(); + } + return this._connection; + } + set { + this._connection = value; + if ((this.Adapter.InsertCommand != null)) { + this.Adapter.InsertCommand.Connection = value; + } + if ((this.Adapter.DeleteCommand != null)) { + this.Adapter.DeleteCommand.Connection = value; + } + if ((this.Adapter.UpdateCommand != null)) { + this.Adapter.UpdateCommand.Connection = value; + } + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + if ((this.CommandCollection[i] != null)) { + ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value; + } + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + internal global::System.Data.SqlClient.SqlTransaction Transaction { + get { + return this._transaction; + } + set { + this._transaction = value; + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + this.CommandCollection[i].Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.DeleteCommand != null))) { + this.Adapter.DeleteCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.InsertCommand != null))) { + this.Adapter.InsertCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.UpdateCommand != null))) { + this.Adapter.UpdateCommand.Transaction = this._transaction; + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + protected global::System.Data.SqlClient.SqlCommand[] CommandCollection { + get { + if ((this._commandCollection == null)) { + this.InitCommandCollection(); + } + return this._commandCollection; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public bool ClearBeforeFill { + get { + return this._clearBeforeFill; + } + set { + this._clearBeforeFill = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + private void InitAdapter() { + this._adapter = new global::System.Data.SqlClient.SqlDataAdapter(); + global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping(); + tableMapping.SourceTable = "Table"; + tableMapping.DataSetTable = "FileValidation"; + tableMapping.ColumnMappings.Add("ItemExtCode", "ItemExtCode"); + tableMapping.ColumnMappings.Add("BatchID", "BatchID"); + tableMapping.ColumnMappings.Add("EvalDate", "EvalDate"); + tableMapping.ColumnMappings.Add("Status", "Status"); + tableMapping.ColumnMappings.Add("EstimTime", "EstimTime"); + this._adapter.TableMappings.Add(tableMapping); + this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand(); + this._adapter.DeleteCommand.Connection = this.Connection; + this._adapter.DeleteCommand.CommandText = @"DELETE FROM [FileValidation] WHERE (([ItemExtCode] = @Original_ItemExtCode) AND ([BatchID] = @Original_BatchID) AND ((@IsNull_EvalDate = 1 AND [EvalDate] IS NULL) OR ([EvalDate] = @Original_EvalDate)) AND ([EstimTime] = @Original_EstimTime) AND ([Status] = @Original_Status))"; + this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ItemExtCode", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ItemExtCode", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_BatchID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "BatchID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_EvalDate", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EvalDate", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_EvalDate", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EvalDate", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_EstimTime", global::System.Data.SqlDbType.Float, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EstimTime", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Status", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Status", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand(); + this._adapter.InsertCommand.Connection = this.Connection; + this._adapter.InsertCommand.CommandText = @"INSERT INTO [FileValidation] ([ItemExtCode], [BatchID], [EvalDate], [EstimTime], [Status]) VALUES (@ItemExtCode, @BatchID, @EvalDate, @EstimTime, @Status); +SELECT ItemExtCode, BatchID, EvalDate, EstimTime, Status FROM FileValidation WHERE (ItemExtCode = @ItemExtCode)"; + this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ItemExtCode", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ItemExtCode", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "BatchID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EvalDate", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EvalDate", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EstimTime", global::System.Data.SqlDbType.Float, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EstimTime", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Status", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Status", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand(); + this._adapter.UpdateCommand.Connection = this.Connection; + this._adapter.UpdateCommand.CommandText = @"UPDATE [FileValidation] SET [ItemExtCode] = @ItemExtCode, [BatchID] = @BatchID, [EvalDate] = @EvalDate, [EstimTime] = @EstimTime, [Status] = @Status WHERE (([ItemExtCode] = @Original_ItemExtCode) AND ([BatchID] = @Original_BatchID) AND ((@IsNull_EvalDate = 1 AND [EvalDate] IS NULL) OR ([EvalDate] = @Original_EvalDate)) AND ([EstimTime] = @Original_EstimTime) AND ([Status] = @Original_Status)); +SELECT ItemExtCode, BatchID, EvalDate, EstimTime, Status FROM FileValidation WHERE (ItemExtCode = @ItemExtCode)"; + this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ItemExtCode", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ItemExtCode", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "BatchID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EvalDate", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EvalDate", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EstimTime", global::System.Data.SqlDbType.Float, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EstimTime", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Status", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Status", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ItemExtCode", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ItemExtCode", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_BatchID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "BatchID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_EvalDate", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EvalDate", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_EvalDate", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EvalDate", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_EstimTime", global::System.Data.SqlDbType.Float, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EstimTime", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Status", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Status", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + private void InitConnection() { + this._connection = new global::System.Data.SqlClient.SqlConnection(); + this._connection.ConnectionString = global::AppData.Properties.Settings.Default.Sauder_NKCConnectionString; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + private void InitCommandCollection() { + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2]; + this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[0].Connection = this.Connection; + this._commandCollection[0].CommandText = "SELECT * FROM FileValidation"; + this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; + this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[1].Connection = this.Connection; + this._commandCollection[1].CommandText = "dbo.stp_FV_upsertQuery"; + this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ItemExtCode", global::System.Data.SqlDbType.NVarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BatchID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Status", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EstimTime", global::System.Data.SqlDbType.Float, 8, global::System.Data.ParameterDirection.Input, 53, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)] + public virtual int Fill(DS_App.FileValidationDataTable dataTable) { + this.Adapter.SelectCommand = this.CommandCollection[0]; + if ((this.ClearBeforeFill == true)) { + dataTable.Clear(); + } + int returnValue = this.Adapter.Fill(dataTable); + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] + public virtual DS_App.FileValidationDataTable GetData() { + this.Adapter.SelectCommand = this.CommandCollection[0]; + DS_App.FileValidationDataTable dataTable = new DS_App.FileValidationDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_App.FileValidationDataTable upsertQuery(string ItemExtCode, global::System.Nullable BatchID, global::System.Nullable Status, global::System.Nullable EstimTime) { + this.Adapter.SelectCommand = this.CommandCollection[1]; + if ((ItemExtCode == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(ItemExtCode)); + } + if ((BatchID.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[2].Value = ((int)(BatchID.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; + } + if ((Status.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[3].Value = ((int)(Status.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value; + } + if ((EstimTime.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[4].Value = ((double)(EstimTime.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[4].Value = global::System.DBNull.Value; + } + DS_App.FileValidationDataTable dataTable = new DS_App.FileValidationDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(DS_App.FileValidationDataTable dataTable) { + return this.Adapter.Update(dataTable); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(DS_App dataSet) { + return this.Adapter.Update(dataSet, "FileValidation"); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow dataRow) { + return this.Adapter.Update(new global::System.Data.DataRow[] { + dataRow}); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(global::System.Data.DataRow[] dataRows) { + return this.Adapter.Update(dataRows); + } + } + /// ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios /// @@ -38063,6 +38858,8 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W private RemnantsTableAdapter _remnantsTableAdapter; + private FileValidationTableAdapter _fileValidationTableAdapter; + private bool _backupDataSetBeforeUpdate; private global::System.Data.IDbConnection _connection; @@ -38274,6 +39071,20 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" + + "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" + + "a", "System.Drawing.Design.UITypeEditor")] + public FileValidationTableAdapter FileValidationTableAdapter { + get { + return this._fileValidationTableAdapter; + } + set { + this._fileValidationTableAdapter = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public bool BackupDataSetBeforeUpdate { @@ -38349,6 +39160,10 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W && (this._remnantsTableAdapter.Connection != null))) { return this._remnantsTableAdapter.Connection; } + if (((this._fileValidationTableAdapter != null) + && (this._fileValidationTableAdapter.Connection != null))) { + return this._fileValidationTableAdapter.Connection; + } return null; } set { @@ -38404,6 +39219,9 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W if ((this._remnantsTableAdapter != null)) { count = (count + 1); } + if ((this._fileValidationTableAdapter != null)) { + count = (count + 1); + } return count; } } @@ -38469,12 +39287,12 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W allChangedRows.AddRange(updatedRows); } } - if ((this._countersTableAdapter != null)) { - global::System.Data.DataRow[] updatedRows = dataSet.Counters.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); + if ((this._errorsLogTableAdapter != null)) { + global::System.Data.DataRow[] updatedRows = dataSet.ErrorsLog.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); if (((updatedRows != null) && (0 < updatedRows.Length))) { - result = (result + this._countersTableAdapter.Update(updatedRows)); + result = (result + this._errorsLogTableAdapter.Update(updatedRows)); allChangedRows.AddRange(updatedRows); } } @@ -38487,12 +39305,12 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W allChangedRows.AddRange(updatedRows); } } - if ((this._errorsLogTableAdapter != null)) { - global::System.Data.DataRow[] updatedRows = dataSet.ErrorsLog.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); + if ((this._countersTableAdapter != null)) { + global::System.Data.DataRow[] updatedRows = dataSet.Counters.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); if (((updatedRows != null) && (0 < updatedRows.Length))) { - result = (result + this._errorsLogTableAdapter.Update(updatedRows)); + result = (result + this._countersTableAdapter.Update(updatedRows)); allChangedRows.AddRange(updatedRows); } } @@ -38541,6 +39359,15 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W allChangedRows.AddRange(updatedRows); } } + if ((this._fileValidationTableAdapter != null)) { + global::System.Data.DataRow[] updatedRows = dataSet.FileValidation.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); + updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); + if (((updatedRows != null) + && (0 < updatedRows.Length))) { + result = (result + this._fileValidationTableAdapter.Update(updatedRows)); + allChangedRows.AddRange(updatedRows); + } + } return result; } @@ -38599,11 +39426,11 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W allAddedRows.AddRange(addedRows); } } - if ((this._countersTableAdapter != null)) { - global::System.Data.DataRow[] addedRows = dataSet.Counters.Select(null, null, global::System.Data.DataViewRowState.Added); + if ((this._errorsLogTableAdapter != null)) { + global::System.Data.DataRow[] addedRows = dataSet.ErrorsLog.Select(null, null, global::System.Data.DataViewRowState.Added); if (((addedRows != null) && (0 < addedRows.Length))) { - result = (result + this._countersTableAdapter.Update(addedRows)); + result = (result + this._errorsLogTableAdapter.Update(addedRows)); allAddedRows.AddRange(addedRows); } } @@ -38615,11 +39442,11 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W allAddedRows.AddRange(addedRows); } } - if ((this._errorsLogTableAdapter != null)) { - global::System.Data.DataRow[] addedRows = dataSet.ErrorsLog.Select(null, null, global::System.Data.DataViewRowState.Added); + if ((this._countersTableAdapter != null)) { + global::System.Data.DataRow[] addedRows = dataSet.Counters.Select(null, null, global::System.Data.DataViewRowState.Added); if (((addedRows != null) && (0 < addedRows.Length))) { - result = (result + this._errorsLogTableAdapter.Update(addedRows)); + result = (result + this._countersTableAdapter.Update(addedRows)); allAddedRows.AddRange(addedRows); } } @@ -38663,6 +39490,14 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W allAddedRows.AddRange(addedRows); } } + if ((this._fileValidationTableAdapter != null)) { + global::System.Data.DataRow[] addedRows = dataSet.FileValidation.Select(null, null, global::System.Data.DataViewRowState.Added); + if (((addedRows != null) + && (0 < addedRows.Length))) { + result = (result + this._fileValidationTableAdapter.Update(addedRows)); + allAddedRows.AddRange(addedRows); + } + } return result; } @@ -38673,6 +39508,14 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] private int UpdateDeletedRows(DS_App dataSet, global::System.Collections.Generic.List allChangedRows) { int result = 0; + if ((this._fileValidationTableAdapter != null)) { + global::System.Data.DataRow[] deletedRows = dataSet.FileValidation.Select(null, null, global::System.Data.DataViewRowState.Deleted); + if (((deletedRows != null) + && (0 < deletedRows.Length))) { + result = (result + this._fileValidationTableAdapter.Update(deletedRows)); + allChangedRows.AddRange(deletedRows); + } + } if ((this._batchReqListTableAdapter != null)) { global::System.Data.DataRow[] deletedRows = dataSet.BatchReqList.Select(null, null, global::System.Data.DataViewRowState.Deleted); if (((deletedRows != null) @@ -38713,11 +39556,11 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W allChangedRows.AddRange(deletedRows); } } - if ((this._errorsLogTableAdapter != null)) { - global::System.Data.DataRow[] deletedRows = dataSet.ErrorsLog.Select(null, null, global::System.Data.DataViewRowState.Deleted); + if ((this._countersTableAdapter != null)) { + global::System.Data.DataRow[] deletedRows = dataSet.Counters.Select(null, null, global::System.Data.DataViewRowState.Deleted); if (((deletedRows != null) && (0 < deletedRows.Length))) { - result = (result + this._errorsLogTableAdapter.Update(deletedRows)); + result = (result + this._countersTableAdapter.Update(deletedRows)); allChangedRows.AddRange(deletedRows); } } @@ -38729,11 +39572,11 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W allChangedRows.AddRange(deletedRows); } } - if ((this._countersTableAdapter != null)) { - global::System.Data.DataRow[] deletedRows = dataSet.Counters.Select(null, null, global::System.Data.DataViewRowState.Deleted); + if ((this._errorsLogTableAdapter != null)) { + global::System.Data.DataRow[] deletedRows = dataSet.ErrorsLog.Select(null, null, global::System.Data.DataViewRowState.Deleted); if (((deletedRows != null) && (0 < deletedRows.Length))) { - result = (result + this._countersTableAdapter.Update(deletedRows)); + result = (result + this._errorsLogTableAdapter.Update(deletedRows)); allChangedRows.AddRange(deletedRows); } } @@ -38894,6 +39737,11 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W throw new global::System.ArgumentException("Tutti gli oggetti TableAdapter gestiti da TableAdapterManager devono utilizzare l" + "a stessa stringa di connessione."); } + if (((this._fileValidationTableAdapter != null) + && (this.MatchTableAdapterConnection(this._fileValidationTableAdapter.Connection) == false))) { + throw new global::System.ArgumentException("Tutti gli oggetti TableAdapter gestiti da TableAdapterManager devono utilizzare l" + + "a stessa stringa di connessione."); + } global::System.Data.IDbConnection workConnection = this.Connection; if ((workConnection == null)) { throw new global::System.ApplicationException("TableAdapterManager non contiene informazioni di connessione. Impostare la propri" + @@ -39053,6 +39901,15 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W adaptersWithAcceptChangesDuringUpdate.Add(this._remnantsTableAdapter.Adapter); } } + if ((this._fileValidationTableAdapter != null)) { + revertConnections.Add(this._fileValidationTableAdapter, this._fileValidationTableAdapter.Connection); + this._fileValidationTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection)); + this._fileValidationTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction)); + if (this._fileValidationTableAdapter.Adapter.AcceptChangesDuringUpdate) { + this._fileValidationTableAdapter.Adapter.AcceptChangesDuringUpdate = false; + adaptersWithAcceptChangesDuringUpdate.Add(this._fileValidationTableAdapter.Adapter); + } + } // //---- Perform updates ----------- // @@ -39167,6 +40024,10 @@ SELECT RemnantID, BatchID, MatID, SheetID, DimX, DimY, Available FROM Remnants W this._remnantsTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._remnantsTableAdapter])); this._remnantsTableAdapter.Transaction = null; } + if ((this._fileValidationTableAdapter != null)) { + this._fileValidationTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._fileValidationTableAdapter])); + this._fileValidationTableAdapter.Transaction = null; + } if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) { global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count]; adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters); diff --git a/AppData/DS_App.xsd b/AppData/DS_App.xsd index 9ef621b..03bfcf9 100644 --- a/AppData/DS_App.xsd +++ b/AppData/DS_App.xsd @@ -65,6 +65,18 @@ FROM v_BatchList + + + + dbo.stp_Batch_createFileValBatch + + + + + + + + @@ -1306,7 +1318,7 @@ SELECT MatID, MatExtCode, MatDesc, ApprovDate, ApprovUser, L_mm, W_mm, T_mm, Mat - + dbo.stp_BIN_insert @@ -1317,7 +1329,7 @@ SELECT MatID, MatExtCode, MatDesc, ApprovDate, ApprovUser, L_mm, W_mm, T_mm, Mat - + dbo.stp_BIN_resetKitIncomplete @@ -1327,7 +1339,7 @@ SELECT MatID, MatExtCode, MatDesc, ApprovDate, ApprovUser, L_mm, W_mm, T_mm, Mat - + dbo.stp_BIN_setKitStart @@ -3215,6 +3227,86 @@ FROM v_Pack2Cart + + + + + + DELETE FROM [FileValidation] WHERE (([ItemExtCode] = @Original_ItemExtCode) AND ([BatchID] = @Original_BatchID) AND ((@IsNull_EvalDate = 1 AND [EvalDate] IS NULL) OR ([EvalDate] = @Original_EvalDate)) AND ([EstimTime] = @Original_EstimTime) AND ([Status] = @Original_Status)) + + + + + + + + + + + + + INSERT INTO [FileValidation] ([ItemExtCode], [BatchID], [EvalDate], [EstimTime], [Status]) VALUES (@ItemExtCode, @BatchID, @EvalDate, @EstimTime, @Status); +SELECT ItemExtCode, BatchID, EvalDate, EstimTime, Status FROM FileValidation WHERE (ItemExtCode = @ItemExtCode) + + + + + + + + + + + + SELECT * FROM FileValidation + + + + + + UPDATE [FileValidation] SET [ItemExtCode] = @ItemExtCode, [BatchID] = @BatchID, [EvalDate] = @EvalDate, [EstimTime] = @EstimTime, [Status] = @Status WHERE (([ItemExtCode] = @Original_ItemExtCode) AND ([BatchID] = @Original_BatchID) AND ((@IsNull_EvalDate = 1 AND [EvalDate] IS NULL) OR ([EvalDate] = @Original_EvalDate)) AND ([EstimTime] = @Original_EstimTime) AND ([Status] = @Original_Status)); +SELECT ItemExtCode, BatchID, EvalDate, EstimTime, Status FROM FileValidation WHERE (ItemExtCode = @ItemExtCode) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dbo.stp_FV_upsertQuery + + + + + + + + + + + + @@ -3223,7 +3315,7 @@ FROM v_Pack2Cart - + @@ -3273,7 +3365,7 @@ FROM v_Pack2Cart - + @@ -3298,7 +3390,7 @@ FROM v_Pack2Cart - + @@ -3353,7 +3445,7 @@ FROM v_Pack2Cart - + @@ -3426,7 +3518,7 @@ FROM v_Pack2Cart - + @@ -3434,7 +3526,7 @@ FROM v_Pack2Cart - + @@ -3503,7 +3595,7 @@ FROM v_Pack2Cart - + @@ -3536,7 +3628,7 @@ FROM v_Pack2Cart - + @@ -3608,7 +3700,7 @@ FROM v_Pack2Cart - + @@ -3627,7 +3719,7 @@ FROM v_Pack2Cart - + @@ -3658,7 +3750,7 @@ FROM v_Pack2Cart - + @@ -3666,7 +3758,7 @@ FROM v_Pack2Cart - + @@ -3683,7 +3775,7 @@ FROM v_Pack2Cart - + @@ -3692,7 +3784,7 @@ FROM v_Pack2Cart - + @@ -3723,7 +3815,7 @@ FROM v_Pack2Cart - + @@ -3731,7 +3823,7 @@ FROM v_Pack2Cart - + @@ -3747,7 +3839,7 @@ FROM v_Pack2Cart - + @@ -3755,7 +3847,7 @@ FROM v_Pack2Cart - + @@ -3783,7 +3875,7 @@ FROM v_Pack2Cart - + @@ -3819,7 +3911,7 @@ FROM v_Pack2Cart - + @@ -3835,7 +3927,7 @@ FROM v_Pack2Cart - + @@ -3845,7 +3937,7 @@ FROM v_Pack2Cart - + @@ -3862,7 +3954,7 @@ FROM v_Pack2Cart - + @@ -3875,7 +3967,7 @@ FROM v_Pack2Cart - + @@ -3924,7 +4016,7 @@ FROM v_Pack2Cart - + @@ -3953,7 +4045,7 @@ FROM v_Pack2Cart - + @@ -3995,7 +4087,7 @@ FROM v_Pack2Cart - + @@ -4106,7 +4198,7 @@ FROM v_Pack2Cart - + @@ -4169,7 +4261,7 @@ FROM v_Pack2Cart - + @@ -4214,7 +4306,7 @@ FROM v_Pack2Cart - + @@ -4240,7 +4332,7 @@ FROM v_Pack2Cart - + @@ -4333,7 +4425,7 @@ FROM v_Pack2Cart - + @@ -4396,7 +4488,7 @@ FROM v_Pack2Cart - + @@ -4455,7 +4547,7 @@ FROM v_Pack2Cart - + @@ -4504,7 +4596,7 @@ FROM v_Pack2Cart - + @@ -4543,7 +4635,7 @@ FROM v_Pack2Cart - + @@ -4596,6 +4688,23 @@ FROM v_Pack2Cart + + + + + + + + + + + + + + + + + @@ -4734,21 +4843,25 @@ FROM v_Pack2Cart + + + + - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/AppData/DS_App.xss b/AppData/DS_App.xss index ce351f4..8b0b0b5 100644 --- a/AppData/DS_App.xss +++ b/AppData/DS_App.xss @@ -4,22 +4,22 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - - + + - + - + - + @@ -30,18 +30,18 @@ - + - - - - - - - - - - + + + + + + + + + + diff --git a/AppData/DataLayer.cs b/AppData/DataLayer.cs index da0268a..d7f7ee1 100644 --- a/AppData/DataLayer.cs +++ b/AppData/DataLayer.cs @@ -18,6 +18,7 @@ namespace AppData public DS_AppTableAdapters.CartsTableAdapter taCR; public DS_AppTableAdapters.ErrorsLogTableAdapter taEL; public DS_ReportTableAdapters.ElencoPostazioniTableAdapter taElPos; + public DS_AppTableAdapters.FileValidationTableAdapter taFV; public DS_AppTableAdapters.ItemListTableAdapter taIL; public DS_AppTableAdapters.ImportLogTableAdapter taImpLog; public DS_AppTableAdapters.ItemSearchDetailTableAdapter taISD; @@ -158,6 +159,7 @@ namespace AppData taCount = new DS_AppTableAdapters.CountersTableAdapter(); taCR = new DS_AppTableAdapters.CartsTableAdapter(); taEL = new DS_AppTableAdapters.ErrorsLogTableAdapter(); + taFV = new DS_AppTableAdapters.FileValidationTableAdapter(); taIL = new DS_AppTableAdapters.ItemListTableAdapter(); taImpLog = new DS_AppTableAdapters.ImportLogTableAdapter(); taISD = new DS_AppTableAdapters.ItemSearchDetailTableAdapter(); @@ -205,6 +207,7 @@ namespace AppData taCount.Connection.ConnectionString = connString; taCR.Connection.ConnectionString = connString; taEL.Connection.ConnectionString = connString; + taFV.Connection.ConnectionString = connString; taIL.Connection.ConnectionString = connString; taImpLog.Connection.ConnectionString = connString; taISD.Connection.ConnectionString = connString; diff --git a/Jenkinsfile b/Jenkinsfile index ef5cf8c..031e58e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,10 +11,10 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=380']) { - // env.versionNumber = VersionNumber(versionNumberString : '1.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true) - env.versionNumber = VersionNumber(versionNumberString : '1.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') - env.versionNumberBeta = VersionNumber(versionNumberString : '1.2.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') + withEnv(['NEXT_BUILD_NUMBER=385']) { + // env.versionNumber = VersionNumber(versionNumberString : '1.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true) + env.versionNumber = VersionNumber(versionNumberString : '1.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') + env.versionNumberBeta = VersionNumber(versionNumberString : '1.3.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'NKC' } } diff --git a/NKC_SDK/Enums.cs b/NKC_SDK/Enums.cs index 46b7fda..5ab6d68 100644 --- a/NKC_SDK/Enums.cs +++ b/NKC_SDK/Enums.cs @@ -1,40 +1,5 @@ namespace NKC_SDK { - /// - /// Stati degli oggetti TAKT e Stack - /// - public enum CStatus - { - /// - /// Programmato - /// - Programmed = 0, - /// - /// In corso - /// - Running, - /// - /// Completato - /// - Done - } - - /// - /// Tipologia di macchina - /// - public enum mType - { - Multiax = 0, - Offline - } - /// - /// Tipologia di ordine - /// - public enum oType - { - BatchRequest = 0, - OfflineOrder - } /// /// modalità funzionamento batch list /// @@ -44,61 +9,18 @@ /// Modalità normale (stima/nesting) /// Standard, + /// - /// MOdalità validazione aprticolari + /// Modalità validazione particolari /// - PartsEval - } - /// - /// Stati degli oggetti Batch - /// - public enum BatchStatus - { - /// - /// CSV importato - /// - Imported = 0, - /// - /// Nesting richiesto (In corso) - /// - EstimationRequested, - /// - /// Nesting Completato - /// - EstimationDone, - /// - /// Nesting richiesto (In corso) - /// - NestRequested, - /// - /// Nesting Completato - /// - NestDone, - /// - /// Nesting approvato - /// - Approved, - /// - /// Nesting scartato - /// - Discarded, - /// - /// Errori in fase di import o calcolo - /// - Errors, - /// - /// Impiegato per effettuare un test di validazione di un SINGOLO ITEM/PART - /// - PartEval, - /// - /// Test di validazione KO per un SINGOLO ITEM/PART - /// - PartKo, - /// - /// Test di validazione OK per un SINGOLO ITEM/PART - /// - PartOk + PartsEval, + + /// + /// Modalità validazione file (NON ancora particolari in ordini CSV) + /// + FileEval } + /// /// Posizione / Activity degli oggetti Batch /// @@ -108,110 +30,87 @@ /// Non iniziato /// NotStarted = 0, + /// /// Stack In corso /// StackStarted, + /// /// Stack Completato /// StackDone, + /// /// Stack currently in LOAD /// Current, + /// /// Stack completed /// Completed } + /// + /// Stati degli oggetti Batch + /// + public enum BatchStatus + { + /// + /// CSV importato + /// + Imported = 0, - /// - /// Stati degli oggetti PANEL/SHEET - /// - public enum PStatus - { /// - /// Programmato + /// Nesting richiesto (In corso) /// - Programmed = 0, + EstimationRequested, + /// - /// Stampa in corso + /// Nesting Completato /// - Printing, + EstimationDone, + /// - /// Stampa completata + /// Nesting richiesto (In corso) /// - Printed, + NestRequested, + /// - /// Lavorazione in corso + /// Nesting Completato /// - Machining, + NestDone, + /// - /// Lavorazione completata + /// Nesting approvato /// - Machined, + Approved, + /// - /// In fase di scaricamento + /// Nesting scartato /// - Unloading, + Discarded, + /// - /// Completato / scaricato da macchina (anche su tavola di scarico) + /// Errori in fase di import o calcolo /// - Unloaded, + Errors, + /// - /// Presente / letto su PROD e pronto su scissor lift + /// Impiegato per effettuare un test di validazione di un SINGOLO ITEM/PART /// - Present, + PartEval, + /// - /// Da rilavorare + /// Test di validazione KO per un SINGOLO ITEM/PART /// - ToBeRedone - } - /// - /// Destinazioni per ITEM post CNC WORK - /// - public enum ItemDest - { + PartKo, + /// - /// Destinato a BIN (painting) + /// Test di validazione OK per un SINGOLO ITEM/PART /// - Bin, - /// - /// Destinato a Cart (KIT) - /// - Cart, - /// - /// Indefinito - /// - Undef - } - /// - /// Stati ammessi per ITEM - /// - public enum ItemStatus - { - /// - /// Programmato - /// - Programmed, - /// - /// Completato/Fatto/tagliato - /// - Made, - /// - /// Preso da operatore - /// - PickUp, - /// - /// Depositato su Bin/Cesta - /// - Removed, - /// - /// Indefinito - /// - Undef + PartOk } /// @@ -232,6 +131,163 @@ BinProcessed, SecScreen } + + /// + /// Stati degli oggetti TAKT e Stack + /// + public enum CStatus + { + /// + /// Programmato + /// + Programmed = 0, + + /// + /// In corso + /// + Running, + + /// + /// Completato + /// + Done + } + + /// + /// Destinazioni per ITEM post CNC WORK + /// + public enum ItemDest + { + /// + /// Destinato a BIN (painting) + /// + Bin, + + /// + /// Destinato a Cart (KIT) + /// + Cart, + + /// + /// Indefinito + /// + Undef + } + + /// + /// Stati ammessi per ITEM + /// + public enum ItemStatus + { + /// + /// Programmato + /// + Programmed, + + /// + /// Completato/Fatto/tagliato + /// + Made, + + /// + /// Preso da operatore + /// + PickUp, + + /// + /// Depositato su Bin/Cesta + /// + Removed, + + /// + /// Indefinito + /// + Undef + } + + /// + /// Tipologia di macchina + /// + public enum mType + { + Multiax = 0, + Offline + } + + /// + /// Tipologia di ordine + /// + public enum oType + { + BatchRequest = 0, + OfflineOrder + } + + /// + /// Enum degli stati ammessi per il Nesting + /// + public enum procStatus + { + waiting = 0, + running, + error, + completed, + aborted, + accepted, + refused + } + + /// + /// Stati degli oggetti PANEL/SHEET + /// + public enum PStatus + { + /// + /// Programmato + /// + Programmed = 0, + + /// + /// Stampa in corso + /// + Printing, + + /// + /// Stampa completata + /// + Printed, + + /// + /// Lavorazione in corso + /// + Machining, + + /// + /// Lavorazione completata + /// + Machined, + + /// + /// In fase di scaricamento + /// + Unloading, + + /// + /// Completato / scaricato da macchina (anche su tavola di scarico) + /// + Unloaded, + + /// + /// Presente / letto su PROD e pronto su scissor lift + /// + Present, + + /// + /// Da rilavorare + /// + ToBeRedone + } + /// /// tipologia di report (FILE rdlc) gestito in stampa... /// @@ -248,6 +304,7 @@ cartIRKList, cartIRKGroup } + /// /// tipologia di DOCUMENTO gestito in stampa... /// @@ -257,14 +314,17 @@ /// Etichetta per un BIN (pre esecuzione compito, es verniciatura) /// docBinPre, + /// /// Etichetta per un BIN (POST esecuzione compito, es verniciatura) /// docBinPost, + /// - /// Etichetta per un CART + /// Etichetta per un CART /// docCart, + /// /// Documento per singolo ITEM: /// - QR code @@ -273,6 +333,7 @@ /// - codice dmtx leggibile (es IT000023) su NUOVA riga /// docPart, + /// /// Documento per singolo OtherItem: /// - QR code @@ -280,35 +341,25 @@ /// - descrizione /// docOtherPart, + /// /// doc per STACK /// docStack, + /// /// NON DEFINITO /// docND, + /// /// Dettaglio massimo CART --> Item Requested Kitting /// docCartIRK, + /// /// Dettaglio aggregato CART --> Item Requested Kitting /// docCartIRKSum } - - /// - /// Enum degli stati ammessi per il Nesting - /// - public enum procStatus - { - waiting = 0, - running, - error, - completed, - aborted, - accepted, - refused - } -} +} \ No newline at end of file diff --git a/NKC_WF/Controllers/BatchProcController.cs b/NKC_WF/Controllers/BatchProcController.cs index 1f8f3ec..d04f8cc 100644 --- a/NKC_WF/Controllers/BatchProcController.cs +++ b/NKC_WF/Controllers/BatchProcController.cs @@ -10,12 +10,17 @@ namespace NKC_WF.Controllers { public class BatchProcController : ApiController { + #region Protected Fields /// /// oggetto static/singleton per fare chiamate sul datalayer /// protected DataLayer DLMan = new DataLayer(); + #endregion Protected Fields + + #region Public Methods + /// /// Restituisce SE C'E' la richiesta di elaborazione BATCH corrente /// @@ -129,7 +134,7 @@ namespace NKC_WF.Controllers * - è BatchReq / OfflineOrder * - è stima iniziale o NEST dettagliato * - si tratta di una stima di validazione ITEM ... - * + * *************************************************/ if (batchProcAnsw.OrderType == oType.BatchRequest) { @@ -144,10 +149,12 @@ namespace NKC_WF.Controllers // recupero info sul batch / KIT specifico x capire se sia di tipo "validation" bool isValidation = false; + bool isTesting = false; var tabOrd = DLMan.taOL.getByBatch(rispStima.BatchID); if (tabOrd.Count > 0) { isValidation = tabOrd[0].OrdType == "V"; + isTesting = tabOrd[0].OrdType == "T"; } // calcolo status del batch... switch (rispStima.ProcessStatus) @@ -156,8 +163,9 @@ namespace NKC_WF.Controllers case procStatus.running: bStatus = 1; break; + case procStatus.completed: - if (isValidation) + if (isValidation || isTesting) { // verifico se il tempo di procesisng stimato sia > minimo... if (rispStima.EstimatedWorktime > memLayer.ML.CRI("minValidEstSec")) @@ -174,11 +182,13 @@ namespace NKC_WF.Controllers bStatus = 2; } break; + case procStatus.accepted: bStatus = 5; break; + case procStatus.refused: - if (isValidation) + if (isValidation || isTesting) { bStatus = 9; } @@ -187,8 +197,9 @@ namespace NKC_WF.Controllers bStatus = 6; } break; + case procStatus.error: - if (isValidation) + if (isValidation || isTesting) { bStatus = 9; } @@ -197,9 +208,10 @@ namespace NKC_WF.Controllers bStatus = 7; } break; + case procStatus.aborted: default: - if (isValidation) + if (isValidation || isTesting) { bStatus = 9; } @@ -211,18 +223,34 @@ namespace NKC_WF.Controllers } // SALVO info riguardo al batch running DLMan.taBL.updateStatus(rispStima.BatchID, bStatus, rispStima.EnvNum, (decimal)rispStima.EstimatedWorktime / 60); - // salvo udpate elenco ITEMS + // salvo update elenco ITEMS ComLib.updatePartsFromNesting(rispStima.PartList); // aggiorno cadPath x items che non abbiano valorizzato... - string cadBasePath = $"{memLayer.ML.CRS("nestBasePath")}{memLayer.ML.CRS("drawingFolder")}/"; + string dxfFolder = memLayer.ML.CRS("drawingFolder"); + if (isTesting) + { + dxfFolder = memLayer.ML.CRS("fileTestFolder"); + } + string cadBasePath = $"{memLayer.ML.CRS("nestBasePath")}{dxfFolder}/"; DLMan.taIL.updateCadPath(cadBasePath, rispStima.BatchID, false); // verifico IN CASO di validazione andata a buon fine --> valorizzo tabella! if (bStatus > 7) { - // recupero ordine da batch - if (tabOrd.Count > 0) + if (isValidation) { - DLMan.taIV.upsertQuery(tabOrd[0].OrderExtCode, rispStima.BatchID, bStatus, rispStima.EstimatedWorktime); + // recupero ordine da batch + if (tabOrd.Count > 0) + { + DLMan.taIV.upsertQuery(tabOrd[0].OrderExtCode, rispStima.BatchID, bStatus, rispStima.EstimatedWorktime); + } + } + else if (isTesting) + { + // recupero ordine da batch + if (tabOrd.Count > 0) + { + DLMan.taFV.upsertQuery(tabOrd[0].OrderExtCode, rispStima.BatchID, bStatus, rispStima.EstimatedWorktime); + } } } // registro OK @@ -244,18 +272,23 @@ namespace NKC_WF.Controllers case procStatus.running: bStatus = 3; break; + case procStatus.completed: bStatus = 4; break; + case procStatus.accepted: bStatus = 5; break; + case procStatus.refused: bStatus = 6; break; + case procStatus.error: bStatus = 7; break; + case procStatus.aborted: default: bStatus = 2; @@ -329,14 +362,13 @@ namespace NKC_WF.Controllers answ = "WRONG DATA (expected baseNestAnsw object)"; } } - catch(Exception exc) + catch (Exception exc) { answ = "NO"; } // se tutto OK --> tolgo ultimo batch if (answ == "OK") { - // invio notifica che c'è una busta da processare bool resetOk = ComLib.resetBatchReq(); // se tutto ok e ci sono da validare parts --> procedo! @@ -348,5 +380,7 @@ namespace NKC_WF.Controllers // restituisco risposta return answ; } + + #endregion Public Methods } -} +} \ No newline at end of file diff --git a/NKC_WF/NKC_WF.csproj b/NKC_WF/NKC_WF.csproj index 7bf5934..06d0353 100644 --- a/NKC_WF/NKC_WF.csproj +++ b/NKC_WF/NKC_WF.csproj @@ -410,6 +410,7 @@ + @@ -428,6 +429,7 @@ + @@ -808,6 +810,13 @@ DevUtils.aspx + + DxfValidation.aspx + ASPXCodeBehind + + + DxfValidation.aspx + ErrorsLog.aspx ASPXCodeBehind @@ -923,6 +932,13 @@ MachineUnloadSmart.aspx + + OrderHistory.aspx + ASPXCodeBehind + + + OrderHistory.aspx + OrderManager.aspx ASPXCodeBehind @@ -1122,6 +1138,7 @@ cmp_fileUpload.ascx + ASPXCodeBehind cmp_fileUpload.ascx diff --git a/NKC_WF/Web.config b/NKC_WF/Web.config index 4cdce84..e87090a 100644 --- a/NKC_WF/Web.config +++ b/NKC_WF/Web.config @@ -1,452 +1,448 @@ - + - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_batchList.ascx.cs b/NKC_WF/WebUserControls/cmp_batchList.ascx.cs index 973a94b..30da21a 100644 --- a/NKC_WF/WebUserControls/cmp_batchList.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_batchList.ascx.cs @@ -8,45 +8,80 @@ namespace NKC_WF.WebUserControls { public partial class cmp_batchList : BaseUserControl { + #region Protected Properties + + /// + /// BatchId selezionato + /// + protected int BatchIdSel + { + get + { + int answ = 0; + if (grView.SelectedValue != null) + { + int.TryParse(grView.SelectedValue.ToString(), out answ); + } + return answ; + } + } + + protected int currSelRow + { + get + { + return grView.SelectedIndex; + } + set + { + grView.SelectedIndex = value; + } + } + + protected int lastSelRow + { + get + { + int answ = -1; + if (!string.IsNullOrEmpty(hfLastSelRow.Value)) + { + int.TryParse(hfLastSelRow.Value, out answ); + } + return answ; + } + set + { + hfLastSelRow.Value = value.ToString(); + } + } + + #endregion Protected Properties + + #region Public Properties + + public bool deleteEnabled + { + get + { + bool answ = false; + bool.TryParse(hfDeleteEnabled.Value, out answ); + return answ; + } + set + { + hfDeleteEnabled.Value = value.ToString(); + } + } + /// /// modalità funzionamento controllo /// public BatchListMode listMode { get; set; } = BatchListMode.Standard; - /// - /// Caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - deleteEnabled = false; - cmp_numRow.numRow = 25; - grView.PageSize = cmp_numRow.numRow; - divDetail.Visible = false; - // in base al ListMode decido cosa mostrare... - checkFixOds(); - checkFixMode(); - } - cmp_batchDetail.eh_doRefresh += Cmp_batchDetail_eh_doRefresh; - cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh; - } - private void checkFixOds() - { - string isPartVal = ""; - switch (listMode) - { - case BatchListMode.PartsEval: - isPartVal = "1"; - break; - case BatchListMode.Standard: - default: - isPartVal = "0"; - break; - } - hfPartValid.Value = isPartVal; - } + + #endregion Public Properties + + #region Private Methods + /// /// In base al modo richiesto imposta filtraggi... /// @@ -90,6 +125,32 @@ namespace NKC_WF.WebUserControls } } + private void checkFixOds() + { + string isPartVal = ""; + switch (listMode) + { + case BatchListMode.PartsEval: + isPartVal = "1"; + break; + + case BatchListMode.FileEval: + isPartVal = "2"; + break; + + case BatchListMode.Standard: + default: + isPartVal = "0"; + break; + } + hfPartValid.Value = isPartVal; + } + + private void Cmp_batchDetail_eh_doRefresh(object sender, EventArgs e) + { + resetSelezione(); + } + private void Cmp_numRow_eh_doRefresh(object sender, EventArgs e) { // recupero num righe ed aggiorno... @@ -98,11 +159,122 @@ namespace NKC_WF.WebUserControls grView.DataBind(); } - private void Cmp_batchDetail_eh_doRefresh(object sender, EventArgs e) + private void fixDetails() + { + divDetail.Visible = currSelRow >= 0; + lastSelRow = currSelRow; + // recupero BatchId selezionato + cmp_batchDetail.BatchId = BatchIdSel; + updPanelDetail.Update(); + } + + private void resetSelezione() + { + checkFixOds(); + grView.SelectedIndex = -1; + lastSelRow = -1; + grView.DataBind(); + divDetail.Visible = false; + updPanelDetail.Update(); + raiseReset(); + } + + #endregion Private Methods + + #region Protected Methods + + protected void ddlStatus_SelectedIndexChanged(object sender, EventArgs e) + { + checkFixOds(); + } + + protected void grView_PageIndexChanged(object sender, EventArgs e) + { + checkFixOds(); + } + + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + fixDetails(); + } + + protected void lbRedoEval_Click(object sender, EventArgs e) + { + LinkButton lbt = (LinkButton)sender; + if (!string.IsNullOrEmpty(lbt.CommandArgument)) + { + // eseguo richiesta reset + DLMan.taBL.redoPartValid(lbt.CommandArgument); + // eventualmente mando primo batch da validare... + bool newValidSent = ComLib.sendFirstValidationBatch(); + // refresh! + resetSelezione(); + } + } + + protected void lbtDisableDel_Click(object sender, EventArgs e) + { + deleteEnabled = false; + resetSelezione(); + } + + protected void lbtEnableDel_Click(object sender, EventArgs e) + { + deleteEnabled = true; + resetSelezione(); + } + + /// + /// comando reset + /// + /// + /// + protected void lbtReset_Click(object sender, EventArgs e) { resetSelezione(); } + /// + /// Caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + deleteEnabled = false; + cmp_numRow.numRow = 25; + grView.PageSize = cmp_numRow.numRow; + divDetail.Visible = false; + // in base al ListMode decido cosa mostrare... + checkFixOds(); + checkFixMode(); + } + cmp_batchDetail.eh_doRefresh += Cmp_batchDetail_eh_doRefresh; + cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh; + } + + protected void Timer1_Tick(object sender, EventArgs e) + { + doUpdate(); + } + + #endregion Protected Methods + + #region Public Methods + + /// + /// Converte il codice stato in effettivo campo + /// + /// + /// + public string BStatus(object _status) + { + string answ = ComLib.BatchStatusDescr(_status); + return answ; + } + /// /// Codice CSS in base a status... /// @@ -118,26 +290,40 @@ namespace NKC_WF.WebUserControls case 1: answ = "font-weight-bold text-info"; break; + case 2: answ = "font-weight-bold text-primary"; break; + case 3: answ = "font-weight-bold text-warning"; break; + case 4: answ = "font-weight-bold text-danger"; break; + case 5: answ = "font-weight-bold text-success"; break; + case 6: answ = "font-weight-bold text-secondary"; break; + default: break; } return answ; } + + public void doUpdate() + { + grView.DataBind(); + currSelRow = lastSelRow; + fixDetails(); + } + /// /// Verifica se sia visualizzabile preview dato stato /// @@ -156,153 +342,6 @@ namespace NKC_WF.WebUserControls return answ; } - /// - /// Converte il codice stato in effettivo campo - /// - /// - /// - public string BStatus(object _status) - { - string answ = ComLib.BatchStatusDescr(_status); - return answ; - } - /// - /// comando reset - /// - /// - /// - protected void lbtReset_Click(object sender, EventArgs e) - { - resetSelezione(); - } - - private void resetSelezione() - { - checkFixOds(); - grView.SelectedIndex = -1; - lastSelRow = -1; - grView.DataBind(); - divDetail.Visible = false; - updPanelDetail.Update(); - raiseReset(); - } - - /// - /// BatchId selezionato - /// - protected int BatchIdSel - { - get - { - int answ = 0; - if (grView.SelectedValue != null) - { - int.TryParse(grView.SelectedValue.ToString(), out answ); - } - return answ; - } - } - protected int currSelRow - { - get - { - return grView.SelectedIndex; - } - set - { - grView.SelectedIndex = value; - } - } - protected void grView_SelectedIndexChanged(object sender, EventArgs e) - { - fixDetails(); - } - - private void fixDetails() - { - divDetail.Visible = currSelRow >= 0; - lastSelRow = currSelRow; - // recupero BatchId selezionato - cmp_batchDetail.BatchId = BatchIdSel; - updPanelDetail.Update(); - } - - protected int lastSelRow - { - get - { - int answ = -1; - if (!string.IsNullOrEmpty(hfLastSelRow.Value)) - { - int.TryParse(hfLastSelRow.Value, out answ); - } - return answ; - } - set - { - hfLastSelRow.Value = value.ToString(); - } - } - - public void doUpdate() - { - grView.DataBind(); - currSelRow = lastSelRow; - fixDetails(); - } - - protected void grView_PageIndexChanged(object sender, EventArgs e) - { - checkFixOds(); - } - - protected void lbRedoEval_Click(object sender, EventArgs e) - { - LinkButton lbt = (LinkButton)sender; - if (!string.IsNullOrEmpty(lbt.CommandArgument)) - { - // eseguo richiesta reset - DLMan.taBL.redoPartValid(lbt.CommandArgument); - // eventualmente mando primo batch da validare... - bool newValidSent = ComLib.sendFirstValidationBatch(); - // refresh! - resetSelezione(); - } - } - - protected void ddlStatus_SelectedIndexChanged(object sender, EventArgs e) - { - checkFixOds(); - } - - protected void lbtEnableDel_Click(object sender, EventArgs e) - { - deleteEnabled = true; - resetSelezione(); - } - protected void lbtDisableDel_Click(object sender, EventArgs e) - { - deleteEnabled = false; - resetSelezione(); - } - - public bool deleteEnabled - { - get - { - bool answ = false; - bool.TryParse(hfDeleteEnabled.Value, out answ); - return answ; - } - set - { - hfDeleteEnabled.Value = value.ToString(); - } - } - - protected void Timer1_Tick(object sender, EventArgs e) - { - doUpdate(); - } + #endregion Public Methods } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_fileUpload.ascx b/NKC_WF/WebUserControls/cmp_fileUpload.ascx index 9b312c7..80839bb 100644 --- a/NKC_WF/WebUserControls/cmp_fileUpload.ascx +++ b/NKC_WF/WebUserControls/cmp_fileUpload.ascx @@ -3,6 +3,7 @@ +
<%: traduci("cancel") %> @@ -21,4 +22,4 @@
-
+
\ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_fileUpload.ascx.cs b/NKC_WF/WebUserControls/cmp_fileUpload.ascx.cs index 11d99dd..65267f9 100644 --- a/NKC_WF/WebUserControls/cmp_fileUpload.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_fileUpload.ascx.cs @@ -4,44 +4,38 @@ using System.IO; namespace NKC_WF.WebUserContols { - public class FileUploadEventArgs : EventArgs - { - /// - /// Evento con argomenti soppevato post fileUpload - /// - /// - /// - /// - public FileUploadEventArgs(string localPath, string fileName, string batchName) - { - _localPath = localPath; - _fileName = fileName; - _batchName = batchName; - } - private string _localPath; - private string _fileName; - private string _batchName; - - public string LocalPath - { - get { return _localPath; } - set { _localPath = value; } - } - public string FileName - { - get { return _fileName; } - set { _fileName = value; } - } - public string BatchName - { - get { return _batchName; } - set { _batchName = value; } - } - } - - public partial class cmp_fileUpload : BaseUserControl { + #region Protected Fields + + /// + /// Folder REMOTA x copia verso SQL + /// + protected string _SqlCopyDir = memLayer.ML.CRS("_SqlCopyDir"); + + /// + /// Folder x SQL import + /// + protected string _SqlImportDir = memLayer.ML.CRS("_SqlImportDir"); + + /// + /// Folder di upload temporaneo files + /// + protected string _tempUploadDir = memLayer.ML.CRS("_tempUploadDir"); + + #endregion Protected Fields + + #region Public Events + + /// + /// Evento upload e salvataggio su server IIS del file... + /// + public event EventHandler eh_FileUploaded; + + #endregion Public Events + + #region Public Properties + /// /// Prefisso file abilitato /// @@ -58,131 +52,20 @@ namespace NKC_WF.WebUserContols } /// - /// Evento upload e salvataggio su server IIS del file... + /// Suffisso file abilitato (=tipo) /// - public event EventHandler eh_FileUploaded; - /// - /// Solelva evento salvataggio file con messaggio path/nome - /// - /// - /// - public void reportFileUploaded(FileUploadEventArgs e) - { - EventHandler handler = eh_FileUploaded; - if (handler != null) - { - handler(this, e); - } - } - - /// - /// Folder di upload temporaneo files - /// - protected string _tempUploadDir = memLayer.ML.CRS("_tempUploadDir"); - /// - /// Folder REMOTA x copia verso SQL - /// - protected string _SqlCopyDir = memLayer.ML.CRS("_SqlCopyDir"); - /// - /// Folder x SQL import - /// - protected string _SqlImportDir = memLayer.ML.CRS("_SqlImportDir"); - - - /// - /// permesso scrittura SE E' abilitato a partire dalla tab diritti... - /// - public bool userIsAuth + public string fileSuffix { get { - return true; - //return (idxAmm + idxFornitore > 0); - } - } - public bool isWriteEnabled - { - get - { - bool answ = false; - bool.TryParse(hfWriteEnabled.Value, out answ); - return answ; + return hfFileSuffix.Value; } set { - hfWriteEnabled.Value = value.ToString(); - } - } - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - divMessagge.Visible = false; - fisVisFU(false); - deleteOldFiles(); - } - divNewEdit.Visible = userIsAuth && isWriteEnabled; - } - /// - /// Procedee a bonificare la cartella di upload dei files + vecchi di 3 mesi - /// - private void deleteOldFiles() - { - string dirPath = Server.MapPath(_tempUploadDir); - // elenco files nella directory - string[] files = Directory.GetFiles(dirPath); - // li guardo tutti e se vecchi li elimino... - foreach (string file in files) - { - FileInfo fi = new FileInfo(file); - if (fi.LastAccessTime < DateTime.Now.AddMonths(-3)) - fi.Delete(); + hfFileSuffix.Value = value; } } - protected void Upload(object sender, EventArgs e) - { - string csvFileName = ""; - string uploadedFilename = ""; - string batchName = ""; - string savedFilename = ""; - string contentType = ""; - DateTime adesso = DateTime.Now; - string dirFrom = Server.MapPath(_tempUploadDir); - // se c'è un file - if (FileUpload1.PostedFile != null) - { - uploadedFilename = Path.GetFileName(FileUpload1.PostedFile.FileName.Replace(" ", "_")).ToLower(); - csvFileName = $"{adesso.ToString("dd-HHmmss")}_{uploadedFilename}"; - batchName = uploadedFilename.Replace(".csv", "").Replace("cnc", "").Replace("kit", ""); - savedFilename = Server.MapPath($"{_tempUploadDir}{csvFileName}"); - divMessagge.Visible = false; - // verifica preliminare del PRE del name... - if (!string.IsNullOrEmpty(filePrefix) && !uploadedFilename.StartsWith(filePrefix.ToLower())) - { - divMessagge.Visible = true; - lblMessage.Text = $"{traduci("FilePrefixError")} {filePrefix}"; - } - else - { - contentType = FileUpload1.PostedFile.ContentType; - // accedo allo stream del file allegato - using (Stream fs = FileUpload1.PostedFile.InputStream) - { - // scrivo su file - FileStream file = new FileStream(savedFilename, FileMode.Create, FileAccess.Write); - fs.CopyTo(file); - file.Close(); - } - // segnaloc he ho CARICATO IN LOCALE il file - reportFileUploaded(new FileUploadEventArgs(dirFrom, csvFileName, batchName)); - } - } - if (forceRedirect) - { - Response.Redirect(Request.RawUrl); - } - } /// /// Indica se fare redirect post upload /// @@ -200,11 +83,53 @@ namespace NKC_WF.WebUserContols } } - protected void btnAdd_Click(object sender, EventArgs e) + public bool isWriteEnabled { - fisVisFU(true); - lbtUpload.Text = traduci("AddNew"); + get + { + bool answ = false; + bool.TryParse(hfWriteEnabled.Value, out answ); + return answ; + } + set + { + hfWriteEnabled.Value = value.ToString(); + } } + + /// + /// permesso scrittura SE E' abilitato a partire dalla tab diritti... + /// + public bool userIsAuth + { + get + { + return true; + //return (idxAmm + idxFornitore > 0); + } + } + + #endregion Public Properties + + #region Private Methods + + /// + /// Procedee a bonificare la cartella di upload dei files + vecchi di 3 mesi + /// + private void deleteOldFiles() + { + string dirPath = Server.MapPath(_tempUploadDir); + // elenco files nella directory + string[] files = Directory.GetFiles(dirPath); + // li guardo tutti e se vecchi li elimino... + foreach (string file in files) + { + FileInfo fi = new FileInfo(file); + if (fi.LastAccessTime < DateTime.Now.AddMonths(-3)) + fi.Delete(); + } + } + /// /// fix visibilità controllo file upload /// @@ -216,10 +141,167 @@ namespace NKC_WF.WebUserContols lbtCancel.Visible = showAdd; } + #endregion Private Methods + + #region Protected Methods + + protected void btnAdd_Click(object sender, EventArgs e) + { + fisVisFU(true); + lbtUpload.Text = traduci("AddNew"); + } + protected void btnCancel_Click(object sender, EventArgs e) { Response.Redirect(Request.RawUrl); } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + divMessagge.Visible = false; + fisVisFU(false); + deleteOldFiles(); + } + divNewEdit.Visible = userIsAuth && isWriteEnabled; + } + + protected void Upload(object sender, EventArgs e) + { + string uplFileName = ""; + string uploadedFilename = ""; + string batchName = ""; + string savedFilename = ""; + string contentType = ""; + DateTime adesso = DateTime.Now; + string dirFrom = Server.MapPath(_tempUploadDir); + // se c'è un file + if (FileUpload1.PostedFile != null) + { + uploadedFilename = Path.GetFileName(FileUpload1.PostedFile.FileName.Replace(" ", "_")).ToLower(); + // verifico suffisso sia corretto... + if (!string.IsNullOrEmpty(fileSuffix) && !uploadedFilename.EndsWith(fileSuffix.ToLower())) + { + divMessagge.Visible = true; + lblMessage.Text = $"{traduci("FileSuffixError")} {fileSuffix}"; + } + else + { + // se sono a validare dxf... + if (fileSuffix == ".dxf") + { + uplFileName = uploadedFilename; + batchName = uploadedFilename; + } + else + { + // altrimenti per csv CNC/KIT.. + uplFileName = $"{adesso.ToString("dd-HHmmss")}_{uploadedFilename}"; + batchName = uploadedFilename.Replace(fileSuffix, "").Replace("cnc", "").Replace("kit", ""); + } + savedFilename = Server.MapPath($"{_tempUploadDir}{uplFileName}"); + divMessagge.Visible = false; + // verifica preliminare del PRE del name... + if (!string.IsNullOrEmpty(filePrefix) && !uploadedFilename.StartsWith(filePrefix.ToLower())) + { + divMessagge.Visible = true; + lblMessage.Text = $"{traduci("FilePrefixError")} {filePrefix}"; + } + else + { + contentType = FileUpload1.PostedFile.ContentType; + // accedo allo stream del file allegato + using (Stream fs = FileUpload1.PostedFile.InputStream) + { + // scrivo su file + FileStream file = new FileStream(savedFilename, FileMode.Create, FileAccess.Write); + fs.CopyTo(file); + file.Close(); + // log! + logger.lg.scriviLog($"Effettuato salvataggio file {uploadedFilename} come {savedFilename}"); + } + // segnaloc he ho CARICATO IN LOCALE il file + reportFileUploaded(new FileUploadEventArgs(dirFrom, uplFileName, batchName)); + } + } + } + if (forceRedirect) + { + Response.Redirect(Request.RawUrl); + } + } + + #endregion Protected Methods + + #region Public Methods + + /// + /// Solelva evento salvataggio file con messaggio path/nome + /// + /// + /// + public void reportFileUploaded(FileUploadEventArgs e) + { + EventHandler handler = eh_FileUploaded; + if (handler != null) + { + handler(this, e); + } + } + + #endregion Public Methods + } + + public class FileUploadEventArgs : EventArgs + { + #region Private Fields + + private string _batchName; + + private string _fileName; + + private string _localPath; + + #endregion Private Fields + + #region Public Constructors + + /// + /// Evento con argomenti soppevato post fileUpload + /// + /// + /// + /// + public FileUploadEventArgs(string localPath, string fileName, string batchName) + { + _localPath = localPath; + _fileName = fileName; + _batchName = batchName; + } + + #endregion Public Constructors + + #region Public Properties + + public string BatchName + { + get { return _batchName; } + set { _batchName = value; } + } + + public string FileName + { + get { return _fileName; } + set { _fileName = value; } + } + + public string LocalPath + { + get { return _localPath; } + set { _localPath = value; } + } + + #endregion Public Properties } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_fileUpload.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_fileUpload.ascx.designer.cs index 63c0c84..46da4f5 100644 --- a/NKC_WF/WebUserControls/cmp_fileUpload.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_fileUpload.ascx.designer.cs @@ -41,6 +41,15 @@ namespace NKC_WF.WebUserContols /// protected global::System.Web.UI.WebControls.HiddenField hfFilePrefix; + /// + /// Controllo hfFileSuffix. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.HiddenField hfFileSuffix; + /// /// Controllo divFileUpl. /// diff --git a/NKC_WF/site/DxfValidation.aspx b/NKC_WF/site/DxfValidation.aspx new file mode 100644 index 0000000..e07f14e --- /dev/null +++ b/NKC_WF/site/DxfValidation.aspx @@ -0,0 +1,26 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="DxfValidation.aspx.cs" Inherits="NKC_WF.site.DxfValidation" %> + +<%@ Register Src="~/WebUserControls/cmp_batchList.ascx" TagPrefix="uc1" TagName="cmp_batchList" %> +<%@ Register Src="~/WebUserControls/cmp_fileUpload.ascx" TagPrefix="uc1" TagName="cmp_fileUpload" %> + + +
+
+
+

<%: traduci("DxfValidation") %>

+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/NKC_WF/site/DxfValidation.aspx.cs b/NKC_WF/site/DxfValidation.aspx.cs new file mode 100644 index 0000000..5f8e3a4 --- /dev/null +++ b/NKC_WF/site/DxfValidation.aspx.cs @@ -0,0 +1,111 @@ +using AppData; +using SteamWare; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace NKC_WF.site +{ + public partial class DxfValidation : BasePage + { + #region Protected Fields + + /// + /// Path base x nesting, area TEMP + /// + protected string cadBasePath = $"{memLayer.ML.CRS("nestBasePath")}{memLayer.ML.CRS("fileTestFolder")}/"; + + /// + /// Path base x server, area TEMP + /// + protected string srvCadBasePath = $"{memLayer.ML.CRS("servBasePath")}{memLayer.ML.CRS("fileTestFolder")}/"; + + #endregion Protected Fields + + #region Private Methods + + private void Cmp_fileUpload_eh_FileUploaded(object sender, WebUserContols.FileUploadEventArgs e) + { + /*-------------------------------------------- + * Note Testing: + * - copio file (sovrascrivendo) in area testing + * - sul DB creo (se necessario) batch di testing (oppure update esistente in status 8) + * - avvio validazione SE non ne ho altre in corso + * + *--------------------------------------------*/ + + bool dataValidated = true; + DateTime adesso = DateTime.Now; + string dirFrom = e.LocalPath; + int batchID = 0; + string TaktCode = $"T{e.FileName.ToLower().Replace(".dxf", "")}"; + // copio su area testing + try + { + // copio su folder... + fileMover.obj.copiaFile(dirFrom, srvCadBasePath, e.FileName); + } + catch (Exception exc) + { + logger.lg.scriviLog($"{traduci("ErrFileTestImport01")}:{Environment.NewLine}{exc}"); + DLMan.taEL.insertQuery(DateTime.Now, "Copy DXF", $"{e.BatchName}", $"{e.BatchName}.{e.FileName}", $"Exception: {exc}"); + } + // chiamo stored caricamento + try + { + // chiamo procedura SQL x import... + DLMan.taBL.createFileValBatch(e.FileName.ToLower().Replace(".dxf", ""), cadBasePath); + } + catch (Exception exc) + { + logger.lg.scriviLog($"{traduci("ErrFileTestImport02")}:{Environment.NewLine}{exc}"); + // salvo log errore... + DLMan.taEL.insertQuery(DateTime.Now, "Import KIT TEST", $"{e.BatchName}", $"{e.BatchName}.{e.FileName}", $"Exception: {exc}"); + dataValidated = false; + } + try + { + var tabBatch = DLMan.taBL.getLastByTakt(TaktCode); + if (tabBatch != null) + { + if (tabBatch.Count > 0) + { + batchID = tabBatch[0].BatchID; + } + } + } + catch (Exception exc) + { + logger.lg.scriviLog($"{traduci("ErrOrderCsvImp03")}:{Environment.NewLine}{exc}"); + dataValidated = false; + } + if (batchID > 0) + { + // FIX eventuali cadFilePath... + DLMan.taIL.updateCadPath(cadBasePath, 0, false); + // chiamo procedura x inserire come NON validato in FileValidation + DLMan.taFV.upsertQuery(TaktCode, batchID, 8, 0); + if (dataValidated) + { + // avvio validazione! + bool newValidSent = ComLib.sendFirstValidationBatch(); + } + } + Response.Redirect(Request.RawUrl); + } + + #endregion Private Methods + + #region Protected Methods + + protected void Page_Load(object sender, EventArgs e) + { + cmp_fileUpload.eh_FileUploaded += Cmp_fileUpload_eh_FileUploaded; + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/NKC_WF/site/DxfValidation.aspx.designer.cs b/NKC_WF/site/DxfValidation.aspx.designer.cs new file mode 100644 index 0000000..0a2ebe8 --- /dev/null +++ b/NKC_WF/site/DxfValidation.aspx.designer.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// +// Codice generato da uno strumento. +// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// +//------------------------------------------------------------------------------ + +namespace NKC_WF.site +{ + + + public partial class DxfValidation + { + + /// + /// Controllo cmp_fileUpload. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::NKC_WF.WebUserContols.cmp_fileUpload cmp_fileUpload; + + /// + /// Controllo divFileList. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divFileList; + + /// + /// Controllo cmp_batchList. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::NKC_WF.WebUserControls.cmp_batchList cmp_batchList; + } +} diff --git a/NKC_WF/site/KitRequestImporter.aspx b/NKC_WF/site/KitRequestImporter.aspx index 7b0a981..68ee123 100644 --- a/NKC_WF/site/KitRequestImporter.aspx +++ b/NKC_WF/site/KitRequestImporter.aspx @@ -4,7 +4,6 @@ <%@ Register Src="~/WebUserControls/cmp_kitList.ascx" TagPrefix="uc1" TagName="cmp_kitList" %> <%@ Register Src="~/WebUserControls/cmp_kitImpCheck.ascx" TagPrefix="uc1" TagName="cmp_kitImpCheck" %> -
@@ -14,7 +13,7 @@
- +
@@ -36,4 +35,4 @@
- + \ No newline at end of file diff --git a/NKC_WF/site/OrderHistory.aspx b/NKC_WF/site/OrderHistory.aspx new file mode 100644 index 0000000..d7d97da --- /dev/null +++ b/NKC_WF/site/OrderHistory.aspx @@ -0,0 +1,18 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/SiteContent.master" AutoEventWireup="true" CodeBehind="OrderHistory.aspx.cs" Inherits="NKC_WF.site.OrderHistory" %> + + +
+
+
+

<%: traduci("OrderHistory") %>

+
+
+
+
+ FULL orders List +
+
+
+
+
+
\ No newline at end of file diff --git a/NKC_WF/site/OrderHistory.aspx.cs b/NKC_WF/site/OrderHistory.aspx.cs new file mode 100644 index 0000000..e58cbd4 --- /dev/null +++ b/NKC_WF/site/OrderHistory.aspx.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace NKC_WF.site +{ + public partial class OrderHistory : BasePage + { + #region Protected Methods + + protected void Page_Load(object sender, EventArgs e) + { + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/NKC_WF/site/OrderHistory.aspx.designer.cs b/NKC_WF/site/OrderHistory.aspx.designer.cs new file mode 100644 index 0000000..0fb1732 --- /dev/null +++ b/NKC_WF/site/OrderHistory.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// Codice generato da uno strumento. +// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// +//------------------------------------------------------------------------------ + +namespace NKC_WF.site +{ + + + public partial class OrderHistory + { + + /// + /// Controllo divFileList. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divFileList; + } +} diff --git a/NKC_WF/site/OrderManager.aspx b/NKC_WF/site/OrderManager.aspx index 51b3350..fae7c73 100644 --- a/NKC_WF/site/OrderManager.aspx +++ b/NKC_WF/site/OrderManager.aspx @@ -12,7 +12,7 @@
- +
@@ -21,4 +21,4 @@
- + \ No newline at end of file