Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void Submit_Click(object sender, EventArgs e)
- {
- //assign text from the textboxes to variables
- string userName = TextBox1.Text;
- string passWord = TextBox2.Text;
- lblError.Visible = true;
- try
- {
- string passwordValue = Encrypt(passWord);
- DataSet1.tblUserDataTable dataTable = proccessedProcess.Login(userName, passwordValue);
- if (dataTable != null & dataTable.Count!=0)
- {
- DataSet1.tblUserRow dataRow = dataTable[0];
- if (dataRow.nUserID.ToString() == "00000000-0000-0000-0000-000000000000")
- {
- lblError.Text = "";
- }
- else if(dataRow.nUserID.ToString() != "00000000-0000-0000-0000-000000000000")
- {
- Session["CurrentUserID"] = dataRow.nUserID.ToString();
- Session["LoggedIn"] = "YES";
- Session["LastLogin"] = DateTime.Now.ToString();
- Session["UserName"] = dataRow.txtUserName;
- HttpContext.Current.Response.Redirect("MainCustomer.aspx");
- }
- } else {
- lblError.Text = "Incorrect UserID or Password";
- }
- }
- catch (Exception E)
- {
- E.Message.ToString();
- lblError.Text = E.Message;
- }
- }
- catch (Exception E)
- {
- // E.Message.ToString();
- Throw;
- }
Add Comment
Please, Sign In to add comment