Files
gpw_testci/GPW_Smart/WebUserControls/mod_sendAuthToEmail.ascx.cs
2021-03-26 17:17:28 +01:00

53 lines
1.5 KiB
C#

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_sendAuthToEmail : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// resetto tutto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAnnulla_Click(object sender, EventArgs e)
{
ddlIdxDipendente.SelectedIndex = 0;
lblWarning.Visible = false;
}
protected void lbtSendEmail_Click(object sender, EventArgs e)
{
// cerco key x user selezionato
int idxDipendente = 0;
string UserAuthKey = "";
string destinatario = "";
DS_Applicazione.DipendentiRow dipendente = null;
try
{
idxDipendente = Convert.ToInt32(ddlIdxDipendente.SelectedValue);
dipendente = DataProxy.DP.taDipendenti.getByIdx(idxDipendente)[0];
UserAuthKey = dipendente.authKey;
destinatario = dipendente.email;
}
catch
{ }
// se ho trovato un email...
if (!string.IsNullOrEmpty(destinatario) && idxDipendente > 0)
{
DataProxy.DP.sendUserAuthEmail(destinatario, UserAuthKey, idxDipendente);
}
}
}
}