129 lines
4.0 KiB
C#
129 lines
4.0 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;
|
|
|
|
namespace GMW_Term.WebUserControls
|
|
{
|
|
public partial class mod_activeTask : System.Web.UI.UserControl
|
|
{
|
|
/// <summary>
|
|
/// wrapper traduzione termini
|
|
/// </summary>
|
|
/// <param name="lemma"></param>
|
|
/// <returns></returns>
|
|
public string traduci(string lemma)
|
|
{
|
|
return user_std.UtSn.Traduci(lemma);
|
|
}
|
|
|
|
// variabile per verificare se è operatore
|
|
bool _validUserInSession = false;
|
|
/// <summary>
|
|
/// Verifica se c'è un valore in sessione di tipo operatore
|
|
/// </summary>
|
|
protected void verificaOperatoreInSessione()
|
|
{
|
|
if (string.IsNullOrEmpty(user_std.UtSn.utente))
|
|
{
|
|
_validUserInSession = false;
|
|
}
|
|
else
|
|
{
|
|
_validUserInSession = true;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// metodi al caricamento della pagina
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
// scrive label e text bottoni
|
|
btnLoginPage.Text = "[7]-LogOut";
|
|
btnLoginPage.AccessKey = "7";
|
|
btnButtonsHome.Text = "[9]-Home";
|
|
btnButtonsHome.AccessKey = "9";
|
|
// se username è valorizzato...
|
|
verificaOperatoreInSessione();
|
|
if (_validUserInSession)
|
|
{
|
|
btnLoginPage.Visible = true;
|
|
btnButtonsHome.Visible = true;
|
|
}
|
|
// se non è valorizzato chiede di effettuare login...
|
|
else
|
|
{
|
|
Response.Redirect("Home.aspx");
|
|
}
|
|
if (!Page.IsPostBack)
|
|
{
|
|
lblListaAttiva.Text = traduci("activeTakingList") + ":"; ;
|
|
lblBarcode.Text = traduci("lastBarcode") + ":";
|
|
lblRicerca.Text = traduci("lastSearch") + ":";
|
|
}
|
|
disegnaControlli();
|
|
}
|
|
/// <summary>
|
|
/// sistema i controlli visualizzati
|
|
/// </summary>
|
|
private void disegnaControlli()
|
|
{
|
|
// liste prelievo
|
|
if (memLayer.ML.isInSessionObject("CodListaAttiva"))
|
|
{
|
|
pnlListaPrelievo.Visible = true;
|
|
hlListaAttiva.Text = memLayer.ML.StringSessionObj("CodListaAttiva");
|
|
}
|
|
else
|
|
{
|
|
pnlListaPrelievo.Visible = false;
|
|
}
|
|
// altri valori: barcode
|
|
if (memLayer.ML.isInSessionObject("scannedValue"))
|
|
{
|
|
pnlBarcode.Visible = true;
|
|
hlBarcode.Text = memLayer.ML.StringSessionObj("scannedValue");
|
|
}
|
|
else
|
|
{
|
|
pnlBarcode.Visible = false;
|
|
}
|
|
// altri valori: ricerca
|
|
if (memLayer.ML.isInSessionObject("searchValue"))
|
|
{
|
|
pnlRicerca.Visible = true;
|
|
hlRicerca.Text = memLayer.ML.StringSessionObj("searchValue");
|
|
}
|
|
else
|
|
{
|
|
pnlRicerca.Visible = false;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// effettua logout...
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnLoginPage_Click(object sender, EventArgs e)
|
|
{
|
|
TermUtils.TU.forceLogOut();
|
|
Response.Redirect("~/Barcode.aspx");
|
|
}
|
|
/// <summary>
|
|
/// va alla pagina dei buttons principale
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnButtonsHome_Click(object sender, EventArgs e)
|
|
{
|
|
Response.Redirect("~/Home.aspx");
|
|
}
|
|
}
|
|
} |