Files
medpred/MedPred/WebUserControls/mod_elencoRichResetUtenti.ascx.cs
T

89 lines
2.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MedPred.WebUserControls
{
public partial class mod_elencoRichResetUtenti : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
divComandi.Visible = false;
}
}
/// <summary>
/// ultimo comando letto da link button
/// </summary>
public string lastCmd { get; set; }
/// <summary>
/// gestione evento novo record
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
#if false
// richiamo pagina di edit senza parametri x metodo NEW
Response.Redirect("AccettazioneEdit");
#endif
}
public bool toBool(object value)
{
bool answ = false;
try
{
answ = Convert.ToBoolean(value);
}
catch
{ }
return answ;
}
/// <summary>
/// evento selezione paziente...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// mostro il div comandi
divComandi.Visible = true;
#if false
// recupero dati paziente...
int IdxPaziente = 0;
try
{
IdxPaziente = Convert.ToInt32(grView.SelectedDataKey["IdxPaziente"]);
memLayer.ML.setSessionVal("IdxPaziente", IdxPaziente);
DS_Applicazione.AnagPazientiRow riga = DtProxy.man.taAP.getByKey(IdxPaziente)[0];
memLayer.ML.setSessionVal("Paziente", string.Format("{0} {1} ({2:dd/MM/yyyy})", riga.Cognome, riga.Nome, riga.DataNasc));
}
catch
{ }
if (lastCmd == "edit")
{
// richiamo pagina con edit del record richiesto
Response.Redirect(string.Format("AccettazioneEdit?IdxPaziente={0}", grView.SelectedDataKey["IdxPaziente"]));
}
else if (lastCmd == "select")
{
// se utente abilitato ad accesso privilegiato
if (false) // !!!FARE controllo livello accesso
{
Response.Redirect("Visite");
}
}
#endif
}
protected void grView_RowCommand(object sender, GridViewCommandEventArgs e)
{
// salvo il command argument...
lastCmd = e.CommandArgument.ToString();
}
}
}