public static VCBHelpers.CommonResponse GetListRegionTransType()
 {
     try
     {
         //var responce = _autoDebitSoap1.GetListRegionTransCode(_key);
         var responce = _autoDebitService.GetListRegionTransCode(_key);
         var result   = new VCBHelpers.CommonResponse();
         // TuanTM remove 21/12 - use old service
         if (responce.Split('|')[0] == "00")
         {
             result.ExitCode = "00";
             result.Message  = responce.Substring(3, responce.Length - 3);
         }
         else
         {
             result.ExitCode = responce.Split('|')[0];
             result.Message  = responce.Split('|')[1];
         }
         Utilities.WriteLogReqRes("AutoDebit", "GetListRegionTransType", _key, result);
         return(result);
     }
     catch (Exception ex)
     {
         Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                    Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
         Utilities.WriteToEventLog("VCB AutoDebit Service", ex, "GetCustomerInfo", 1, EventLogEntryType.Error);
         var result = new VCBHelpers.CommonResponse();
         result.ExitCode = "99";
         result.Message  = ex.Message;
         return(result);
     }
     //return new VCBHelpers.CommonResponse();
 }
 /// <summary>
 /// KienNK
 /// </summary>
 /// <param name="key"></param>
 /// <param name="providerCode"></param>
 /// <param name="serviceCode"></param>
 /// <param name="customerCode"></param>
 /// <returns></returns>
 public static VCBHelpers.CommonResponse GetCustomerInfo(string providerCode, string serviceCode, string customerCode)
 {
     try
     {
         var responce = _autoDebitService.GetCustomerInfo(_key, providerCode, serviceCode, customerCode);
         var result   = new VCBHelpers.CommonResponse();
         if (responce.Split('|')[0] == "00")
         {
             result.ExitCode = "00";
             result.Message  = responce.Substring(3, responce.Length - 3);
         }
         else
         {
             result.ExitCode = responce.Split('|')[0];
             result.Message  = responce.Split('|')[1];
         }
         Utilities.WriteLogReqRes("AutoDebit", "GetCustomerInfo", _key + ", " + providerCode + ", " + serviceCode + ", " + customerCode, result);
         return(result);
     }
     catch (Exception ex)
     {
         Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                    Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
         Utilities.WriteToEventLog("VCB AutoDebit Service", ex, "GetCustomerInfo", 1, EventLogEntryType.Error);
         var result = new VCBHelpers.CommonResponse();
         result.ExitCode = "99";
         result.Message  = ex.Message;
         return(result);
     }
 }
Esempio n. 3
0
        ///KienNK >>>
        /// <summary>
        /// Check PhoneNumber
        /// </summary>
        public static SMSResponseCommon GetSMSUserCommon(string phone)
        {
            var result   = new VCBHelpers.CommonResponse();
            var response = new SMSResponseCommon();

            try
            {
                Utilities.WriteToEventLog(src_event,
                                          "GetSMSUserCommon Phone: " + phone,
                                          " GetSMSUserCommon Service", 1, EventLogEntryType.Information);
                response = _smsService.GetSMSUserCommon(phone);

                //result.ExitCode = response.ResponseCode;
                //result.Message = response.ResponseDesc;
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB SMS Service", ex, "GetSMSUserCommon", 1, EventLogEntryType.Error);
                result.ExitCode = "-1";
                result.Message  = ex.Message;
            }
            Utilities.WriteLogReqRes("VCBSMSService", "GetSMSUserCommon", phone, response);
            return(response);
        }
        public static VCBHelpers.CommonResponse GetCustomerVCBInfor(string partnerID, string customerCode, int branch, string tellerID, int tellerSequence)
        {
            var result = new VCBHelpers.CommonResponse();

            try
            {
                var response = _EWalletService.GetCustomerVCBInfo(_key, partnerID, customerCode, branch, tellerID, tellerSequence, "1");
                if (response.Split('|')[0] == "0")
                {
                    result.ExitCode = "00";
                    result.Message  = response.Split('|')[2];
                }
                else
                {
                    result.ExitCode = response.Split('|')[0];
                    result.Message  = response.Split('|')[1];
                }
                Utilities.WriteLogReqRes("VCBEwallet", "GetCustomerVCBInfor", _key + ", " + partnerID + ", " + customerCode + ", " + branch + ", " + tellerID + ", " + tellerSequence + "1", result);
                return(result);
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB EWallet Service", ex, "InquiryEwallet", 1, EventLogEntryType.Error);

                result.ExitCode = "99";
                result.Message  = ex.Message;
                return(result);
            }
            //return new VCBHelpers.CommonResponse();
        }
        public static VCBHelpers.CommonResponse GetListParnet()
        {
            var result = new VCBHelpers.CommonResponse();

            try
            {
                var response = _EWalletService.GetListPartnerID(_key);
                if (!String.IsNullOrEmpty(response))
                {
                    result.ExitCode = "00";
                    result.Message  = response;
                }
                else
                {
                    result.ExitCode = response.Split('|')[0];
                    result.Message  = response.Split('|')[1];
                }
                Utilities.WriteLogReqRes("VCBEwallet", "GetListParnet", _key, result);
                return(result);
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB EWallet Service", ex, "GetPartner", 1, EventLogEntryType.Error);

                result.ExitCode = "99";
                result.Message  = ex.Message;
                return(result);
            }
            // return new VCBHelpers.CommonResponse();
        }
