Files
2020-12-31 10:35:24 +01:00

91 lines
1.8 KiB
C#

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
{
/// <summary>
/// Elenco dei lotti selezionati
/// </summary>
public List<string> lottiSel
{
get
{
List<string> answ = null;
string rawVal = hfJsonLotti.Value;
try
{
answ = JsonConvert.DeserializeObject<List<string>>(rawVal);
}
catch
{ }
if (answ == null)
{
answ = new List<string>();
}
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();
}
}
/// <summary>
/// Elenco lotti in formato HashList
/// </summary>
public string elLotti
{
get
{
return hfHashList.Value;
}
}
/// <summary>
/// CodStato richiesto
/// </summary>
public string CodStato
{
get
{
return hfCodStato.Value;
}
set
{
hfCodStato.Value = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// Update grid view
/// </summary>
public void doUpdate()
{
grView.DataBind();
}
/// <summary>
/// reset sel lottoIn
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtResetLottoIn_Click(object sender, EventArgs e)
{
raiseReset();
}
}
}