Files
XPS/project/XPST_deploy/Source/WebUserControls/mod_btnComandi.ascx.cs
T
samuele ee502bf6a6 Update XPST
git-svn-id: https://keyhammer.ath.cx/svn/XPS/trunk@126 43c8e981-f90d-406c-a89a-24a2c4268d51
2012-02-10 10:05:41 +00:00

111 lines
3.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using XPS_data;
namespace XPST.WebUserControls
{
public partial class mod_btnComandi : System.Web.UI.UserControl
{
/// <summary>
/// evento comando clicked
/// </summary>
public event EventHandler eh_clickComando;
protected void Page_Load(object sender, EventArgs e)
{
setupComandiBarcode();
disegnaBtn();
}
/// <summary>
/// effettua disegno dei buttons
/// </summary>
private void disegnaBtn()
{
// carico i comandi nei buttons
btn1.Text = comandiAmmessi["04"];
btn2.Text = comandiAmmessi["05"];
btn3.Text = comandiAmmessi["06"];
btn5.Text = comandiAmmessi["ok"];
btn6.Text = comandiAmmessi["ko"];
}
/// <summary>
/// carico da tab i comandi ammessi per il barcode...
/// </summary>
private void setupComandiBarcode()
{
XPS_data.DS_applicazioneTableAdapters.TraEv2StatiTableAdapter taTrEv2St = new XPS_data.DS_applicazioneTableAdapters.TraEv2StatiTableAdapter();
DS_applicazione.TraEv2StatiDataTable _tabTran = taTrEv2St.getByCodMappa("E_BC");
Dictionary<string, string> comandi = new Dictionary<string, string>();
foreach (DS_applicazione.TraEv2StatiRow riga in _tabTran)
{
comandi.Add(riga.CodEvento, user_std.UtSn.Traduci(riga.text2show));
}
// impongo i comandi al barcode...
comandiAmmessi = comandi;
}
/// <summary>
/// dictionary comandi ammessi
/// </summary>
protected Dictionary<string, string> _comandi = new Dictionary<string, string>();
/// <summary>
/// elenco dei comandi riconosciuti
/// </summary>
public Dictionary<string, string> comandiAmmessi
{
get
{
return _comandi;
}
set
{
_comandi = value;
}
}
/// <summary>
/// segnala click su button comando
/// </summary>
public void segnalaClick()
{
if (eh_clickComando != null)
{
eh_clickComando(this, new EventArgs());
}
}
protected void btn1_Click(object sender, EventArgs e)
{
memLayer.ML.setSessionVal("btnCmdPress", "04", false);
segnalaClick();
}
protected void btn2_Click(object sender, EventArgs e)
{
memLayer.ML.setSessionVal("btnCmdPress", "05", false);
segnalaClick();
}
protected void btn3_Click(object sender, EventArgs e)
{
memLayer.ML.setSessionVal("btnCmdPress", "06", false);
segnalaClick();
}
protected void btn4_Click(object sender, EventArgs e)
{
}
protected void btn5_Click(object sender, EventArgs e)
{
memLayer.ML.setSessionVal("btnCmdPress", "ok", false);
segnalaClick();
}
protected void btn6_Click(object sender, EventArgs e)
{
memLayer.ML.setSessionVal("btnCmdPress", "ko", false);
segnalaClick();
}
}
}