Files
GMW/GMW/PostRX.aspx.cs
T
Samuele Locatelli 7fc7158131 ver 617:
- nuove pagine TT_PRE impsotate (NT e DT)
- moduli relativi inseriti ed abbozzati
2014-03-12 14:06:50 +01:00

136 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
{
/// <summary>
/// Pagina gestione RX
/// </summary>
public partial class PostRX : 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("IdxPosizioneRX");
}
// update vari...
doUpdate();
mod_storicoAzioniOperatore1.eh_stampa += new EventHandler(mod_storicoAzioniOperatore1_eh_stampa);
mod_PostRX_NT1.doUpdate();
mod_PostRX_NT1.eh_reqUpdate += mod_PostRX_NT1_eh_reqUpdate;
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();
mod_PostRX_NT1.doUpdate();
}
/// <summary>
/// richiesta update del controllo SAO
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void mod_PostRX_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)
{
mod_PostRX_NT1.ristampa();
}
/// <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;
mod_PostRX_NT1.Visible = enableBtn;
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");
}
}
}
}