Files
GMW/GMW/PostTT.aspx.cs
T
Samuele Locatelli a6ce80ffe3 Inserita prima versioen x postazione TT e prove meccaniche
Nuova stored di gestione passaggio ALR --> ALT
Gestione in MagClass di stored RX (old) e TT (new)
Snapshot DBGMW (dacpac)
2014-03-14 12:22:28 +01:00

141 lines
4.6 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 GMW_data;
namespace GMW
{
public partial class PostTT : System.Web.UI.Page
{
/// <summary>
/// caricamento pagina!
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
updatePrinterPostazione();
// fix css...
Postazione.CssClass = "stileAttesa";
// imposto pos abilitata x cancellazione
mod_storicoAzioniOperatore1.idxPosizione2del = memLayer.ML.confReadInt("IdxPosizioneTT");
}
// update vari...
doUpdate();
mod_storicoAzioniOperatore1.eh_stampa += new EventHandler(mod_storicoAzioniOperatore1_eh_stampa);
#if false
mod_PostTT_Pre_NT1.doUpdate();
mod_PostTT_Pre_NT1.eh_reqUpdate += mod_PostTT_Pre_NT1_eh_reqUpdate;
#endif
mod_selLineaNtDt1.eh_lineSelected += mod_selLineaNtDt1_eh_doRefresh;
mod_selLineaNtDt1.eh_showHideStorico += mod_selLineaNtDt1_eh_showHideStorico;
}
/// <summary>
/// Handles the showHideStorico event of the mod_selLineaNtDt1_eh control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void mod_selLineaNtDt1_eh_showHideStorico(object sender, EventArgs e)
{
fixStorico();
}
/// <summary>
/// Handles the doRefresh event of the mod_selLineaNtDt1_eh control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void mod_selLineaNtDt1_eh_doRefresh(object sender, EventArgs e)
{
doUpdate();
#if false
mod_PostTT_Pre_NT1.doUpdate();
#endif
}
/// <summary>
/// richiesta update del controllo SAO
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void mod_PostTT_Pre_NT1_eh_reqUpdate(object sender, EventArgs e)
{
doUpdate();
}
/// <summary>
/// aggiorna messaggi e css
/// </summary>
private void updateMessCss()
{
lblWarning.Text = Postazione.warningText;
lblMessaggi.Text = Postazione.messaggiText;
pnlAll.CssClass = Postazione.CssClass;
}
/// <summary>
/// richiesta (ri)stampa UDC
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void mod_storicoAzioniOperatore1_eh_stampa(object sender, EventArgs e)
{
#if false
mod_PostTT_Pre_NT1.ristampa();
#endif
}
/// <summary>
/// sistemo visualizzazione pannelli
/// </summary>
private void fixPanels()
{
// default: moduli NON visibili SE non ho linea indicata..
bool enableBtn = false;
if (Postazione.currCodCella != "") enableBtn = true;
#if false
mod_PostTT_Pre_NT1.Visible = enableBtn;
#endif
fixStorico();
}
/// <summary>
/// wrapper traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
/// <summary>
/// toggle controllo storico
/// </summary>
private void fixStorico()
{
pnlSAO.Visible = Postazione.showStorico;
}
/// <summary>
/// update generale controlli
/// </summary>
private void doUpdate()
{
updateMessCss();
fixPanels();
mod_storicoAzioniOperatore1.doUpdate();
}
/// <summary>
/// calcola postazione corrente (ip, name, printer)
/// </summary>
private void updatePrinterPostazione()
{
Postazione.IP = Request.UserHostName;
Postazione.setupPrinter();
// mostro warning se postazione non configurata...
if (Postazione.printer == "n.d.")
{
lblWarning.Text = traduci("lblWarnPostNonConf");
}
}
}
}