コード例 #1
0
        public static List <KlikBCABisnisInfo> KBB(Params request, Channel channel, string userId = null)
        {
            List <KlikBCABisnisInfo> kbb = new List <KlikBCABisnisInfo>();

            request.WSDL = "ESBDBDelimiter";
            ESBData data = EAI.RetrieveESBData(request);

            userId = string.IsNullOrEmpty(userId)? channel.UserId : userId;

            if (data != null && data.Result.Count != 0)
            {
                foreach (StringDictionary entry in data.Result)
                {
                    KlikBCABisnisInfo model = new KlikBCABisnisInfo();
                    if (!string.IsNullOrEmpty(channel.CorpId) && !string.IsNullOrEmpty(userId))
                    {
                        model.CorpID = channel.CorpId;
                        model.UserID = userId;
                        DateTime?lastLoginDate = Utility.ParseExact(entry["last_login_dt"], "yyyy-MM-dd HH:mm:ss");
                        DateTime?registerDate  = Utility.ParseExact(entry["registered_dt"], "yyyy-MM-dd HH:mm:ss");

                        model.UserName      = entry["nm"];
                        model.UserID        = userId;
                        model.CorpID        = channel.CorpId;
                        model.LastLoginDate = lastLoginDate;
                        model.RegisterDate  = registerDate;

                        model.LastStatusKey = entry["is_login"];
                        //model.LastStatus = Utility.GetStringMap(5, 4, entry["is_login"]);
                        model.LastStatus = Utility.GetStringMap(1, 1, model.LastStatusKey);
                        //kbb.LastStatus = new KeyValuePair<int, string>(Int32.Parse(entry["is_login"]), Utility.GetStringMap(5, 4, entry["is_login"]));
                        model.Email1 = entry["email1"];
                        model.Email2 = entry["email2"];
                    }
                    else if (!string.IsNullOrEmpty(channel.EmailAddress))
                    {
                        model.UserID   = channel.UserId;
                        model.CorpID   = entry["cd"];
                        model.CorpName = entry["nm"];
                        model.Email1   = entry["email1"];
                        model.Email2   = entry["email2"];
                    }

                    else if (!string.IsNullOrEmpty(channel.AccountNo))
                    {
                        model.CorpID    = entry["corporate_code"];
                        model.CorpName  = entry["corporate_name"];
                        model.Email1    = entry["corporate_email_address_1"];
                        model.Email2    = entry["corporate_email_address_2"];
                        model.AccountNo = entry["account_number"];
                    }
                    kbb.Add(model);
                }
            }
            return(kbb);
        }
