-
Notifications
You must be signed in to change notification settings - Fork 0
/
RecuperarClave.aspx.cs
63 lines (58 loc) · 1.55 KB
/
RecuperarClave.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business.Entities;
using Business.Logic;
namespace UI.Web
{
public partial class Recuperar : System.Web.UI.Page
{
UsuarioLogic _logic;
UsuarioLogic logic
{
get
{
if (_logic == null)
_logic = new UsuarioLogic();
return _logic;
}
}
private Usuario usuario { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnRecuperar_Click(object sender, EventArgs e)
{
try
{
usuario = logic.GetUsuario(txtUsuario.Text);
}
catch (Exception ex)
{
Page.Response.Redirect("~/Error.aspx");
}
finally
{
if (usuario.ID == 0)
{
lblusu.Visible = true;
txtUsuario.Text = "";
}
else
{
btnRecuperar.Visible = false;
lblMail.Text = "Se ha enviado un mail con la clave a: " + usuario.Email;
lblMail.Visible = true;
btnVolver.Visible = true;
}
}
}
protected void btnVolver_Click(object sender, EventArgs e)
{
Page.Response.Redirect("~/Login.aspx");
}
}
}