protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { int iuserId = ((UserDetails)Session[clsConstant.TOKEN]).UserID; userDetail = new UserDetailEdit(); userObj = new clsUserDetails(); userDetail = userObj.GetUserDetails(Convert.ToInt32(iuserId)); BindDropDown(); AutoFill(); btnUpdate.Visible = true; //DisableControls(); } else { } } catch (Exception ex) { logger.Error(ex); } }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.ExpiresAbsolute = DateTime.Now.AddMonths(-1); try { if (IsPostBack != null) { string userID = Request.QueryString["ui"]; string code = Request.QueryString["sp"]; string codePart = code; string myString = codePart.ToString(); string subString = myString.Substring(0, 32); objReset = new Reset(); DisableControls(); objEntReset = objReset.checkAunthentication(userID, subString); string clientValue = md5.CalculateMD5Hash(txtAnswerCheck.Text.Trim()); if (txtAnswerCheck.Text != "") { if (objEntReset != null && subString == clientValue.ToUpper()) { clsUserDetails obj = new clsUserDetails(); obj.GetUserDetails(int.Parse(userID)); if (subString == objEntReset.userAns && userID == objEntReset.userID) { EnableControls(); lblReset.Text = "Please Reset Your Password."; hplLogin.Enabled = true; btnUpdate.Enabled = true; lblPasswordMessage.Enabled = true; lblPasswordMessage.Text = "Password Must contain atleast 8 characters, including 1 digit, 1 Symbol & 1 UPPERCASE character"; } else { lblPasswordMessage.Text = "Unable to reset your password, please check your security answer."; btnUpdate.Enabled = false; } } else { lblPasswordMessage.Text = "Unable to reset your password, please check your security answer."; lblReset.Text = ""; btnUpdate.Enabled = false; } } } } catch (Exception ex) { logger.Error(ex); lblPasswordMessage.Text = ""; } }
public void saveUserDetails(string Password) { try { ObjUtil = new Utility(); userObj = new clsUserDetails(); userDetail = new UserDetailEdit(); //string clientValue = md5.CalculateMD5Hash(txtPassword.Text); string clientValue = txtPassword.Text; int iuserId = ((UserDetails)Session[clsConstant.TOKEN]).UserID; userDetail = userObj.GetUserDetails(Convert.ToInt32(iuserId)); string getOldPassword = userDetail.password; if (Password == "") { if (userObj.EditUserProfileDetails(iuserId, getOldPassword, txtTelephone.Text, txtCellPhone.Text, txtEmail.Text, txtSkypeID.Text, txtUserName.Text, int.Parse(drpDesignation.SelectedValue), chkEmailNotification.Checked, txtFirstName.Text, txtLastName.Text)) { lblUserExist.ForeColor = System.Drawing.Color.Blue; lblUserExist.Text = "Information Saved Successfully."; DisableControls(); } else { lblUserExist.ForeColor = System.Drawing.Color.Red; lblUserExist.Text = "Error is there."; } } else { if (userObj.EditUserProfileDetails(iuserId, Password.ToUpper(), txtTelephone.Text, txtCellPhone.Text, txtEmail.Text, txtSkypeID.Text, txtUserName.Text, int.Parse(drpDesignation.SelectedValue), chkEmailNotification.Checked, txtFirstName.Text, txtLastName.Text)) { lblUserExist.ForeColor = System.Drawing.Color.Blue; lblUserExist.Text = "Information Saved Successfully."; DisableControls(); } else { lblUserExist.ForeColor = System.Drawing.Color.Red; lblUserExist.Text = "Error is there."; } } } catch (Exception ex) { logger.Error(ex); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { if (Utility.CheckAccess("UserDetailAddEdit") == false) { //UrlParameterPasser urlWrapper = new UrlParameterPasser(); //urlWrapper["pageaccesserr"] = "1"; //urlWrapper.Url = "../DocumentLogSystem/DashBoard.aspx"; //urlWrapper.PassParameters(); pnlInvalid.Visible = true; MainDiv.Visible = false; } ddlsts.DataSource = GetFundingAgency(); ddlsts.DataTextField = "vsFAgencyName"; ddlsts.DataValueField = "vsFAgencyCode"; ddlsts.DataBind(); if (!Convert.ToBoolean(Session[clsConstant.SESS_VIEWTYPE])) { this.MakeReadOnly(this.Controls); } BindDropDown(); string userID = Request.QueryString["userID"]; if (userID != null) { userDetail = new UserDetailEdit(); userObj = new clsUserDetails(); userDetail = userObj.GetUserDetails(Convert.ToInt32(userID)); //BindDropDown(); BindDesignation(userDetail.AgencyID); AutoFill(); btnUpdate.Visible = true; btnSubmit.Visible = false; } } } catch (Exception ex) { logger.Error(ex); } }
private bool CheckOldPassword() { int iuserId = ((UserDetails)Session[clsConstant.TOKEN]).UserID; userDetail = new UserDetailEdit(); userObj = new clsUserDetails(); userDetail = userObj.GetUserDetails(Convert.ToInt32(iuserId)); string passWd = userDetail.password; lblUserExist.Text = "Please enter New Password"; txtPassword.Visible = true; txtOldPassword.Attributes.Add("value", txtOldPassword.Text); //string clientValue = SimpleHash.HMACSha1(txtOldPassword.Text.Trim(), clsConstant.INITVECTOR); if (passWd.ToUpper() == txtOldPassword.Text.ToUpper()) { return(true); } else { return(false); } }