Esempio n. 6
0
        /// <summary>
        /// request De-Active SMS service
        /// </summary>
        /// <param name="cif"></param>
        /// <param name="phoneNumber"></param>
        /// <param name="account"></param>
        /// <param name="type"></param>
        /// <param name="branch"></param>
        /// <param name="tellerId"></param>
        /// <param name="tellerSeq"></param>
        /// <param name="supId"></param>
        /// <param name="supSeq"></param>
        /// <param name="remark"></param>
        /// <param name="source"></param>
        /// <returns></returns>
        public static VCBHelpers.CommonResponse StopActiveSMS(string cif, string phoneNumber, string account,
                                                              string type, string branch, string tellerId, int tellerSeq, string supId, int supSeq, string remark, string source)
        {
            var result = new VCBHelpers.CommonResponse();

            try
            {
                Utilities.WriteToEventLog(src_event,
                                          "RegisterActiveSMS CIF: " + cif + " PhoneNumber: " + phoneNumber +
                                          " Account: " + account + " Type: " + type +
                                          " Branch: " + branch + " TellerId ID: " + tellerId + " TellerSeq: " + tellerSeq +
                                          " SupId: " + supId + " SupSeq: " + supSeq + " Remark: " + remark + " Source: " + source,
                                          " RegisterSMS Service", 1, EventLogEntryType.Information);
                var response = _smsService.StopActiveSMS(cif, phoneNumber, account, type, branch, tellerId, tellerSeq, supId, supSeq, remark, source);
                Utilities.TraceInterface("VCB SMS Service", "StopActiveSMS", response);
                result.ExitCode = response.ResponseCode;
                result.Message  = response.ResponseDesc;
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB SMS Service", ex, "StopActiveSMS", 1, EventLogEntryType.Error);
                result.ExitCode = "-1";
                result.Message  = ex.Message;
            }
            Utilities.WriteLogReqRes("VCBSMSService", "StopActiveSMS", cif + ", " + phoneNumber + ", " + account + ", " + type + ", " + branch + ", " + tellerId + ", " + tellerSeq + ", " + supId + ", " + supSeq + ", " + remark + ", " + source, result);
            return(result);
        }
Esempio n. 7
0
        /// <summary>
        /// Calls inqiry sms banking
        /// </summary>
        public static VCBHelpers.CommonResponse InquirySMSBanking(string cif)
        {
            var result = new VCBHelpers.CommonResponse();

            try
            {
                Utilities.WriteToEventLog(src_event,
                                          "InquirySMSBanking CIF: " + cif,
                                          " InquirySMSBanking Service", 1, EventLogEntryType.Information);
                string strRet = string.Empty;
                //string eventCode = _smsService.InquirySMSBanking(cif, out strRet);
                var response = _smsService.InquirySMSBanking(cif);
                result.ExitCode = response.Exitcode;
                result.Message  = response.Result;
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB SMS Service", ex, "InquirySMSBanking", 1, EventLogEntryType.Error);
                result.ExitCode = "-1";
                result.Message  = ex.Message;
            }
            Utilities.WriteLogReqRes("VCBSMSService", "InquirySMSBanking", cif, result);
            return(result);
        }
