Exemplo n.º 1
0
        public string GetEmail(ChangePasswordBO objGetEmailBO)
        {
            string        Email         = string.Empty;
            SqlConnection sqlConnection = getConnection();
            SqlCommand    cmd           = new SqlCommand();

            try
            {
                sqlConnection.Open();
                DataTable dt = new DataTable();
                cmd.Connection  = sqlConnection;
                cmd.CommandText = "Sp_GetEmail";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@UserId", objGetEmailBO.Id);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);

                foreach (DataRow Row in dt.Rows)
                {
                    Email = (Convert.ToString(Row["Email"]));
                }
            }

            catch (Exception ex)
            {
            }

            return(Email);
        }
        public string ChangeUserPassword(string OldPassword, string NewPassword)
        {
            string strResult = string.Empty;
            string Email     = string.Empty;

            try
            {
                ChangePasswordBL objChangePasswordBL = new ChangePasswordBL();
                ChangePasswordBO objChangePasswordBO = new ChangePasswordBO();
                Guid             Uid = new Guid();
                if (HttpContext.Current.Session != null)
                {
                    Uid = (Guid)HttpContext.Current.Session["UserId"];
                }
                objChangePasswordBO.Id          = Uid;
                objChangePasswordBO.OldPassword = new MD5Secure().Encrypt(OldPassword);   //OldPassword;
                objChangePasswordBO.NewPassword = new MD5Secure().Encrypt(NewPassword);   //NewPassword;

                strResult = objChangePasswordBL.ChangePassword(objChangePasswordBO);
                Email     = objChangePasswordBL.GetEmail(objChangePasswordBO);

                if (strResult == "1")
                {
                    if (Email != "")
                    {
                        SendMail(Email);
                    }
                }
            }
            catch (Exception ex)
            {
                strResult = "0"; // Exception
            }
            return(strResult);
        }
Exemplo n.º 3
0
        public string ChangePassword(ChangePasswordBO objChangePasswordBO)
        {
            string        strResult     = string.Empty;
            SqlConnection sqlConnection = getConnection();
            SqlCommand    cmd           = new SqlCommand();

            try
            {
                sqlConnection.Open();
                DataTable dt = new DataTable();
                cmd.Connection  = sqlConnection;
                cmd.CommandText = "Sp_AdminChangePassword";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@UserId", objChangePasswordBO.Id);
                cmd.Parameters.AddWithValue("@OldPassword", objChangePasswordBO.OldPassword);
                cmd.Parameters.AddWithValue("@NewPassword", objChangePasswordBO.NewPassword);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);

                foreach (DataRow Row in dt.Rows)
                {
                    strResult = (Convert.ToString(Row["Result"]));
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }

            return(strResult);
        }
Exemplo n.º 4
0
        public string GetEmail(ChangePasswordBO objGetEmailBO)
        {
            ChangePasswordDA objGetEmailDA = new ChangePasswordDA();

            return(objGetEmailDA.GetEmail(objGetEmailBO));
        }
Exemplo n.º 5
0
        public string ChangePassword(ChangePasswordBO objChangePasswordBO)
        {
            ChangePasswordDA objForgetPasswordDA = new ChangePasswordDA();

            return(objForgetPasswordDA.ChangePassword(objChangePasswordBO));
        }