Ejemplo n.º 1
0
 protected void btnChngPass_Click(object sender, EventArgs e)
 {
     try
     {
         using (AdGiverRT receiverTransfer = new AdGiverRT())
         {
             string  userEmailId    = Convert.ToString(Session["UserName"]);
             string  password       = txtCurrentPass.Text;
             AdGiver adgiverEmailId = receiverTransfer.GetAdGiverIDByEmail(userEmailId);
             string  UserpassWord   = StringCipher.Decrypt(receiverTransfer.GetPasswordIDByEmail(userEmailId).LoginPassword);
             if (adgiverEmailId != null && UserpassWord == password)
             {
                 using (UserInformationRT receiverTransferuserinfo = new UserInformationRT())
                 {
                     UserInfo UserInfoPassword = CreateUserInfoPassword();
                     receiverTransferuserinfo.UpdateUserInfoPassword(userEmailId, StringCipher.Encrypt(UserInfoPassword.LoginPassword));
                     lblAccountdetails.Text      = "Password successfully updated...";
                     lblAccountdetails.ForeColor = System.Drawing.Color.Green;
                 }
             }
             else
             {
                 lblAccountdetails.Text      = "Current Password is not Valid";
                 lblAccountdetails.ForeColor = System.Drawing.Color.Red;
             }
         }
     }
     catch (Exception ex)
     {
         lblAccountdetails.Text      = "Error : " + ex.Message;
         lblAccountdetails.ForeColor = System.Drawing.Color.Red;
     }
     clearfield();
 }