From 39243e67149b65c87c596ca87617375b8f2d412b Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 13 Mar 2020 19:16:55 +0100 Subject: [PATCH] Fix bundle --- MP-MAG/BaseUserControl.cs | 101 ++++++++++++++++++++++++++++++++++++++ MP-MAG/Boundle.config | 4 +- 2 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 MP-MAG/BaseUserControl.cs diff --git a/MP-MAG/BaseUserControl.cs b/MP-MAG/BaseUserControl.cs new file mode 100644 index 0000000..c681079 --- /dev/null +++ b/MP-MAG/BaseUserControl.cs @@ -0,0 +1,101 @@ +using Newtonsoft.Json; +using SteamWare; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace MP_MAG +{ + public class BaseUserControl : System.Web.UI.UserControl + { + /// + /// Generico evento di richiesta refresh a aprent + /// + public event EventHandler eh_doRefresh; + /// + /// Generico evento di richiesta refresh a aprent + /// + public event EventHandler eh_doReset; + /// + /// Chiamata evento + /// + public void raiseEvent() + { + // se qualcuno ascolta sollevo evento nuovo valore... + if (eh_doRefresh != null) + { + eh_doRefresh(this, new EventArgs()); + } + } + /// + /// Chiamata evento + /// + public void raiseReset() + { + // se qualcuno ascolta sollevo evento nuovo valore... + if (eh_doReset != null) + { + eh_doReset(this, new EventArgs()); + } + } + /// + /// Wrapper traduzione termini + /// + /// + /// + public string traduci(string lemma) + { + return SteamWare.user_std.UtSn.Traduci(lemma); + } + +#if false + protected Dictionary anagMateriali + { + set + { + string jsonData = JsonConvert.SerializeObject(value); + memLayer.ML.setRSV("anagMateriali", jsonData, 60); + } + get + { + Dictionary answ = new Dictionary(); + //cerco in redis... + string rawData = memLayer.ML.getRSV("anagMateriali"); + if (!string.IsNullOrEmpty(rawData)) + { + answ = JsonConvert.DeserializeObject>(rawData); + } + // sennò nel DB e salvo in redis... + else + { + var tabMat = DataLayer.man.taMat.GetData(); + foreach (var item in tabMat) + { + answ.Add(item.MatID, item.MatDesc); + } + // salvo in redis + anagMateriali = answ; + } + // restituisco + return answ; + } + } + + public string matByKey(object _matId) + { + string answ = ""; + int matId = 0; + int.TryParse(_matId.ToString(), out matId); + try + { + answ = anagMateriali[matId]; + } + catch + { } + return answ; + } +#endif + + } +} \ No newline at end of file diff --git a/MP-MAG/Boundle.config b/MP-MAG/Boundle.config index c6a045b..1453b5a 100644 --- a/MP-MAG/Boundle.config +++ b/MP-MAG/Boundle.config @@ -2,8 +2,8 @@ - - + + \ No newline at end of file