protected void btnSave_Click(object sender, EventArgs e) { if (Session["UserID"] != null) { SEC_UserDAL dalSEC_User = new SEC_UserDAL(); SEC_UserENT entSEC_User = new SEC_UserENT(); SEC_UserBAL balSEC_User = new SEC_UserBAL(); DataTable dt = dalSEC_User.CheckPassword(Convert.ToInt32(Session["UserID"]), Convert.ToString(Session["UserName"]), txtOldPassword.Text.Trim()); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { entSEC_User.UserID = Convert.ToInt32(dr["UserID"]); entSEC_User.UserName = dr["UserName"].ToString(); entSEC_User.Password = txtNewPassword.Text.Trim(); entSEC_User.Email = Convert.ToString(dr["Email"]); entSEC_User.CreationDate = DateTime.Now; entSEC_User.ModificationDate = DateTime.Now; balSEC_User.Update(entSEC_User); pnlAlert.Visible = true; lblErrorMsg.Text = "Password Successfully Changed."; //ucMessage.ShowSuccess("Password Successfully Changed."); } } else { lblOldPassword.Text = "Old Password is wrong."; } } else { Response.Redirect("~/Login/Login.aspx"); } }
public Boolean Delete(SqlInt32 UserID) { SEC_UserDAL dalSEC_User = new SEC_UserDAL(); if (dalSEC_User.Delete(UserID)) { return(true); } else { this.Message = dalSEC_User.Message; return(false); } }
public Boolean Update(SEC_UserENT entSEC_User) { SEC_UserDAL dalSEC_User = new SEC_UserDAL(); if (dalSEC_User.Update(entSEC_User)) { return(true); } else { this.Message = dalSEC_User.Message; return(false); } }
protected void btnLogIn_Click(object sender, EventArgs e) { if (txtUserName.Text != String.Empty) { if (txtPassword.Text != String.Empty) { SEC_UserDAL dalSEC_Admin = new SEC_UserDAL(); DataTable dt = dalSEC_Admin.UserLogIn(txtUserName.Text.Trim(), txtPassword.Text.Trim()); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { if (dr["UserID"].ToString() != String.Empty) { Session["UserID"] = Convert.ToInt32(dr["UserID"]); } if (dr["UserName"].ToString() != String.Empty) { Session["UserName"] = dr["UserName"].ToString(); } //if (dr["Email"].ToString() != String.Empty) //{ // Session["Email"] = dr["Email"].ToString(); //} } Response.Redirect("~/AdminPanel/Default.aspx"); } else { lblMessage.Text = "The username or password you entered is incorrect."; } } else { lblMessage.Text = "Enter your Password."; } } else { lblMessage.Text = "Enter your Username."; } }
public DataTable UserLogIn(SqlString UserName, SqlString Password) { SEC_UserDAL dalSEC_User = new SEC_UserDAL(); return(dalSEC_User.UserLogIn(UserName, Password)); }
public DataTable SelectDuplicate(SqlString UserName, SqlString Email) { SEC_UserDAL dalSEC_User = new SEC_UserDAL(); return(dalSEC_User.SelectDuplicate(UserName, Email)); }
public DataTable SelectAll() { SEC_UserDAL dalSEC_User = new SEC_UserDAL(); return(dalSEC_User.SelectAll()); }
public SEC_UserENT SelectPK(SqlInt32 UserID) { SEC_UserDAL dalSEC_User = new SEC_UserDAL(); return(dalSEC_User.SelectPK(UserID)); }