コード例 #2
0
        public static List <KlikBCABisnisInfo> KBBKeyBCAConnection(Channel channel, string requestToken, string userIdInput)//, string requestToken = null)
        {
            string resultToken           = null;
            List <KlikBCABisnisInfo> kbb = new List <KlikBCABisnisInfo>();
            Params param = new Params()
            {
                Parameter = new Dictionary <string, string>()
            };
            ESBData data = new ESBData()
            {
                Result = new List <StringDictionary>()
            };

            if (!string.IsNullOrEmpty(requestToken))
            {
                resultToken            = requestToken;
                param.RequestTransType = "GetTokenSMETblKoneksiInfoBySNToken";
                param.Parameter.Add("SN_Token", resultToken);
            }
            else if (!string.IsNullOrEmpty(channel.SNKeyBCA))
            {
                resultToken            = requestToken;
                param.RequestTransType = "GetTokenSMETblKoneksiInfoBySNToken";
                param.Parameter.Add("SN_Token", channel.SNKeyBCA);
            }
            else if (!string.IsNullOrEmpty(channel.CorpId) && !string.IsNullOrEmpty(userIdInput))
            {
                param.RequestTransType = "GetTokenSMETblKoneksiInfoByKeyId";
                param.Parameter.Add("keyId", channel.CorpId + userIdInput);
            }
            else if (!string.IsNullOrEmpty(channel.CorpId))
            {
                param.RequestTransType = "GetTokenSMETblKoneksiInfoByCorpId";
                param.Parameter.Add("CorporateID", channel.CorpId);
            }
            param.WSDL = "ESBDBDelimiter";

            data = EAI.RetrieveESBData(param);

            if (data != null && data.Result.Count > 0)
            {
                string keyId        = string.Empty;
                string corpId       = string.Empty;
                string userId       = string.Empty;
                string functionType = string.Empty;

                resultToken = data.Result[0]["sn_token"];

                if (resultToken != null)
                {
                    StringDictionary tokenInfoDictionary = RetrieveSMETokenInfo(resultToken);

                    foreach (StringDictionary record in data.Result)
                    {
                        keyId        = string.Empty;
                        corpId       = string.Empty;
                        userId       = string.Empty;
                        functionType = string.Empty;

                        keyId = record["keyId"];
                        if (!string.IsNullOrEmpty(keyId) && keyId.Length > 10)
                        {
                            corpId = keyId.Substring(0, 10);
                            userId = keyId.Substring(10);
                            if (keyId.Substring(0, 3).ToUpperInvariant() == "KBC")
                            {
                                functionType = "100103";
                            }
                            else
                            {
                                functionType = "100102";
                            }
                        }

                        ESBData dataStep = new ESBData()
                        {
                            Result = new List <StringDictionary>()
                        };
                        Params paramStep = new Params()
                        {
                            Parameter = new Dictionary <string, string>()
                        };

                        try
                        {
                            paramStep.RequestTransType = "GetKBBId1ByUserIdStep1";
                            paramStep.Parameter.Add("userId", userId);
                            paramStep.Parameter.Add("funcType", functionType);
                            paramStep.Parameter.Add("corpId", corpId);
                            paramStep.Parameter.Add("ActionDescription", "RELEASE");
                            paramStep.WSDL = "ESBDBDelimiter";

                            dataStep = EAI.RetrieveESBData(paramStep);
                        }
                        catch (ServiceAgentException ex)
                        {
                            TraceHelper.TraceEvent(ex);
                        }

                        if (dataStep == null || dataStep.Result.Count <= 0)
                        {
                            try
                            {
                                paramStep.Parameter        = new Dictionary <string, string>();
                                paramStep.RequestTransType = "GetKBBId1ByUserIdStep2";
                                paramStep.Parameter.Add("userId", userId);
                                paramStep.Parameter.Add("funcType", functionType);
                                paramStep.Parameter.Add("ActionDescription", "RELEASE");
                                paramStep.WSDL = "ESBDBDelimiter";

                                dataStep = EAI.RetrieveESBData(paramStep);
                            }
                            catch (ServiceAgentException ex)
                            {
                                TraceHelper.TraceEvent(ex);
                            }
                        }

                        string Id1 = string.Empty;
                        if (dataStep != null && dataStep.Result.Count > 0)
                        {
                            Id1 = dataStep.Result[0]["wktkonek"];
                        }

                        string Id2 = record["id2"];
                        if (!string.IsNullOrWhiteSpace(Id2))
                        {
                            DateTime timeId2 = DateTime.ParseExact(Id2.Substring(11, 8), "HH:mm:ss", CultureInfo.InvariantCulture);
                            Id2 = Id2.Substring(0, 11) + timeId2.ToString("hh:mm:ss") + Id2.Substring(22);
                        }

                        string corporateName = string.Empty;
                        int    flagService1  = 0;
                        string updateOfficer = string.Empty;
                        string oldStatus     = string.Empty;
                        string newStatus     = string.Empty;
                        string tokenBranch   = string.Empty;

                        if (flagService1 == 0)
                        {
                            try
                            {
                                Params paramCorp = new Params()
                                {
                                    Parameter = new Dictionary <string, string>()
                                };
                                paramCorp.WSDL             = "ESBDBDelimiter";
                                paramCorp.RequestTransType = "GetCorporateNameByCorpId";
                                paramCorp.Parameter.Add("corpId", corpId);
                                ESBData dataCoorporate = new ESBData()
                                {
                                    Result = new List <StringDictionary>()
                                };
                                dataCoorporate = EAI.RetrieveESBData(paramCorp);

                                if (dataCoorporate != null && dataCoorporate.Result.Count > 0)
                                {
                                    corporateName = dataCoorporate.Result[0]["nm"];
                                }
                            }
                            catch (ServiceAgentException ex)
                            {
                                TraceHelper.TraceEvent(ex);
                            }

                            try
                            {
                                Params paramBranch = new Params()
                                {
                                    Parameter = new Dictionary <string, string>()
                                };
                                paramBranch.RequestTransType = "GetTokenSMEBranchInfo";
                                paramBranch.Parameter.Add("keyId", keyId);
                                paramBranch.Parameter.Add("OldStatus", "NEW");
                                paramBranch.Parameter.Add("NewStatus", "AKT");
                                paramBranch.WSDL = "ESBDBDelimiter";

                                ESBData dataBranch = new ESBData()
                                {
                                    Result = new List <StringDictionary>()
                                };
                                dataBranch = EAI.RetrieveESBData(paramBranch);

                                if (dataBranch != null && dataBranch.Result.Count > 0)
                                {
                                    updateOfficer = dataBranch.Result[0]["updateofficer"];

                                    /* The tokenBranch was initally mapped to  [GetTokenSMEBranchInfo.tokenBranch] , but was changed on 23May2011
                                     * as BCA requested that it should be mapped to [GetTokenSMEBranchInfo.kcpCd] + ’-‘ + [GetTokenSMEBranchInfo.tokenCity]
                                     */
                                    tokenBranch = dataBranch.Result[0]["kdkcp"] + " - " + dataBranch.Result[0]["kotatoken"];
                                }
                            }
                            catch (ServiceAgentException ex)
                            {
                                TraceHelper.TraceEvent(ex);
                            }
                            flagService1 = 1;
                        }

                        DateTime?lastUpdateDate = Utility.ParseExact(record["lastupdate"], "yyyy-MM-dd HH:mm:ss");

                        KlikBCABisnisInfo kbbinfo = new KlikBCABisnisInfo()
                        {
                            SNKeyBca    = record["sn_token"],
                            UserID      = userId,
                            UserName    = record["firstName"],
                            UpdatedOn   = lastUpdateDate, //// lastUpdateDate.HasValue ? DateFormatter.ToStringExact(lastUpdateDate.Value, DateFormatter.KeyBCABusinessConnectionInquiryUpdateDateUIDisplayFormat) : string.Empty,
                            ID1         = Id1,
                            ID2         = Id2,
                            ActivatedBy = record["spvOfficer"],
                            UpdatedBy   = record["updateofficer"],
                            CardNo      = record["cardNo"],
                            CreatedDate = record["createdDate"],
                            KeyId       = record["keyId"],
                            CorpName    = corporateName,
                            BranchName  = tokenBranch,
                            CorpID      = corpId
                        };

                        // Earlier the ApplicationName value was based on "aplCd", but was changed on 24-May-2011 to read from "KeyId" (refer to the below logic)
                        if (!string.IsNullOrEmpty(kbbinfo.KeyId) && kbbinfo.KeyId.Length >= 3)
                        {
                            string appValue = string.Compare("KBC", kbbinfo.KeyId.Substring(0, 3), true, CultureInfo.InvariantCulture) != 0 ? "SME" : "KBC";
                            kbbinfo.ApplicationName = appValue;
                            //inquiryStatusRecord.ApplicationName = new KeyValuePair<string, string>(record["aplCd"], appValue);
                        }

                        if (tokenInfoDictionary != null)
                        {
                            kbbinfo.TokenTypeKey = tokenInfoDictionary["tokenType"];
                            kbbinfo.TokenType    = kbbinfo.TokenTypeKey == "A" ? "Active Card" : "Vasco";
                        }

                        // If the Key is not found in the Status Mapper, then "TIDAK ADA TOKEN" is to be displayed.
                        //string keyValue = Utility.GetStringMap(11, 4, record["kd_status"]);

                        kbbinfo.KeyBCAStatusKey = record["kd_status"];
                        kbbinfo.KeyBCAStatus    = Utility.GetStringMap(11, 1, kbbinfo.KeyBCAStatusKey);
                        if (kbbinfo.KeyBCAStatus == kbbinfo.KeyBCAStatusKey)
                        {
                            kbbinfo.KeyBCAStatusKey   = "";
                            kbbinfo.KeyBCAStatus      = "TIDAK ADA TOKEN";
                            kbbinfo.KeyBCAStatusLabel = kbbinfo.KeyBCAStatus;
                        }
                        else
                        {
                            kbbinfo.KeyBCAStatusLabel = kbbinfo.KeyBCAStatusKey + " - " + kbbinfo.KeyBCAStatus.ToUpper();
                        }
                        kbb.Add(kbbinfo);
                    }
                }
            }

            return(kbb);
        }
