-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cambiar_Contraseña_Admin.aspx.cs
51 lines (47 loc) · 1.56 KB
/
Cambiar_Contraseña_Admin.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Cambiar_Contraseña : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ImageButton2_Click1(object sender, ImageClickEventArgs e)
{
Response.Redirect("Ini_Admin.aspx");
}
protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
{
try
{
Cambio_Contra_AdminTableAdapters.UsuarioTableAdapter ob = new Cambio_Contra_AdminTableAdapters.UsuarioTableAdapter();
decimal Id_Usuario = 0;
string usuario = Session["admin_id"].ToString();
Decimal.TryParse(usuario, out Id_Usuario);
string actual = (TextBox1.Text);
string contraUsu = ob.contra(Id_Usuario).ToString();
if (!contraUsu.Equals(""))
{
String nueva_contra = (TextBox2.Text);
String confi_contra = (TextBox3.Text);
if (nueva_contra == confi_contra)
{
ob.Cambio(nueva_contra, Id_Usuario).ToString();
Label9.Text = "La contraseña se ha modificado";
}
else
{
Label8.Text = "Las contraseñas no coinciden";
TextBox3.Focus();
}
}
}
catch (Exception ex)
{
Label8.Text = "Ha ocurrido un error" + ex.Message;
}
}
}