Esempio n. 8
0
        /// <summary>
        /// Calls the SMS web service operation StopSMS
        /// </summary>
        public static VCBHelpers.CommonResponse StopSMS(string cif, string phoneNumber, string source, string id, string tellerId, int tellerSeq, string supId, int supSeq, string departmentID, string branchId)
        {
            var response = new SMSResp();
            var result   = new VCBHelpers.CommonResponse();

            try
            {
                Utilities.WriteToEventLog(src_event,
                                          "StopSMS CIF: " + cif + " PhoneNumber: " + phoneNumber +
                                          " Source: " + source + " ID:" + id +
                                          " TellerId ID: " + tellerId + " TellerSeq: " + tellerSeq +
                                          " SupId: " + supId + " SupSeq: " + supSeq + " DepartmentID: " + departmentID,
                                          " StopSMS Service", 1, EventLogEntryType.Information);
                response = _smsService.StopSMS(cif, phoneNumber, source, id, tellerId, tellerSeq, supId, supSeq, departmentID, branchId);
                Utilities.TraceInterface("VCB SMS Service", "StopSMS", response);
                result.ExitCode = response.RespCode;
                result.Message  = response.RespDesc;
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB SMS Service", ex, "RegisterSMS", 1, EventLogEntryType.Error);
                result.ExitCode = "-1";
                result.Message  = ex.Message;
            }
            Utilities.WriteLogReqRes("VCBSMSService", "StopSMS", cif + ", " + phoneNumber + ", " + source + ", " + id + ", " + tellerId + ", " + tellerSeq + ", " + supId + ", " + supSeq + ", " + departmentID + ", " + branchId, result);
            return(result);
        }