コード例 #3
0
        private static void Step2StatuPermohananKeyBCASME(List <KlikBCABisnisInfo> respon, string corporateName, string tokenBranch, InputParameterType parameter, string requestToken, string requestCorpId, string requestUserId)
        {
            try
            {
                ESBData data = new ESBData()
                {
                    Result = new List <StringDictionary>()
                };
                Params param = new Params()
                {
                    Parameter = new Dictionary <string, string>()
                };

                if (parameter == InputParameterType.Token)
                {
                    param.RequestTransType = "GetTokenSMETblHapusKoneksiTokenInfoBySNToken";
                    param.Parameter.Add("SN_Token", requestToken);
                }
                else if (parameter == InputParameterType.KeyId)
                {
                    parameter = InputParameterType.KeyId;
                    param.RequestTransType = "GetTokenSMETblHapusKoneksiTokenInfoByKeyId";
                    param.Parameter.Add("KeyID", requestCorpId + requestUserId);
                }
                else if (parameter == InputParameterType.CorpId)
                {
                    parameter = InputParameterType.CorpId;
                    param.RequestTransType = "GetTokenSMETblHapusKoneksiTokenInfoByCorpId";
                    param.Parameter.Add("CorporateID", requestCorpId);
                }

                param.WSDL = "ESBDBDelimiter";

                data = EAI.RetrieveESBData(param);

                string keyId  = string.Empty;
                string corpId = string.Empty;
                string userId = string.Empty;

                foreach (StringDictionary record in data.Result)
                {
                    keyId  = record["keyid"];
                    corpId = string.Empty;
                    userId = string.Empty;

                    if (!string.IsNullOrEmpty(keyId) && keyId.Length > 10)
                    {
                        corpId = keyId.Substring(0, 10);
                        userId = keyId.Substring(10);
                    }

                    DateTime?lastUpdatedDate = Utility.ParseExact(record["lastUpdate"], "yyyy-MM-dd H:mm:ss");

                    //if(fn:string-length($row/Record[fn:lower-case(*:key) = 'id2']/value/text()) > 0) then
                    //  let $waktuKonek := fn:substring($row/Record[fn:lower-case(*:key) = 'id2']/value/text() , 1 , 22)
                    //  return concat(fn-bea:
                    //              dateTime-to-string-with-format('MM/dd/yyyy hh:mm:ss', fn-bea:dateTime-from-string-with-format('MM dd yyyy HH:mm:ss a', replace($waktuKonek, '/', ' '))) , ' ' , fn:substring($row/Record[fn:lower-case(*:key) = 'id2']/value/text() , 23))
                    //  else ''

                    KlikBCABisnisInfo kbbinfo = new KlikBCABisnisInfo()
                    {
                        SNKeyBca    = record["sn_Token"],
                        UserID      = userId,
                        ID2         = record["id2"],
                        ActivatedBy = record["spvofficer"],
                        UpdatedBy   = record["updateofficer"],
                        UserName    = record["firstname"],
                        KeyId       = record["keyid"],
                        CorpName    = corporateName,
                        BranchName  = tokenBranch,
                        UpdatedOn   = lastUpdatedDate
                    };

                    kbbinfo.ApplicationName = record["aplName"];
                    //inquiryStatusRecord.ApplicationName = new KeyValuePair<string, string>(record["aplName"], record["aplName"]);

                    //if (!string.IsNullOrEmpty(inquiryStatusRecord.KeyId) && inquiryStatusRecord.KeyId.Length >= 3)
                    //{
                    //    string appValue = string.Compare("KBC", inquiryStatusRecord.KeyId.Substring(0, 3), true, CultureInfo.InvariantCulture) != 0 ? "SME" : "KBC";
                    //    inquiryStatusRecord.ApplicationName = new KeyValuePair<string, string>(record["aplCd"], appValue);
                    //}

                    // If the Key is not found in the Status Mapper, then "TIDAK ADA TOKEN" is to be displayed.
                    //string keyValue = Utility.GetStringMap(11, 4, record["kd_status"]);
                    string keyValue = Utility.GetStringMap(12, 5, record["kd_status"]);
                    if (keyValue == record["kd_status"])
                    {
                        keyValue = "TIDAK ADA TOKEN";
                    }

                    kbbinfo.Action = keyValue;
                    //inquiryStatusRecord.Action = new KeyValuePair<string, string>(record["kd_status"], keyValue);

                    respon.Add(kbbinfo);
                }
            }
            catch (ServiceAgentException)
            {
                // If it fails still we have to show other results.
            }
        }
