コード例 #1
0
ファイル: AQRIDLookup.cs プロジェクト: Jshgalang/PDFParser
        public string GetAQRID(string securityName, string securityType)
        {
            string aqrID = string.Empty;

            securityName = StripInvalidCharacters(securityName);

            if (!string.IsNullOrEmpty(securityName) && !string.IsNullOrEmpty(securityType))
            {
                AQRIDLookUpData lookup = aqrIDLookups.Where(x => string.Compare(securityName, StripInvalidCharacters(x.SecurityName)) == 0 && string.Compare(securityType, x.SecurityType) == 0).FirstOrDefault();

                if (lookup != null)
                {
                    aqrID = lookup.AQRID;
                }
                else
                {
                    securityName = securityName.Replace("Future", "Futures");
                    lookup       = aqrIDLookups.Where(x => string.Compare(securityName, StripInvalidCharacters(x.SecurityName)) == 0 && string.Compare(securityType, x.SecurityType) == 0).FirstOrDefault();

                    if (lookup != null)
                    {
                        aqrID = lookup.AQRID;
                    }
                }
            }

            return(aqrID);
        }
コード例 #2
0
ファイル: AQRIDLookup.cs プロジェクト: Jshgalang/PDFParser
        private AQRIDLookUpData GetMatchingAccountByNameAndSecurityType(string securityName, string securityType)
        {
            AQRIDLookUpData lookup = null;

            lookup = aqrIDLookups.Where(x => string.Compare(x.SecurityType, securityType, true) == 0 && IsNameMatchByAlgorithm(x.SecurityName, securityName)).FirstOrDefault();
            return(lookup);
        }
コード例 #3
0
ファイル: AQRIDLookup.cs プロジェクト: Jshgalang/PDFParser
        public string GetAQRID(string securityName)
        {
            string aqrID = string.Empty;

            if (!string.IsNullOrEmpty(securityName))
            {
                AQRIDLookUpData lookup = aqrIDLookups.Where(x => string.Compare(securityName, x.SecurityName) == 0).FirstOrDefault();
                if (lookup != null)
                {
                    aqrID = lookup.AQRID;
                }
            }

            return(aqrID);
        }
コード例 #4
0
ファイル: AQRIDLookup.cs プロジェクト: Jshgalang/PDFParser
        public DateTime GetMaturityDateBySecurityName(string securityName)
        {
            DateTime maturityDate = DateTime.MinValue;

            if (!string.IsNullOrEmpty(securityName))
            {
                AQRIDLookUpData lookup = aqrIDLookups.Where(x => string.Compare(securityName, x.SecurityName, true) == 0).FirstOrDefault();
                if (lookup != null)
                {
                    maturityDate = lookup.MaturityDate;
                }
            }

            return(maturityDate);
        }
コード例 #5
0
ファイル: AQRIDLookup.cs プロジェクト: Jshgalang/PDFParser
        public string GetSecurityNameByType(string securityType)
        {
            string securityName = string.Empty;

            if (!string.IsNullOrEmpty(securityType))
            {
                AQRIDLookUpData lookup = aqrIDLookups.Where(x => string.Compare(securityType, x.SecurityType) == 0).FirstOrDefault();
                if (lookup != null)
                {
                    securityName = lookup.SecurityName;
                }
            }

            return(securityName);
        }
コード例 #6
0
ファイル: AQRIDLookup.cs プロジェクト: Jshgalang/PDFParser
        public string GetSecurityName(string securityType, DateTime maturityDate)
        {
            string securityName = string.Empty;

            if (!string.IsNullOrEmpty(securityType) && maturityDate > DateTime.MinValue)
            {
                AQRIDLookUpData lookup = aqrIDLookups.Where(x => string.Compare(StripInvalidCharacters(securityType), StripInvalidCharacters(x.SecurityType)) == 0 && x.MaturityDate == maturityDate).FirstOrDefault();
                if (lookup != null)
                {
                    securityName  = lookup.SecurityName;
                    selectedIndex = aqrIDLookups.IndexOf(lookup);
                }
            }

            return(securityName);
        }
コード例 #7
0
ファイル: AQRIDLookup.cs プロジェクト: Jshgalang/PDFParser
        public string GetSecurityNameByMatch(string securityAlias, DateTime maturityDate)
        {
            string foundName = string.Empty;

            if (!string.IsNullOrEmpty(securityAlias))
            {
                AQRIDLookUpData        matchedLookup  = null;
                List <AQRIDLookUpData> matchedLookups = aqrIDLookups.Where(x => StripInvalidCharacters(x.SecurityName.ToLower()).Contains(StripInvalidCharacters(securityAlias.ToLower()))).ToList();

                if (matchedLookups != null && matchedLookups.Count > 0)
                {
                    matchedLookup = matchedLookups.OrderBy(x => (maturityDate - x.MaturityDate).Duration()).First();
                    foundName     = matchedLookup.SecurityName;
                }
            }

            return(foundName);
        }