Esempio n. 9
0
        /// <summary>
        /// Calls the SMS web service operation Maintenance
        /// </summary>
        ///
        public static VCBHelpers.CommonResponse Maintenance(string cif, string phoneNumber, string oldAccount, string newAccount, string serviceLevel, string makerID, int makerSeq, string checkID, int checkSeq, string branchID, string departmentID)
        {
            var result = new VCBHelpers.CommonResponse();

            try
            {
                Utilities.WriteToEventLog(src_event,
                                          "MaintenanceSMSBanking CIF: " + cif + " PhoneNumber: " + phoneNumber +
                                          " OldAccount: " + oldAccount + " NewAccount: " + newAccount +
                                          " ServiceLevel: " + serviceLevel +
                                          " MakerID:" + makerID + " checkID: " + checkID +
                                          " BranchID: " + branchID + " DepartmentID: " + departmentID,
                                          " MaintenanceSMSBanking Service", 1, EventLogEntryType.Information);
                string record   = string.Empty;
                var    response = _smsService.MaintenanceSMSBanking(cif, phoneNumber, oldAccount, newAccount, makerID, makerSeq, checkID, checkSeq, branchID, departmentID, serviceLevel);
                result.ExitCode = response.RespCode;
                result.Message  = response.RespDesc;
                //var exitCode = _smsService.MaintenanceSMSBanking(cif, phoneNumber, oldAccount, newAccount, makerID, checkID, branchID, departmentID, serviceLevel, out record);
                //result.ExitCode = exitCode;
                //result.Message = record;
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB SMS Service", ex, "MaintenanceSMSBanking", 1, EventLogEntryType.Error);
                result.ExitCode = "-1";
                result.Message  = ex.Message;
            }
            Utilities.WriteLogReqRes("VCBSMSService", "Maintenance", cif + ", " + phoneNumber + ", " + oldAccount + ", " + newAccount + ", " + makerID + ", " + makerSeq + ", " + checkID + ", " + checkSeq + ", " + branchID + ", " + departmentID + ", " + serviceLevel, result);
            return(result);
        }
        /// <summary>
        /// Calls the EWallet web service operation RegistrationEwallet
        /// </summary>
        public static VCBHelpers.CommonResponse RegistrationEwallet(string defaultMobileNumber, int tellerSequence, string tellerID, int supSequence, string supID, int regBranch, string partnerID, string OTPMethod, string departmentid, string customerCode, int accountBranch, string accountCurrency, string channel, int CIF, string customerAccount)
        {
            //ActiveResponseBody response = new ActiveResponseBody();
            ActiveRequestBody request = new ActiveRequestBody();

            request.accountBranch   = accountBranch;
            request.accountCurrency = accountCurrency;
            request.channel         = "1";
            request.CIF             = int.Parse(customerCode);
            request.customerAccount = customerAccount;
            request.customerCode    = defaultMobileNumber;
            request.departmentid    = departmentid;
            // request.key = 11;
            request.key            = _key;
            request.OTPMethod      = OTPMethod;
            request.partnerID      = partnerID;
            request.regBranch      = regBranch;
            request.supID          = supID;
            request.supSequence    = supSequence;
            request.tellerID       = tellerID;
            request.tellerSequence = tellerSequence;
            //request.registerEWalletProvider = "";
            request.defaultMobileNumber = defaultMobileNumber;

            try
            {
                var response = _EWalletService.Active(request.key, request.partnerID, request.customerCode, request.customerAccount, request.CIF, request.accountBranch, request.accountCurrency, request.regBranch, request.tellerID, request.tellerSequence, request.supID, request.supSequence, request.channel,
                                                      request.OTPMethod, request.departmentid, request.defaultMobileNumber, request.registeredEWalletProvider);
                var result = new VCBHelpers.CommonResponse();
                if (response.Split('|')[0] == "00")
                {
                    result.ExitCode = "00";
                    result.Message  = response.Split('|')[1];
                }
                else
                {
                    result.ExitCode = response.Split('|')[0];
                    result.Message  = response.Split('|')[1];
                }
                Utilities.WriteLogReqRes("VCBEwallet", "RegistrationEwallet", request, result);
                return(result);
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB EWallet Service", ex, "RegistrationEwallet", 1, EventLogEntryType.Error);
                var result = new VCBHelpers.CommonResponse();
                result.ExitCode = "99";
                result.Message  = ex.Message;
                return(result);
            }
            //return new VCBHelpers.CommonResponse();
        }
        /// <summary>
        /// Calls the AutoDebit web service operation AutoDebitMaintenance
        /// </summary>
        public static VCBHelpers.CommonResponse AutoDebitMaintenance(string cif, string contractCode, string providerCode, string debitAccount, string idRegistrationRecord, string operation, string key)
        {
            //var response = new UpdateAccountInfoResponseBody();
            try
            {
                //build request
                var request = new UpdateAccountInfoRequestBody();
                request.cif                  = cif;
                request.customerCode         = contractCode;
                request.debitaccount         = debitAccount;
                request.idregistrationrecord = idRegistrationRecord;
                request.key                  = _key;
                request.providerCode         = providerCode;
                request.regAccount           = debitAccount;
                request.sequence             = 1;
                request.serviceCode          = providerCode;
                request.tellerID             = "";
                var response = _autoDebitService.UpdateAccountInfo(request.key, request.providerCode, request.serviceCode, request.customerCode, request.regAccount, request.tellerID,
                                                                   request.sequence, request.cif, request.idregistrationrecord, request.debitaccount);
                //var response = _autoDebitService.UpdateAccountInfo(request.key, request.providerCode, request.serviceCode, request.customerCode, request.regAccount, request.tellerID,
                // request.sequence);

                var result = new VCBHelpers.CommonResponse();
                if (response.Split('|')[0] == "00")
                {
                    result.ExitCode = response.Split('|')[0];
                    result.Message  = response.Split('|')[1];
                }
                else
                {
                    result.ExitCode = response.Split('|')[0];
                    result.Message  = response.Split('|')[1];
                }

                //Utilities.TraceInterface("VCB AutoDebit Service", "AutoDebitMaintenance", request);
                //Utilities.TraceInterface("VCB AutoDebit Service", "AutoDebitMaintenance", response);
                Utilities.WriteLogReqRes("AutoDebit", "Maintenance", request, result);
                return(result);
            }
            catch (Exception ex)
            {
                //Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                //    Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                //Utilities.WriteToEventLog("VCB AutoDebit Service", ex, "AutoDebitMaintenance", 1, EventLogEntryType.Error);
                var result = new VCBHelpers.CommonResponse();
                result.ExitCode = "99";
                result.Message  = ex.Message;
                return(result);
            }
            //return new VCBHelpers.CommonResponse();
        }
        /// <summary>
        /// Calls the EWallet web service operation MaintenanceEwallet
        /// </summary>
        public static VCBHelpers.CommonResponse MaintenanceEwallet(int updateBranch, string tellerID, int tellerSequence, string channel, int CIF, string customerCode, string departmentid, string newAccount, string newAccountCurrency, string oldAccount, string partnerID, string supID, int supSequence)
        {
            //var response = new UpdateVCBInfoResponseBody();
            var request = new UpdateVCBInfoRequestBody();

            request.channel        = channel;
            request.CIF            = CIF;
            request.customerCode   = customerCode;
            request.departmentid   = departmentid;
            request.key            = _key;
            request.newAccount     = newAccount;
            request.newCurrency    = newAccountCurrency;
            request.oldAccount     = oldAccount;
            request.partnerID      = partnerID;
            request.supID          = supID;
            request.supSequence    = supSequence;
            request.tellerID       = tellerID;
            request.tellerSequence = tellerSequence;
            request.updateBranch   = updateBranch;
            try
            {
                var response = _EWalletService.UpdateVCBInfo(request.key, request.partnerID, request.customerCode, request.oldAccount, request.newAccount, request.newCurrency,
                                                             request.CIF, request.updateBranch, request.tellerID, request.tellerSequence, request.supID, request.supSequence, request.channel, request.departmentid, request.defaultMobileNumber, request.providerCode);
                var result = new VCBHelpers.CommonResponse();
                if (response.Split('|')[0] == "00")
                {
                    result.ExitCode = "00";
                    result.Message  = response.Split('|')[1];
                }
                else
                {
                    result.ExitCode = response.Split('|')[0];
                    result.Message  = response.Split('|')[1];
                }
                Utilities.WriteLogReqRes("VCBEwallet", "MaintenanceEwallet", request, result);
                return(result);
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB EWallet Service", ex, "MaintenanceEwallet", 1, EventLogEntryType.Error);
                var result = new VCBHelpers.CommonResponse();
                result.ExitCode = "99";
                result.Message  = ex.Message;
                return(result);
            }
            //return new VCBHelpers.CommonResponse();
        }
        public static VCBHelpers.CommonResponse InquiryCustomerInfoFromPartner(string service, string serviceProvider, string key, string regionCode, string contractCode)
        {
            //var response = new GetCustomerInfoFromPartnerResponseBody();
            try
            {
                //build request
                var request = new GetCustomerInfoFromPartnerRequestBody();
                request.customerCode = contractCode;
                request.key          = _key;
                request.providerCode = serviceProvider;
                request.service      = service;
                request.serviceCode  = serviceProvider;
                request.regionCode   = regionCode;
                request.contractCode = contractCode;
                var response = _autoDebitService.GetCustomerInfoFromPartner(request.key, request.providerCode, request.serviceCode
                                                                            , request.customerCode, request.contractCode, request.regionCode, request.service);
                //var response = _autoDebitService.GetCustomerInfoFromPartner(request.key, request.providerCode, request.serviceCode
                //                                           , request.customerCode);

                var result = new VCBHelpers.CommonResponse();
                if (response.Split('|')[0] == "00")
                {
                    result.ExitCode = "00";
                    result.Message  = response.Substring(3, response.Length - 3);
                }
                else
                {
                    result.ExitCode = response.Split('|')[0];
                    result.Message  = response.Split('|')[1];
                }

                //Utilities.TraceInterface("VCB AutoDebit Service", "InquiryCustomerInfoFromPartner", request);
                //Utilities.TraceInterface("VCB AutoDebit Service", "InquiryCustomerInfoFromPartner", response);
                Utilities.WriteLogReqRes("AutoDebit", "InquiryCustomerInfoFromPartner", request, result);
                return(result);
            }
            catch (Exception ex)
            {
                //Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                //    Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                //Utilities.WriteToEventLog("VCB AutoDebit Service", ex, "InquiryCustomerInfoFromPartner", 1, EventLogEntryType.Error);
                var result = new VCBHelpers.CommonResponse();
                result.ExitCode = "99";
                result.Message  = ex.Message;
                return(result);
            }
            //return new VCBHelpers.CommonResponse();
        }
