Files
SSC/CMS_SC/WebUserControls/mod_dossier.ascx.cs
T
2015-09-10 16:06:14 +02:00

93 lines
2.6 KiB
C#

using CMS_SC_Data;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace CMS_SC.WebUserControls
{
public partial class mod_dossier : System.Web.UI.UserControl
{
/// <summary>
/// evento valore selezionato
/// </summary>
public event EventHandler eh_valUpdated;
protected void raiseEvent()
{
// sollevo evento nuovo valore...
if (eh_valUpdated != null)
{
eh_valUpdated(this, new EventArgs());
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
public int idxDossier
{
get
{
return memLayer.ML.IntSessionObj("idxDossierEdit");
}
set
{
memLayer.ML.setSessionVal("idxDossierEdit", value);
}
}
/// <summary>
/// carica campo note e mostra editing...
/// </summary>
public void fixNote()
{
if (idxDossier > 0)
{
DS_Applicazione.ElencoDossierRow riga = DtProxy.man.taED.getByDossier(idxDossier)[0];
txtNote.Text = riga.Note;
ddlFase.SelectedValue = riga.Stato;
}
}
/// <summary>
/// mostra btn salvataggio / annullamento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtNote_TextChanged(object sender, EventArgs e)
{
// mostra button salvataggio/annulla
showNoteBtn(true);
}
public void showNoteBtn(bool showSaveCancel)
{
lbtResetNote.Visible = showSaveCancel;
lbtSalvaNote.Visible = showSaveCancel;
}
protected void lbtResetNote_Click(object sender, EventArgs e)
{
fixNote();
showNoteBtn(false);
}
protected void lbtSalvaNote_Click(object sender, EventArgs e)
{
// salvo
if (idxDossier > 0)
{
DtProxy.man.taED.updateNote(idxDossier, ddlFase.SelectedValue, txtNote.Text.Trim());
}
// ricarico
fixNote();
showNoteBtn(false);
raiseEvent();
}
protected void ddlFase_SelectedIndexChanged(object sender, EventArgs e)
{
// mostra button salvataggio/annulla
showNoteBtn(true);
}
}
}