using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using SteamWare; namespace ScheMe.WebUserControls { public partial class mod_elencoRichResetUtenti : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { //if (!Page.IsPostBack) //{ //} } /// /// ultimo comando letto da link button /// public string lastCmd { get; set; } /// /// gestione evento novo record /// /// /// 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; } /// /// evento selezione paziente... /// /// /// protected void grView_SelectedIndexChanged(object sender, EventArgs e) { // recupero dati utente... string USER_NAME = ""; try { USER_NAME = grView.SelectedDataKey["USER_NAME"].ToString(); } catch { } if (USER_NAME != "") { switch (lastCmd) { case "+1": devicesAuthProxy.stObj.taUtenti.UpdateNumAuth(1, USER_NAME); break; case "-1": devicesAuthProxy.stObj.taUtenti.UpdateNumAuth(-1, USER_NAME); break; case "Disattiva": case "Attiva": devicesAuthProxy.stObj.taUtenti.ToggleAttivo(SteamwareStrings.pseudoRandomString(20), USER_NAME); break; case "NoReset": devicesAuthProxy.stObj.taUtenti.rejectResetAK(USER_NAME); break; case "ResetKeyAndDevices": devicesAuthProxy.stObj.taUtenti.ResetKeyAndDevices(SteamwareStrings.pseudoRandomString(20), USER_NAME); break; case "SendMail": // cerco chiave... string AuthKey = ""; try { AuthKey = devicesAuthProxy.stObj.taUtenti.getByEmail(USER_NAME)[0].authKey; } catch { } if (USER_NAME != "" && AuthKey != "") { // invio email! devicesAuthProxy.stObj.sendEmailAuthKey(USER_NAME, AuthKey, "ScheMe Authorization"); } break; default: break; } } grView.DataBind(); #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("Valutazioni"); } } #endif } protected void grView_RowCommand(object sender, GridViewCommandEventArgs e) { // salvo il command argument... lastCmd = e.CommandArgument.ToString(); } } }