using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace MP_MAG.WebUserControls { public partial class cmp_LottiIn : BaseUserControl { /// /// Elenco dei lotti selezionati /// public List lottiSel { get { List answ = null; string rawVal = hfJsonLotti.Value; try { answ = JsonConvert.DeserializeObject>(rawVal); } catch { } if (answ == null) { answ = new List(); } return answ; } set { string rawVal = JsonConvert.SerializeObject(value); hfJsonLotti.Value = rawVal; // salvo ANCHE elenco in formato #lotto#lotto# string eliString = $"#{string.Join("#", value)}#"; hfHashList.Value = eliString; // update grView... grView.DataBind(); } } /// /// Elenco lotti in formato HashList /// public string elLotti { get { return hfHashList.Value; } } /// /// CodStato richiesto /// public string CodStato { get { return hfCodStato.Value; } set { hfCodStato.Value = value; } } protected void Page_Load(object sender, EventArgs e) { } /// /// Update grid view /// public void doUpdate() { grView.DataBind(); } /// /// reset sel lottoIn /// /// /// protected void lbtResetLottoIn_Click(object sender, EventArgs e) { raiseReset(); } } }