コード例 #4
0
        private static void Step3StatuPermohananKeyBCASME(List <KlikBCABisnisInfo> respon, string corporateName, string tokenBranch, InputParameterType parameter, string requestToken, string requestCorpId, string requestUserId)
        {
            try
            {
                ESBData data = new ESBData()
                {
                    Result = new List <StringDictionary>()
                };
                Params param = new Params()
                {
                    Parameter = new Dictionary <string, string>()
                };
                if (parameter == InputParameterType.Token)
                {
                    param.RequestTransType = "GetTokenSMETblHapusKoneksiTokenInfoBySNToken";
                    param.Parameter.Add("SN_Token", requestToken);
                }
                else if (parameter == InputParameterType.KeyId)
                {
                    parameter = InputParameterType.KeyId;
                    param.RequestTransType = "GetTokenSMETblHapusKoneksiTokenInfoByKeyId";
                    param.Parameter.Add("KeyID", requestCorpId + requestUserId);
                }
                else if (parameter == InputParameterType.CorpId)
                {
                    parameter = InputParameterType.CorpId;
                    param.RequestTransType = "GetTokenSMETblHapusKoneksiTokenInfoByCorpId";
                    param.Parameter.Add("CorporateID", requestCorpId);
                }

                param.WSDL = "ESBDBDelimiter";

                data = EAI.RetrieveESBData(param);

                string keyId  = string.Empty;
                string corpId = string.Empty;
                string userId = string.Empty;

                foreach (StringDictionary record in data.Result)
                {
                    keyId  = record["keyid"];
                    corpId = string.Empty;
                    userId = string.Empty;

                    if (!string.IsNullOrEmpty(keyId) && keyId.Length > 10)
                    {
                        corpId = keyId.Substring(0, 10);
                        userId = keyId.Substring(10);
                    }

                    DateTime?lastUpdatedDate = Utility.ParseExact(record["lastupdate"], "yyyy-MM-dd H:mm:ss");

                    KlikBCABisnisInfo kbbinfo = new KlikBCABisnisInfo()
                    {
                        SNKeyBca    = record["sn_token"],
                        UserID      = userId,
                        ID2         = record["id2"],
                        ActivatedBy = record["spvofficer"],
                        UpdatedBy   = record["updateofficer"],
                        UserName    = record["firstname"],
                        KeyId       = record["keyId"],
                        CorpName    = corporateName,
                        BranchName  = tokenBranch,
                        UpdatedOn   = lastUpdatedDate
                    };

                    // Earlier the ApplicationName value was based on "aplCd", but was changed on 24-May-2011 to read from "KeyId" (refer to the below logic)
                    if (!string.IsNullOrEmpty(kbbinfo.KeyId) && kbbinfo.KeyId.Length >= 3)
                    {
                        string appKey   = string.Compare("KBC", keyId.Substring(0, 3), true, CultureInfo.InvariantCulture) != 0 ? "SME" : "KBC";
                        string appValue = appKey;
                        kbbinfo.ApplicationName = appValue;
                        //inquiryStatusRecord.ApplicationName = new KeyValuePair<string, string>(appKey, appValue);
                    }

                    kbbinfo.Action = record["kd_status"];
                    //inquiryStatusRecord.Action = new KeyValuePair<string, string>("Hapus Token", record["kd_status"]);

                    respon.Add(kbbinfo);
                }
            }
            catch (ServiceAgentException)
            {
                // If it fails still we have to show other results.
            }
        }
