Esempio n. 1
0
        public static ResendOtpResponse ResendOtp(DTOs.Gen.ResendOtpRequest request)
        {
            request.mobile_number = Common.GetStandardMobileNumber(request.mobile_number);
            ResendOtpResponse response = new ResendOtpResponse();

            response.otp_details = new OTPDetailsDto();
            AgentAdmin agentAdmin = null;

            try
            {
                using (AgentAdminDao adminDao = new AgentAdminDao())
                {
                    // agentBoss = GetAuthAgentBoss(request.user_id, request.auth_token, response);
                    agentAdmin = adminDao.FindByMobileNumber(request.mobile_number);
                }
                if (agentAdmin == null)
                {
                    MakeNouserResponse(response);
                    return(response);
                }

                OTPServices.ResendOTP(response, agentAdmin.MobileNumber, agentAdmin.AgadmID, "A");
                response.code                 = 0;
                response.has_resource         = 1;
                response.message              = MessagesSource.GetMessage("otp.resent");
                response.otp_details.send_otp = 1;
                return(response);
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
                return(response);
            }
        }
        public ResendOtpResponse ResendOtp(ResendOtpRequest request)
        {
            request.mobile_number = Common.GetStandardMobileNumber(request.mobile_number);
            ResendOtpResponse response = new ResendOtpResponse();

            response.otp_details = new OTPDetailsDto();
            Consumer consumer = null;

            try
            {
                using (UserDao userDao = new UserDao())
                {
                    consumer = userDao.FindByMobileNumber(request.mobile_number);
                }
                if (consumer == null)
                {
                    MakeNouserResponse(response);
                    return(response);
                }

                OTPServices.ResendOTP(response, consumer.PhoneNumber, consumer.ConsID, "C");
                response.code                 = 0;
                response.has_resource         = 1;
                response.message              = MessagesSource.GetMessage("otp.resent");
                response.otp_details.send_otp = 1;
                return(response);
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
                return(response);
            }
        }
        public static ResendOtpResponse ResendOtp(ResendOtpRequest request)
        {
            request.mobile_number = Common.GetStandardMobileNumber(request.mobile_number);
            ResendOtpResponse response = new ResendOtpResponse();

            response.otp_details = new OTPDetailsDto();
            SuperAdmin suerUser = null;

            try
            {
                using (SuperUserDao sUserDao = new SuperUserDao())
                {
                    suerUser = sUserDao.FindByMobileNumber(request.mobile_number);
                }
                if (suerUser == null)
                {
                    MakeNouserResponse(response);
                    return(response);
                }

                OTPServices.ResendOTP(response, suerUser.MobileNum, suerUser.SAdminID, "S");
                response.code                 = 0;
                response.has_resource         = 1;
                response.message              = MessagesSource.GetMessage("otp.resent");
                response.otp_details.send_otp = 1;
                return(response);
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
                return(response);
            }
        }
Esempio n. 4
0
        public static ResendOtpResponse ResendOtp(ResendOtpRequest request)
        {
            request.mobile_number = Common.GetStandardMobileNumber(request.mobile_number);
            ResendOtpResponse response = new ResendOtpResponse();

            response.otp_details = new OTPDetailsDto();
            AgentBoss agentBoss = null;

            try
            {
                using (AgentBossDao bossDao = new AgentBossDao())
                {
                    agentBoss = bossDao.FindByMobileNumber(request.mobile_number);
                }
                if (agentBoss == null)
                {
                    MakeNouserResponse(response);
                    return(response);
                }

                OTPServices.ResendOTP(response, agentBoss.MobileNumber, agentBoss.AbosID, "B");
                response.code                 = 0;
                response.has_resource         = 1;
                response.message              = MessagesSource.GetMessage("otp.resent");
                response.otp_details.send_otp = 1;
                return(response);
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
                return(response);
            }
        }
        public ResendOtpResponse ResendOtp(ResendOtpRequest request)
        {
            request.mobile_number = Common.GetStandardMobileNumber(request.mobile_number);
            ResendOtpResponse response = new ResendOtpResponse();

            response.otp_details = new OTPDetailsDto();
            Driver driver = null;

            try
            {
                using (DriverDao driverDao = new DriverDao())
                {
                    driver = driverDao.FindByMobileNumber(request.mobile_number);
                }
                if (driver == null)
                {
                    MakeNoDriverResponse(response);
                    return(response);
                }

                OTPServices.ResendOTP(response, driver.MobileNumber, driver.DrvrID, "D");
                response.code                 = 0;
                response.has_resource         = 1;
                response.message              = MessagesSource.GetMessage("otp.resent");
                response.otp_details.send_otp = 1;
                return(response);
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
                return(response);
            }
        }
Esempio n. 6
0
        public static void ResendOTP(ResendOtpResponse response, string mobileNumber, int userId, string userType)
        {
            mobileNumber = Common.GetStandardMobileNumber(mobileNumber);
            if (response == null)
            {
                response = new ResendOtpResponse();
            }
            if (response.otp_details == null)
            {
                response.otp_details = new OTPDetailsDto();
            }
            string otp = SMSService.SendOTP(mobileNumber);

            if (SaveOTP(otp, userId, userType))
            {
                response.otp_details.send_otp = 1; // state that OTP has been sent.
            }
            response.code         = 0;
            response.has_resource = 1;
            response.message      = MessagesSource.GetMessage("otp.sent");
        }
        public NegotiatedContentResult <ResendOtpResponse> PostResendOtp([FromBody] DTOs.Gen.ResendOtpRequest request)
        {
            ResendOtpResponse resp = AgentAdminServices.ResendOtp(request);

            return(Content(HttpStatusCode.OK, resp));
        }
        public NegotiatedContentResult <ResendOtpResponse> PostResendOtp([FromBody] ResendOtpRequest request)
        {
            ResendOtpResponse resp = _driverServices.ResendOtp(request);

            return(Content(HttpStatusCode.OK, resp));
        }