Esempio n. 1
0
        public OTPResultSvcResponse OTPResult(OTPResultSvcRequest req)
        {
            bool   valid             = false;
            string msg               = string.Empty;
            OTPResultSvcResponse res = new OTPResultSvcResponse();

            using (var commonFacade = new CommonFacade())
            {
                valid      = commonFacade.VerifyServiceRequest <Header>(req.Header);
                res.Header = new Header
                {
                    service_name     = req.Header.service_name,
                    channel_id       = req.Header.channel_id,
                    user_name        = req.Header.user_name,
                    password         = req.Header.password,
                    transaction_date = req.Header.transaction_date,
                    reference_no     = req.Header.reference_no,
                    system_code      = req.Header.system_code
                };
            }
            if (valid)
            {
                using (var srFacade = new ServiceRequestFacade())
                {
                    if (srFacade.UpdateSendSMSVerify(req, out msg))
                    {
                        res.STATUS     = "0";
                        res.ERROR_CODE = "0";
                        res.ERROR_DESC = "";
                    }
                    else
                    {
                        res.STATUS     = "1";
                        res.ERROR_CODE = "1";
                        res.ERROR_DESC = msg;
                    }
                }
            }
            else
            {
                res.STATUS     = "1";
                res.ERROR_CODE = "1";
                res.ERROR_DESC = "User name or password is invalid.";
            }
            return(res);
        }
Esempio n. 2
0
 public HRIFacade() : base()
 {
     using (var commFacade = new CommonFacade())
     {
         filePrefix      = commFacade.GetValueParamByName(Constants.ParameterName.HRFilePrefix);
         host            = commFacade.GetValueParamByName(Constants.ParameterName.HRSFTPHost);
         port            = commFacade.GetValueParamByName(Constants.ParameterName.HRSFTPPort).ToNullable <int>() ?? 22;
         username        = WebConfig.GetHRIUser();
         password        = WebConfig.GetHRIPassword();
         localPath       = commFacade.GetValueParamByName(Constants.ParameterName.HRPathImport);
         errorPath       = commFacade.GetValueParamByName(Constants.ParameterName.HRPathError);
         sourcePath      = commFacade.GetValueParamByName(Constants.ParameterName.HRPathSource);
         remoteDirectory = commFacade.GetValueParamByName(Constants.ParameterName.HRSFTPRemoteDir);
         _download       = commFacade.GetValueParamByName(Constants.ParameterName.HRSFTPDownload)
                           .ToNullable <bool>() ?? false;
     }
 }