80 lines
1.9 KiB
C#
80 lines
1.9 KiB
C#
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_barcode : BaseUserControl
|
|
{
|
|
#region Public Properties
|
|
|
|
/// <summary>
|
|
/// Valore acquisito in lettura barcode
|
|
/// </summary>
|
|
public string inputAcquired
|
|
{
|
|
get
|
|
{
|
|
return txtBarcode.Text.Trim();
|
|
}
|
|
set
|
|
{
|
|
txtBarcode.Text = value;
|
|
txtBarcode.Focus();
|
|
}
|
|
}
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
resetMessage();
|
|
}
|
|
else if (string.IsNullOrEmpty(inputAcquired))
|
|
{
|
|
raiseEvent();
|
|
}
|
|
}
|
|
|
|
protected void txtBarcode_TextChanged(object sender, EventArgs e)
|
|
{
|
|
if (!string.IsNullOrEmpty(inputAcquired))
|
|
{
|
|
raiseEvent();
|
|
}
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Public Methods
|
|
|
|
public void resetMessage()
|
|
{
|
|
lblOutput.Visible = false;
|
|
lblOutput.Text = "";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gestione output da mostrare (opzionale
|
|
/// </summary>
|
|
/// <param name="cssClass"></param>
|
|
/// <param name="messaggio"></param>
|
|
public void showOutput(string cssClass, string messaggio)
|
|
{
|
|
// In primis: mostro qualcosa SOLO SE ho del testo
|
|
lblOutput.Attributes.Remove("class");
|
|
lblOutput.Attributes.Add("class", cssClass);
|
|
lblOutput.Text = messaggio;
|
|
lblOutput.Visible = !string.IsNullOrEmpty(messaggio);
|
|
}
|
|
|
|
#endregion Public Methods
|
|
}
|
|
} |