-
Notifications
You must be signed in to change notification settings - Fork 0
/
MTConfirmPassword.aspx.cs
86 lines (84 loc) · 2.82 KB
/
MTConfirmPassword.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
Project Name : CampusCare
Client :
Database : SQL Server 2000
Front-End : ASP.NET With C#, Java Script, Ajax
Reporting Tool : Crystal Report 11.0
Team : Sandhya,Tinu,Ushas,Jitender Kumar
Tables : MTUserMaster
Procedures : spBindGrid
Page Created : Tinu
Codes : Tinu
Testing & Modification : Jitender Kumar
Remarks :
*/
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class MTConfirmPassword : System.Web.UI.Page
{
CCWeb objCCWeb = new CCWeb();
protected static string strType;
protected string strUserID;
string strMenuName;
int intCount = 0;
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["MenuName"] != null)
{
strMenuName = Request.QueryString["MenuName"].ToString();
}
if ((Session["Type"] == null) || (Session["Type"].ToString() == "1"))
{
strType = "ltr";
}
else
{
strType = "rtl";
}
if (Session["UID"] == null)
{
Response.Write("<script language='javascript'> window.close();window.open('Logon.aspx','_parent');</script>");
}
if (!IsPostBack)
{
txtPassword.Focus();
//pDisplayType();
}
}
protected void btnOK_Click(object sender, EventArgs e)
{
string strCPwd = objCCWeb.ReturnSingleValue("SELECT UserPassword FROM MTUserMaster WHERE UID=" + Session["UID"]);
if (strCPwd != FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text.Trim(), "SHA1"))
{
intCount = intCount + 1;
if (intCount <= 3)
{
//ClientScript.RegisterStartupScript(this.GetType(), "disp", "<script>alert('Incorrect Password');</script>");
string strResult = objCCWeb.pDisplayMessage("" + Session["Type"].ToString() + "", "128_1", "");
ClientScript.RegisterStartupScript(this.GetType(), "disp", "<script>alert('"+strResult+"');</script>");
}
else
{
Response.Redirect("~/MainForm.aspx");
}
txtPassword.Focus();
}
else
{
Session["ConfirmPassword"] = "OK";
Response.Redirect(strMenuName);
}
}
protected void btnClose_Click(object sender, EventArgs e)
{
Response.Redirect("~/MainForm.aspx");
}
}