示例#1
0
        private static List <dynamic> CompareAndWriteOutput(List <dynamic> list)
        {
            List <dynamic> output = new List <dynamic>();

            var uniqueFunds = list.Select(g => g.FUNDCODE).Distinct();

            foreach (string fund in uniqueFunds)
            {
                var uniqueISIN = list.Where(g => g.FUNDCODE == fund).Select(t => t.ISIN).Distinct();

                foreach (var item in uniqueISIN)
                {
                    var matchedRecord = list.Where(g => g.ISIN == item && g.FUNDCODE == fund).ToArray();

                    var secondaryFile = new SecondaryFile
                    {
                        FUNDCODE = matchedRecord[0].FUNDCODE,
                        ISIN     = matchedRecord[0].ISIN,
                        CUSIP    = matchedRecord[0].CUSIP,
                        SEDOL    = matchedRecord[0].SEDOL,
                    };

                    output.Add(new OutputFile(secondaryFile, matchedRecord[0].BASKETSHARES, matchedRecord[1].BASKETSHARES));
                }
            }
            return(output);
        }
示例#2
0
 public OutputFile(SecondaryFile sf, int?plfShares, int?pcfShares)
 {
     this.FUNDCODE  = sf.FUNDCODE;
     this.ISIN      = sf.ISIN;
     this.CUSIP     = sf.CUSIP;
     this.SEDOL     = sf.SEDOL;
     this.PCFShares = pcfShares;
     this.PLFShares = plfShares;
 }
示例#3
0
 public OutputFile(SecondaryFile sf, string compareResult)
 {
     this.FUNDCODE     = sf.FUNDCODE;
     this.ISIN         = sf.ISIN;
     this.CUSIP        = sf.CUSIP;
     this.SEDOL        = sf.SEDOL;
     this.BASKETSHARES = sf.SHARES;
     this.CURRENCYCODE = sf.CUR;
     this.CIL          = sf.CIL;
     this.TRADECOUNTRY = sf.ISO;
     this.COMPARE      = compareResult;
 }