diff --git a/AppData/AppData.csproj b/AppData/AppData.csproj index cdd608a..a534453 100644 --- a/AppData/AppData.csproj +++ b/AppData/AppData.csproj @@ -108,13 +108,11 @@ ..\packages\StackExchange.Redis.2.2.62\lib\net461\StackExchange.Redis.dll - - ..\packages\SteamWare.5.1.2108.1115\lib\net462\SteamWare.dll - True + + ..\packages\SteamWare.5.1.2108.1911\lib\net462\SteamWare.dll - - ..\packages\SteamWare.Logger.5.1.2108.1115\lib\net462\SteamWare.Logger.dll - True + + ..\packages\SteamWare.Logger.5.1.2108.1911\lib\net462\SteamWare.Logger.dll @@ -276,6 +274,10 @@ + + + + diff --git a/AppData/packages.config b/AppData/packages.config index 2aa36d8..3ab9327 100644 --- a/AppData/packages.config +++ b/AppData/packages.config @@ -21,8 +21,8 @@ - - + + diff --git a/NKC_WF/BaseUserControl.cs b/NKC_WF/BaseUserControl.cs index ea65a30..fe00cf3 100644 --- a/NKC_WF/BaseUserControl.cs +++ b/NKC_WF/BaseUserControl.cs @@ -275,7 +275,14 @@ namespace NKC_WF /// public string traduci(string lemma) { - return SteamWare.user_std.UtSn.Traduci(lemma); + string answ = $"__{lemma}__"; + try + { + answ = SteamWare.user_std.UtSn.Traduci(lemma); + } + catch + { } + return answ; } #endregion Public Methods diff --git a/NKC_WF/NKC_WF.csproj b/NKC_WF/NKC_WF.csproj index 7d6889e..37b2d9e 100644 --- a/NKC_WF/NKC_WF.csproj +++ b/NKC_WF/NKC_WF.csproj @@ -127,13 +127,11 @@ ..\packages\StackExchange.Redis.2.2.62\lib\net461\StackExchange.Redis.dll - - ..\packages\SteamWare.5.1.2108.1115\lib\net462\SteamWare.dll - True + + ..\packages\SteamWare.5.1.2108.1911\lib\net462\SteamWare.dll - - ..\packages\SteamWare.Logger.5.1.2108.1115\lib\net462\SteamWare.Logger.dll - True + + ..\packages\SteamWare.Logger.5.1.2108.1911\lib\net462\SteamWare.Logger.dll ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll @@ -312,6 +310,8 @@ + + Always @@ -476,6 +476,8 @@ + + diff --git a/NKC_WF/Web.config b/NKC_WF/Web.config index 832da7f..1a7dbc7 100644 --- a/NKC_WF/Web.config +++ b/NKC_WF/Web.config @@ -81,6 +81,7 @@ + diff --git a/NKC_WF/packages.config b/NKC_WF/packages.config index 2e9f738..dab38fd 100644 --- a/NKC_WF/packages.config +++ b/NKC_WF/packages.config @@ -59,8 +59,8 @@ - - + + diff --git a/NKC_WF/site/BatchPreview.aspx.cs b/NKC_WF/site/BatchPreview.aspx.cs index 43f4257..d11c621 100644 --- a/NKC_WF/site/BatchPreview.aspx.cs +++ b/NKC_WF/site/BatchPreview.aspx.cs @@ -9,17 +9,19 @@ namespace NKC_WF.site { public partial class BatchPreview : BasePage { + #region Protected Properties + /// - /// Batch corrente... + /// BunkId selezionato /// - public int BatchId + protected int BunkId { get { - int answ = memLayer.ML.QSI("BatchId"); - return answ; + return cmp_BP_bunkList.BunkIdSel; } } + /// /// Indice bunk selezionato (0..n-1) /// @@ -34,16 +36,18 @@ namespace NKC_WF.site cmp_BP_bunkList.selIndex = value; } } + /// /// BunkId selezionato /// - protected int BunkId + protected int SheetId { get { - return cmp_BP_bunkList.BunkIdSel; + return cmp_BP_sheetList.SheetIdSel; } } + /// /// Indice sheet selezionato (0..n-1) /// @@ -58,34 +62,15 @@ namespace NKC_WF.site cmp_BP_sheetList.selIndex = value; } } - /// - /// BunkId selezionato - /// - protected int SheetId - { - get - { - return cmp_BP_sheetList.SheetIdSel; - } - } - /// - /// valore selezionato nello slider - /// - protected int valSlider - { - get - { - return cmp_slider.selValue; - } - set - { - cmp_slider.selValue = value; - } - } + /// /// Chaive URL base x gestione sheet del batch corrente /// - protected string tabSheetKey; + protected string tabSheetKey + { + get => $"{memLayer.ML.redHash($"TabSheets")}:{BatchId}"; + } + /// /// Elenco fogli della gestione corrente /// @@ -108,145 +93,50 @@ namespace NKC_WF.site } set { - string rawData = JsonConvert.SerializeObject(value); - memLayer.ML.setRSV(tabSheetKey, rawData, 60); - } - } - /// - /// Restituisce la riga dall'indice inserito ( - /// - /// valore 1..maxSheets - /// - protected DS_App.SheetListRow rigaSel(int indice) - { - DS_App.SheetListRow answ = null; - // init var - int maxNum = tabSheets.Count; - // base 0 --> riduco di 1... - indice--; - // controllo valore sia accettabile... - indice = indice < 0 ? 0 : indice; - indice = indice >= maxNum ? maxNum - 1 : indice; - try - { - answ = tabSheets[indice]; - } - catch - { } - // restituisco! - return answ; - } - /// - /// Restituisce la PRIMA riga dal codice BUNK inserito - /// - /// valore 1..numBunk - /// - protected DS_App.SheetListRow rigaByBunk(int BunkId) - { - DS_App.SheetListRow answ = null; - try - { - answ = tabSheets.First(x => x.StackID == BunkId); - } - catch - { } - // restituisco! - return answ; - } - /// - /// Restituisce la riga dal codice Sheet inserito - /// - /// valore 1..numBunk - /// - protected DS_App.SheetListRow rigaBySheet(int SheetId) - { - DS_App.SheetListRow answ = null; - try - { - answ = tabSheets.First(x => x.StackID == SheetId); - } - catch - { } - // restituisco! - return answ; - } - /// - /// caicamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - ((SiteMaster)this.Master).showSearch = false; - tabSheetKey = $"{memLayer.ML.redHash($"TabSheets")}:{BatchId}"; - // imposto bunk! - cmp_BP_bunkList.BatchId = BatchId; - setupSlider(); - doUpdate(); - } - cmp_BP_bunkList.eh_doRefresh += Cmp_BP_bunkList_eh_doRefresh; - cmp_BP_sheetList.eh_doRefresh += Cmp_BP_sheetList_eh_doRefresh; - cmp_slider.eh_doRefresh += Cmp_slider_eh_doRefresh; - } - /// - /// Setup slider da num fogli - /// - private void setupSlider() - { - cmp_slider.minVal = 1; - cmp_slider.maxVal = tabSheets.Count; - cmp_slider.selValue = 1; - } - - - private void doUpdate() - { - updateBySlider(); - } - private void Cmp_slider_eh_doRefresh(object sender, EventArgs e) - { - updateBySlider(); - } - /// - /// Effettua update da Slider --> valore selezionato - /// - private void updateBySlider() - { - // il valore assoluto dello slider è già corretto... cerco nella tab! - DS_App.SheetListRow currRow = rigaSel(valSlider); - if (currRow != null) - { - // recupero indice bunk e sheets e seleziono - bunkIndex = currRow.StackIndex - 1; - cmp_BP_sheetList.BunkId = cmp_BP_bunkList.BunkIdSel; - sheetIndex = currRow.SheetIndex - 1; - // update svg... - cmp_MU_svgViewer.SheetId = currRow.SheetID; - } - } - - private void Cmp_BP_sheetList_eh_doRefresh(object sender, EventArgs e) - { - // calcolo indice slider da chiave sheet... - int num = 1; - foreach (var item in tabSheets) - { - if (item.SheetID == cmp_BP_sheetList.SheetIdSel) + string rawData = ""; + if (value.Count > 0) { - break; - } - else - { - num++; + rawData = JsonConvert.SerializeObject(value); } + memLayer.ML.setRSV(tabSheetKey, rawData, 300); } - cmp_slider.selValue = num; - // update svg... - cmp_MU_svgViewer.SheetId = cmp_BP_sheetList.SheetIdSel; } + /// + /// valore selezionato nello slider + /// + protected int valSlider + { + get + { + return cmp_slider.selValue; + } + set + { + cmp_slider.selValue = value; + } + } + + #endregion Protected Properties + + #region Public Properties + + /// + /// Batch corrente... + /// + public int BatchId + { + get + { + int answ = memLayer.ML.QSI("BatchId"); + return answ; + } + } + + #endregion Public Properties + + #region Private Methods + private void Cmp_BP_bunkList_eh_doRefresh(object sender, EventArgs e) { DS_App.SheetListRow currRow = rigaByBunk(cmp_BP_bunkList.BunkIdSel); @@ -254,7 +144,8 @@ namespace NKC_WF.site { // calcolo indice slider da chiave sheet... int num = 1; - foreach (var item in tabSheets) + var currTabSheets = tabSheets; + foreach (var item in currTabSheets) { if (item.SheetID == currRow.SheetID) { @@ -273,5 +164,154 @@ namespace NKC_WF.site cmp_MU_svgViewer.SheetId = currRow.SheetID; } } + + private void Cmp_BP_sheetList_eh_doRefresh(object sender, EventArgs e) + { + // calcolo indice slider da chiave sheet... + int num = 1; + var currTabSheets = tabSheets; + foreach (var item in currTabSheets) + { + if (item.SheetID == cmp_BP_sheetList.SheetIdSel) + { + break; + } + else + { + num++; + } + } + cmp_slider.selValue = num; + // update svg... + cmp_MU_svgViewer.SheetId = cmp_BP_sheetList.SheetIdSel; + } + + private void Cmp_slider_eh_doRefresh(object sender, EventArgs e) + { + updateBySlider(); + } + + private void doUpdate() + { + updateBySlider(); + } + + /// + /// Setup slider da num fogli + /// + private void setupSlider() + { + cmp_slider.minVal = 1; + cmp_slider.maxVal = tabSheets.Count; + cmp_slider.selValue = 1; + } + + /// + /// Effettua update da Slider --> valore selezionato + /// + private void updateBySlider() + { + // il valore assoluto dello slider è già corretto... cerco nella tab! + DS_App.SheetListRow currRow = rigaSel(valSlider); + if (currRow != null) + { + // recupero indice bunk e sheets e seleziono + bunkIndex = currRow.StackIndex - 1; + cmp_BP_sheetList.BunkId = cmp_BP_bunkList.BunkIdSel; + sheetIndex = currRow.SheetIndex - 1; + // update svg... + cmp_MU_svgViewer.SheetId = currRow.SheetID; + } + } + + #endregion Private Methods + + #region Protected Methods + + /// + /// caicamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + ((SiteMaster)this.Master).showSearch = false; + // imposto bunk! + cmp_BP_bunkList.BatchId = BatchId; + setupSlider(); + doUpdate(); + } + cmp_BP_bunkList.eh_doRefresh += Cmp_BP_bunkList_eh_doRefresh; + cmp_BP_sheetList.eh_doRefresh += Cmp_BP_sheetList_eh_doRefresh; + cmp_slider.eh_doRefresh += Cmp_slider_eh_doRefresh; + } + + /// + /// Restituisce la PRIMA riga dal codice BUNK inserito + /// + /// valore 1..numBunk + /// + protected DS_App.SheetListRow rigaByBunk(int BunkId) + { + DS_App.SheetListRow answ = null; + try + { + var currTabSheets = tabSheets; + answ = currTabSheets.First(x => x.StackID == BunkId); + } + catch + { } + // restituisco! + return answ; + } + + /// + /// Restituisce la riga dal codice Sheet inserito + /// + /// valore 1..numBunk + /// + protected DS_App.SheetListRow rigaBySheet(int SheetId) + { + DS_App.SheetListRow answ = null; + try + { + var currTabSheets = tabSheets; + answ = currTabSheets.First(x => x.StackID == SheetId); + } + catch + { } + // restituisco! + return answ; + } + + /// + /// Restituisce la riga dall'indice inserito ( + /// + /// valore 1..maxSheets + /// + protected DS_App.SheetListRow rigaSel(int indice) + { + DS_App.SheetListRow answ = null; + var currTabSheets = tabSheets; + // init var + int maxNum = currTabSheets.Count; + // base 0 --> riduco di 1... + indice--; + // controllo valore sia accettabile... + indice = indice < 0 ? 0 : indice; + indice = indice >= maxNum ? maxNum - 1 : indice; + try + { + answ = currTabSheets[indice]; + } + catch + { } + // restituisco! + return answ; + } + + #endregion Protected Methods } } \ No newline at end of file