コード例 #5
0
        private static void Step1StatuPermohananKeyBCASME(List <KlikBCABisnisInfo> respon, List <StringDictionary> records, string corporateName, string tokenBranch)
        {
            try
            {
                string keyId        = string.Empty;
                string corpId       = string.Empty;
                string userId       = string.Empty;
                string functionType = string.Empty;

                foreach (StringDictionary record in records)
                {
                    keyId        = record["keyId"];
                    corpId       = string.Empty;
                    userId       = string.Empty;
                    functionType = string.Empty;
                    if (!string.IsNullOrEmpty(keyId) && keyId.Length > 10)
                    {
                        corpId = keyId.Substring(0, 10);
                        userId = keyId.Substring(10);
                        if (keyId.Substring(0, 3).ToUpperInvariant() == "KBC")
                        {
                            functionType = "100103";
                        }
                        else
                        {
                            functionType = "100102";
                        }
                    }

                    ESBData data = new ESBData()
                    {
                        Result = new List <StringDictionary>()
                    };
                    Params param = new Params()
                    {
                        Parameter = new Dictionary <string, string>()
                    };

                    try
                    {
                        param.RequestTransType = "GetKBBId1ByUserIdStep1";
                        param.Parameter.Add("UserID", userId);
                        param.Parameter.Add("FunctionType", functionType);
                        param.Parameter.Add("CorporateID", corpId);
                        param.Parameter.Add("ActionDescription", "RELEASE");
                        param.WSDL = "ESBDBDelimiter";

                        data = EAI.RetrieveESBData(param);
                    }
                    catch (ServiceAgentException ex)
                    {
                        TraceHelper.TraceEvent(ex);
                    }

                    if (data == null || data.Result.Count <= 0)
                    {
                        try
                        {
                            param.Parameter        = new Dictionary <string, string>();
                            param.RequestTransType = "GetKBBId1ByUserIdStep2";
                            param.Parameter.Add("UserID", userId);
                            param.Parameter.Add("FunctionType", functionType);
                            param.Parameter.Add("ActionDescription", "RELEASE");
                            param.WSDL = "ESBDBDelimiter";

                            data = EAI.RetrieveESBData(param);
                        }
                        catch (ServiceAgentException ex)
                        {
                            TraceHelper.TraceEvent(ex);
                        }
                    }

                    string Id1 = string.Empty;

                    if (data != null && data.Result.Count > 0)
                    {
                        Id1 = data.Result[0]["log_dt"];
                    }

                    DateTime?lastUpdatedDate = Utility.ParseExact(record["lastupdate"], "yyyy-MM-dd H:mm:ss");

                    KlikBCABisnisInfo kbbinfo = new KlikBCABisnisInfo()
                    {
                        SNKeyBca    = record["sn_token"],
                        UserID      = userId,
                        ID1         = Id1,
                        ID2         = record["id2"],
                        ActivatedBy = record["spvOfficer"],
                        UpdatedBy   = record["updateofficer"],
                        UserName    = record["firstName"],
                        KeyId       = record["keyId"],
                        CorpName    = corporateName,
                        BranchName  = tokenBranch,
                        UpdatedOn   = lastUpdatedDate
                    };


                    // Earlier the ApplicationName value was based on "aplCd", but was changed on 24-May-2011 to read from "KeyId" (refer to the below logic)
                    if (!string.IsNullOrEmpty(kbbinfo.KeyId) && kbbinfo.KeyId.Length >= 3)
                    {
                        string appValue = string.Compare("KBC", kbbinfo.KeyId.Substring(0, 3), true, CultureInfo.InvariantCulture) != 0 ? "SME" : "KBC";
                        kbbinfo.ApplicationName = appValue;
                        //inquiryStatusRecord.ApplicationName = new KeyValuePair<string, string>(record["KdApl"], appValue);
                    }

                    // If the Key is not found in the Status Mapper, then "TIDAK ADA TOKEN" is to be displayed.
                    //string keyValue = Utility.GetStringMap(11, 4, record["kd_status"]);
                    string keyValue = Utility.GetStringMap(12, 5, record["kd_status"]);
                    if (keyValue == record["kd_status"])
                    {
                        keyValue = "TIDAK ADA TOKEN";
                    }

                    kbbinfo.Action = keyValue;
                    //inquiryStatusRecord.Action = new KeyValuePair<string, string>(record["kd_status"], keyValue);

                    respon.Add(kbbinfo);
                }
            }
            catch (ServiceAgentException)
            {
            }
        }