Esempio n. 14
0
        /// <summary>
        /// Calls the SMS web service operation StopCorporateSMS
        /// </summary>
        public static VCBHelpers.CommonResponse StopCorporateSMS(string cif, string phoneNumber, string account, string branch, string id, string pan, string tellerId, int tellerSeq, string supId, int supSeq, string source)
        {
            //var response = string.Empty;
            var result = new VCBHelpers.CommonResponse();

            try
            {
                Utilities.WriteToEventLog(src_event,
                                          "StopSMS CIF: " + cif + " PhoneNumber: " + phoneNumber +
                                          " Account: " + account +
                                          " Branch: " + branch + " ID:" + id +
                                          " Pan: " + pan +
                                          " TellerId ID: " + tellerId + " TellerSeq: " + tellerSeq +
                                          " SupId: " + supId + " SupSeq: " + supSeq +
                                          " Source: " + source,
                                          " StopSMS Service", 1, EventLogEntryType.Information);
                //Ham nay them tham so departmentId?
                var response = _smsService.StopCorporateSMS(cif, phoneNumber, account, branch, id, pan, tellerId, tellerSeq, supId, supSeq, source, string.Empty);
                //response = _smsService.StopCorporateSMS(cif, phoneNumber, account, branch, id, pan, tellerId, tellerSeq, supId, supSeq, source);
                Utilities.TraceInterface("VCB SMS Service", "StopSMS", response.RespDesc);
                //if (response.Contains("|"))
                //{
                //    result.ExitCode = response.Split('|')[0];
                //    result.Message = response.Split('|')[1];
                //}
                if (response != null)
                {
                    result.ExitCode = response.RespCode;
                    result.Message  = response.RespDesc;
                }
                else
                {
                    result.ExitCode = "-1";
                    result.Message  = "Something went wrong!";
                }
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB SMS Service", ex, "RegisterSMS", 1, EventLogEntryType.Error);
                result.ExitCode = "-1";
                result.Message  = ex.Message;
            }
            Utilities.WriteLogReqRes("VCBSMSService", "StopCorporateSMS", cif + ", " + phoneNumber + ", " + account + ", " + branch + ", " + id + ", " + pan + ", " + tellerId + ", " + tellerSeq + ", " + supId + ", " + supSeq + ", " + source + ", " + string.Empty, result);
            return(result);
        }
        /// <summary>
        /// Calls the EWallet web service operation Deactive
        /// </summary>
        public static VCBHelpers.CommonResponse Deactive(int unregBranch, string tellerID, int tellerSequence, string channel, int CIF, string customerCode, string departmentid, string partnerID, string supID, int supSequence)
        {
            //DeactiveResponseBody response = new DeactiveResponseBody();
            DeactiveRequestBody request = new DeactiveRequestBody();

            request.channel        = channel;
            request.CIF            = CIF;
            request.customerCode   = customerCode;
            request.departmentid   = departmentid;
            request.key            = 168701966;
            request.partnerID      = partnerID;
            request.supID          = supID;
            request.supSequence    = supSequence;
            request.tellerID       = tellerID;
            request.tellerSequence = tellerSequence;
            request.unregBranch    = unregBranch;
            try
            {
                var response = _EWalletService.Deactive(request.key, request.partnerID, request.customerCode, request.CIF, request.unregBranch, request.tellerID, request.tellerSequence, request.supID, request.supSequence,
                                                        request.channel, request.departmentid, request.ewalletAccount, request.providerCode);
                var result = new VCBHelpers.CommonResponse();
                if (response.Split('|')[0] == "00")
                {
                    result.ExitCode = "00";
                    result.Message  = response.Split('|')[1];
                }
                else
                {
                    result.ExitCode = response.Split('|')[0];
                    result.Message  = response.Split('|')[1];
                }
                Utilities.WriteLogReqRes("VCBEwallet", "Deactive", request, result);
                return(result);
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB EWallet Service", ex, "Deactive", 1, EventLogEntryType.Error);
                var result = new VCBHelpers.CommonResponse();
                result.ExitCode = "99";
                result.Message  = ex.Message;
                return(result);
            }
            // return new VCBHelpers.CommonResponse();
        }
        /// <summary>
        /// Calls the EWallet web service operation InquiryEwallet
        /// </summary>
        public static VCBHelpers.CommonResponse InquiryEwallet(string channel, string cif)
        {
            //GetCustomerVCBInfoResponseBody response = new GetCustomerVCBInfoResponseBody();
            //GetCustomerVCBInfoRequestBody request = new GetCustomerVCBInfoRequestBody();
            //request.channel = channel;
            //request.customerCode = customerCode;
            //request.getBranch = getBranch;
            ////request.key = 4;
            //request.key = _key;
            //request.partnerID = partnerID;
            //request.tellerSequence = sequence;
            //request.tellerID = tellerID;
            var result = new VCBHelpers.CommonResponse();

            try
            {
                var response = _EWalletService.GetCusAllPartnerByCIF(_key, int.Parse(cif));
                if (response.Split('|')[0] == "00")
                {
                    result.ExitCode = "00";
                    result.Message  = response.Substring(3, response.Length - 3);
                }
                else
                {
                    result.ExitCode = response.Split('|')[0];
                    result.Message  = response.Split('|')[1];
                }
                Utilities.WriteLogReqRes("VCBEwallet", "InquiryEwallet", _key + ", " + cif, result);
                return(result);
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB EWallet Service", ex, "InquiryEwallet", 1, EventLogEntryType.Error);

                result.ExitCode = "99";
                result.Message  = ex.Message;
                return(result);
            }
            //return new VCBHelpers.CommonResponse();
        }
        /// <summary>
        /// Calls the InternetBanking web service operation MaintenancePersonalUser
        /// </summary>
        public static VCBHelpers.CommonResponse MaintenancePersonalUser(string key, string cif, string username, string defaultaccountnumber, string makerID, string checkerID, string branchID, string departmentID)
        {
            var response = new MaintenancePersonalUserRes();

            try
            {
                //build request
                var request = new MaintenancePersonalUserRequestBody();
                request.cif                  = cif;
                request.username             = username;
                request.defaultaccountnumber = defaultaccountnumber;
                request.makerID              = makerID;
                request.checkerID            = checkerID;
                request.key                  = key;
                request.branchID             = branchID;
                request.departmentID         = departmentID;

                response = _iBankingService.MaintenancePersonalUser(request.key, request.cif, request.username, request.defaultaccountnumber, request.makerID, request.checkerID, request.branchID, request.departmentID);

                var result = new VCBHelpers.CommonResponse();
                result.ExitCode = response.exitCode;
                result.Message  = response.MaintenancePersonalUserResult;

                Utilities.TraceInterface("VCB IBanking Service", "MaintenancePersonalUser", request);
                Utilities.TraceInterface("VCB IBanking Service", "MaintenancePersonalUser", response);
                Utilities.WriteLogReqRes("VCBIBankingService", "MaintenancePersonalUser", request, result);
                return(result);
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB IBanking Service", ex, "MaintenancePersonalUser", 1, EventLogEntryType.Error);
                var result = new VCBHelpers.CommonResponse();
                result.ExitCode = "99";
                result.Message  = ex.Message;
                return(result);
            }
            //return new VCBHelpers.CommonResponse();
        }
        public static VCBHelpers.CommonResponse InquiryCustomerInfo(string key, string cif)
        {
            try
            {
                GetCustomerInfoByCIFNoRequest request = new GetCustomerInfoByCIFNoRequest();
                //GetCustomerInfoResponseBody responce = new GetCustomerInfoResponseBody();

                //request.Body.cif = Int32.Parse(cif);
                //request.Body.key = _key;
                //var responce = _autoDebitSoap1.GetCustomerInfoByCIFNo(_key, Int64.Parse(cif));
                var responce = _autoDebitService.GetCustomerInfoByCIFNo(_key, Int64.Parse(cif));
                var result   = new VCBHelpers.CommonResponse();
                if (responce.Split('|')[0] == "00")
                {
                    result.ExitCode = "00";
                    result.Message  = responce.Substring(3, responce.Length - 3);
                }
                else
                {
                    result.ExitCode = responce.Split('|')[0];
                    result.Message  = responce.Split('|')[1];
                }
                //Utilities.TraceInterface("VCB AutoDebit Service", "GetCustomerInfo", "");
                //Utilities.TraceInterface("VCB AutoDebit Service", "GetCustomerInfo", "");
                Utilities.WriteLogReqRes("AutoDebit", "InquiryCustomerInfo", request, result);
                return(result);
            }
            catch (Exception ex)
            {
                //Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                //    Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                //Utilities.WriteToEventLog("VCB AutoDebit Service", ex, "GetCustomerInfo", 1, EventLogEntryType.Error);
                var result = new VCBHelpers.CommonResponse();
                result.ExitCode = "99";
                result.Message  = ex.Message;
                return(result);
            }
            //return new VCBHelpers.CommonResponse();
        }
        public static VCBHelpers.CommonResponse VRA_GetNewAccountNumber(int CIF, string DDAccount)
        {
            var result = new VCBHelpers.CommonResponse();

            try
            {
                var response = _vRAService.VRA_GetNewAccountNumber(CIF, DDAccount);
                result.ExitCode = response.ResponseCode.ToString();
                result.Message  = response.ResponseMessage;

                Utilities.TraceInterface("VCB VRA Service", "VRA_GetNewAccountNumber", CIF + " - " + DDAccount);
                Utilities.TraceInterface("VCB VRA Service", "VRA_GetNewAccountNumber", response);
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB VRA Service", ex, "VRA_GetNewAccountNumber", 1, EventLogEntryType.Error);
                result.ExitCode = "-1";
                result.Message  = ex.Message;
            }
            Utilities.WriteLogReqRes("VCBVRAService", "VRA_GetNewAccountNumber", CIF + ", " + DDAccount, result);
            return(result);
        }
        public static VCBHelpers.CommonResponse VRA_DeactivateAccount(string VRAccount, string TellerID, int TellerSequence, string SupID, int SupSequence, string DeptCode, int Branch)
        {
            var result = new VCBHelpers.CommonResponse();

            try
            {
                var response = _vRAService.VRA_DeactivateAccount(VRAccount, TellerID, TellerSequence, SupID, SupSequence, DeptCode, Branch);
                result.ExitCode = response.ResponseCode.ToString();
                result.Message  = response.ResponseMessage;

                Utilities.TraceInterface("VCB VRA Service", "VRA_ActivateAccount", VRAccount + " - " + TellerID);
                Utilities.TraceInterface("VCB VRA Service", "VRA_ActivateAccount", response);
            }
            catch (Exception ex)
            {
                Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                           Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                Utilities.WriteToEventLog("VCB VRA Service", ex, "VRA_DeactivateAccount", 1, EventLogEntryType.Error);
                result.ExitCode = "-1";
                result.Message  = ex.Message;
            }
            Utilities.WriteLogReqRes("VCBVRAService", "VRA_DeactivateAccount", VRAccount + ", " + TellerID + ", " + TellerSequence + ", " + SupID + ", " + SupSequence + ", " + DeptCode + ", " + Branch, result);
            return(result);
        }
        /// <summary>
        /// Calls the AutoDebit web service operation AutoDebitRegisterNewCustomer
        /// </summary>
        public static VCBHelpers.CommonResponse AutoDebitRegisterNewCustomer(int vas_id, string contractCode, string customerAddress, String contractName, string cif, string debitAccount, string branchID, string departmentID,
                                                                             string makerId, string checkerID, string ninumber, string service, string serviceProvider, string transType, string regionCode, string key)
        {
            //var response = new RegisterNewCustomerResponseBody();
            try
            {
                //build request
                var request = new RegisterNewCustomerRequestBody();
                request.activeBrn       = 2;
                request.activeSupId     = checkerID;
                request.activeSupSeq    = vas_id;
                request.activeTellerId  = makerId;
                request.activeTellerSeq = vas_id;
                request.customerAddress = customerAddress;
                request.customerCode    = contractCode;
                request.customerName    = contractName;
                request.customerRank    = 0;
                request.customerType    = "I";
                request.key             = _key;
                request.providerCode    = serviceProvider;
                request.regAccount      = debitAccount;
                request.regAccountBrn   = 1;
                request.regBrn          = 1;
                request.regCif          = int.Parse(cif);
                request.regIdNo         = ninumber;
                request.regIdType       = "";
                request.regName         = contractName;
                request.regSupId        = checkerID;
                request.regSupSeq       = vas_id;
                request.regTellerId     = makerId;
                request.regTellerSeq    = vas_id;
                request.serviceCode     = regionCode;
                request.transtype       = transType;
                request.departmentID    = departmentID;
                request.regionCode      = regionCode;
                request.service         = service;

                //var response = _autoDebitService.RegisterNewCustomer(request.key, request.providerCode, request.serviceCode, request.customerCode,
                //    request.customerName, request.customerAddress, request.customerType, request.customerRank, request.regCif, request.regName, request.regAccount
                //    , request.regAccountBrn, request.regIdNo, request.regIdType, request.regTellerId, request.regTellerSeq, request.regSupId
                //    , request.regSupSeq, request.regBrn, request.activeTellerId, request.activeTellerSeq, request.activeSupId, request.activeSupSeq
                //    , request.activeBrn);
                var response = _autoDebitService.RegisterNewCustomer(request.key, request.providerCode, request.serviceCode, request.customerCode,
                                                                     request.customerName, request.customerAddress, request.customerType, request.customerRank, request.regCif, request.regName, request.regAccount
                                                                     , request.regAccountBrn, request.regIdNo, request.regIdType, request.regTellerId, request.regTellerSeq, request.regSupId
                                                                     , request.regSupSeq, request.regBrn, request.activeTellerId, request.activeTellerSeq, request.activeSupId, request.activeSupSeq
                                                                     , request.activeBrn, request.service, request.transtype, request.departmentID, request.regionCode);
                var result = new VCBHelpers.CommonResponse();
                if (response.Split('|')[0] == "00")
                {
                    result.ExitCode = "00";
                    result.Message  = response.Split('|')[1];
                }
                else
                {
                    result.ExitCode = response.Split('|')[0];
                    result.Message  = response.Split('|')[1];
                }
                //Utilities.TraceInterface("VCB AutoDebit Service", "AutoDebitRegisterNewCustomer", request);
                //Utilities.TraceInterface("VCB AutoDebit Service", "AutoDebitRegisterNewCustomer", response);
                Utilities.WriteLogReqRes("AutoDebit", "RegisterNewCustomer", request, result);
                return(result);
            }
            catch (Exception ex)
            {
                //Logger.Log(Logger.Category.None, null, Logger.Severity.Fatal,
                //    Base.LOG_E_GENMSGNOMC, "Failed to serialize object (%s)", ex);
                //Utilities.WriteToEventLog("VCB AutoDebit Service", ex, "AutoDebitRegisterNewCustomer", 1, EventLogEntryType.Error);
                var result = new VCBHelpers.CommonResponse();
                result.ExitCode = "99";
                result.Message  = ex.Message;
                return(result);
            }
            //return new VCBHelpers.CommonResponse();
        }