コード例 #1
0
        public async Task <string> ForgotPassword(string userName)
        {
            bool   isUserExists = false;
            int    env;
            string response = string.Empty;

            isUserExists = await sqlDBContext.CheckUserExists(userName);

            int.TryParse(ConfigurationManager.AppSettings["environment"], out env);
            if (isUserExists && (env == (int)Enums.Environment.PRODUCTION))
            {
                mailAction.sendMail(userName);
                response = "Password sent successfully.";
            }
            else
            {
                response = await sqlDBContext.GetPassword(userName);
            }
            return(response);
        }