145 lines
5.4 KiB
C#
145 lines
5.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using ETS_Data;
|
|
|
|
namespace ETS_WS.WebUserControls
|
|
{
|
|
public partial class mod_pathAndDocs : System.Web.UI.UserControl
|
|
{
|
|
/// <summary>
|
|
/// evento richiesta salvataggio files
|
|
/// </summary>
|
|
public event EventHandler eh_reqSalva;
|
|
/// <summary>
|
|
/// caricamento pagina
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
updateVisual();
|
|
}
|
|
|
|
/// <summary>
|
|
/// aggiorna tutti i valori visualizzati
|
|
/// </summary>
|
|
public void updateVisual()
|
|
{
|
|
// sistemo valori...
|
|
lblFullPath.Text = WebShipUtils.path(WebShipUtils.mng.currMetaData);
|
|
// verifico attivazione button submin (ovvero ci sono tutti i valori...)
|
|
btnSubmit.Visible = WebShipUtils.mng.metaPresent;
|
|
// mostro gen protocolli SE ho richiesta di generare protocollo
|
|
if (WebShipUtils.mng.metaPresent && WebShipUtils.mng.currMetaData.reqProto)
|
|
{
|
|
pnlGenDocs.Visible = true;
|
|
// controllo.... mostro TUTTE le opzioni SOLO se è protocollo e se è OUT... altrimenti "solo protocollo"...
|
|
bool showAllBtn = (WebShipUtils.mng.currMetaData.InOut.ToUpper() == "OUT");
|
|
btnGenLettera.Visible = showAllBtn;
|
|
btnGenFax.Visible = showAllBtn;
|
|
btnGenMail.Visible = showAllBtn;
|
|
}
|
|
else
|
|
{
|
|
pnlGenDocs.Visible = false;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// richiesta update
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnUpdate_Click(object sender, EventArgs e)
|
|
{
|
|
// aggiorno
|
|
updateVisual();
|
|
}
|
|
/// <summary>
|
|
/// aggiorna dati e sposta file
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnSubmit_Click(object sender, EventArgs e)
|
|
{
|
|
// aggiorno
|
|
updateVisual();
|
|
// indico evento di richiesta spostamento
|
|
if (eh_reqSalva != null)
|
|
{
|
|
eh_reqSalva(this, new EventArgs());
|
|
}
|
|
Response.Redirect("~/GestioneDocumenti.aspx");
|
|
}
|
|
/// <summary>
|
|
/// richiede salvataggio del protocollo, tramite
|
|
/// - salvataggio
|
|
/// - spostamento "dummy file"
|
|
/// - enter in modalità editing
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnStaccaProto_Click(object sender, EventArgs e)
|
|
{
|
|
// effettua upload del documento "dummy" proto
|
|
string nomeFile = "ETS-Proto.docx";
|
|
WebShipUtils.mng.generaDocDaTemplate(nomeFile, WebShipUtils.mng.currMetaData);
|
|
WebShipUtils.dateIsOk(DateTime.Now);
|
|
Response.Redirect("~/GestioneDocumenti.aspx");
|
|
}
|
|
/// <summary>
|
|
/// richiede salvataggio lettera
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnGenLettera_Click(object sender, EventArgs e)
|
|
{
|
|
// nome standard con commessa...
|
|
string nomeFile = "ETS-Lettera.docx";
|
|
// controllo se NON c'è una commessa/progetto...
|
|
if (WebShipUtils.mng.currMetaData.commessa.IndexOf("0000") >= 0)
|
|
{
|
|
nomeFile = "ETS-Lettera_noPrj.docx";
|
|
}
|
|
// effettua upload del documento "dummy" lettera
|
|
WebShipUtils.mng.generaDocDaTemplate(nomeFile, WebShipUtils.mng.currMetaData);
|
|
WebShipUtils.dateIsOk(DateTime.Now);
|
|
Response.Redirect("~/GestioneDocumenti.aspx");
|
|
}
|
|
/// <summary>
|
|
/// chiede salvataggio fax
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnGenFax_Click(object sender, EventArgs e)
|
|
{
|
|
// nome standard con commessa...
|
|
string nomeFile = "ETS-Fax.docx";
|
|
// controllo se NON c'è una commessa/progetto...
|
|
if (WebShipUtils.mng.currMetaData.commessa.IndexOf("0000") >= 0)
|
|
{
|
|
nomeFile = "ETS-Fax_noPrj.docx";
|
|
}
|
|
// effettua upload del documento "dummy" fax
|
|
WebShipUtils.mng.generaDocDaTemplate(nomeFile, WebShipUtils.mng.currMetaData);
|
|
WebShipUtils.dateIsOk(DateTime.Now);
|
|
Response.Redirect("~/GestioneDocumenti.aspx");
|
|
}
|
|
/// <summary>
|
|
/// chiede salvataggio email + generazione doc mailto
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnGenMail_Click(object sender, EventArgs e)
|
|
{
|
|
// effettua upload del documento "dummy" fax
|
|
string nomeFile = "email.eml";
|
|
WebShipUtils.mng.generaDocDaTemplate(nomeFile, WebShipUtils.mng.currMetaData);
|
|
WebShipUtils.dateIsOk(DateTime.Now);
|
|
Response.Redirect("~/GestioneDocumenti.aspx");
|
|
}
|
|
}
|
|
} |