public ForgotPasswordResponse ForgotPassword(ForgotPasswordRequest request)
        {
            request.mobile_number = Common.GetStandardMobileNumber(request.mobile_number);
            ForgotPasswordResponse response = new ForgotPasswordResponse();
            //string newPassword = TokenGenerator.GenerateResetPassword();
            Consumer consumer = null;

            try
            {
                using (UserDao dao = new UserDao())
                {
                    consumer = dao.FindByMobileNumber(request.mobile_number);
                    if (consumer == null)
                    {
                        MakeNouserResponse(response);
                        return(response);
                    }
                    OTPServices.SendOTPForForgotPassword(response, request.mobile_number, consumer.ConsID, "C");
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
                return(response);
            }
        }
示例#2
0
        public static ForgotPasswordResponse ForgotPassword(ForgotPasswordRequest request)
        {
            request.mobile_number = Common.GetStandardMobileNumber(request.mobile_number);
            ForgotPasswordResponse response = new ForgotPasswordResponse();

            //string newPassword = TokenGenerator.GenerateResetPassword();
            try
            {
                using (AgentAdminDao dao = new AgentAdminDao())
                {
                    AgentAdmin agentAdmin = dao.FindByMobileNumber(request.mobile_number);
                    if (agentAdmin == null)
                    {
                        MakeNouserResponse(response);
                        return(response);
                    }
                    OTPServices.SendOTPForForgotPassword(response, request.mobile_number, agentAdmin.AgadmID, "A");
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
                return(response);
            }
        }