using SteamWare;
using System;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace GMW.WebUserControls
{
  public partial class mod_numKey : System.Web.UI.UserControl
  {
    /// <summary>
    /// arg comando CANC
    /// </summary>
    protected string cmdCanc = "C";
    /// <summary>
    /// arg comando SAVE
    /// </summary>
    protected string cmdSave = "S";
    protected void Page_Load(object sender, EventArgs e)
    {
      if (!Page.IsPostBack)
      {
        btnS.CommandArgument = cmdSave;
        btnC.CommandArgument = cmdCanc;
      }
    }

    protected void btn_Click(object sender, EventArgs e)
    {
      // controllo SE sia reset o canc...
      string inChar = ((Button)sender).CommandArgument;
      if (inChar == cmdCanc)
      {
        lblInput.Text = "";
      }
      else if (inChar == cmdSave)
      {
        // salvo valore in sessione e ricarico...
        memLayer.ML.setSessionVal("numKeyIn", lblInput.Text);
        //lblInput.Text = "";
        // ricarico
        Response.Redirect(user_std.pagCorrente);
      }
      else
      {
        lblInput.Text += ((Button)sender).CommandArgument;
      }
    }
  }
}