using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using SteamWare; using GPW_data; namespace GPW.WebUserControls { public partial class mod_enrollByEmail : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { } /// /// salvo nuovo device... /// /// /// protected void btnConferma_Click(object sender, EventArgs e) { // cerco se esista l'utente data la sua email... int idxDipendente = 0; string UserAuthKey = ""; string destinatario = ""; DS_Applicazione.DipendentiRow dipendente = null; try { dipendente = DataProxy.DP.taDipendenti.getByEmail(txtUserEmail.Text.Trim())[0]; idxDipendente = dipendente.idxDipendente; UserAuthKey = dipendente.authKey; destinatario = dipendente.email; } catch { } if (destinatario != "" && idxDipendente > 0) { // invio email... DataProxy.DP.sendUserAuthEmail(destinatario, UserAuthKey, idxDipendente); logger.lg.scriviLog(string.Format("Inviata mail x auth smart device: destinatario: {0}, authKey: {1}, idxDip: {2}", destinatario, UserAuthKey, idxDipendente), tipoLog.INFO); } else { lblWarning.Text = "Email non valida/dipendente non trovato!"; lblWarning.Visible = false; } } /// /// resetto tutto /// /// /// protected void btnAnnulla_Click(object sender, EventArgs e) { txtUserEmail.Text = ""; lblWarning.Visible = false; } } }