예제 #1
0
        // Print Source File and Get Weekly TradingInfo
        private JpTRADHInfo PrintAndGetJpWeeklyTradingInfo(string filePath)
        {
            JpTRADHInfo tradhInfo = new JpTRADHInfo();

            using (ExcelApp app = new ExcelApp(false, false))
            {
                var       workbook  = ExcelUtil.CreateOrOpenExcelFile(app, filePath);
                Worksheet worksheet = workbook.Worksheets[1] as Worksheet;
                JapanShared.PrintWorksheet(worksheet, printerName, XlPageOrientation.xlPortrait);
                worksheet.UsedRange.UnMerge();
                JpTRADHInfoPart1 part1        = new JpTRADHInfoPart1();
                DateTime[]       part1DateArr = ParseToGetTimeDuration(ExcelUtil.GetRange(33, 3, worksheet).Value2.ToString());
                part1.StartDate       = part1DateArr[0];
                part1.EndDate         = part1DateArr[1];
                part1.TransactionList = GetTransactionList(37, 3, worksheet);
                part1.Top15SellSum    = ExcelUtil.GetRange(52, 7, worksheet).Value2.ToString();
                part1.Top15BuySum     = ExcelUtil.GetRange(52, 9, worksheet).Value2.ToString();
                part1.Top15TotalSum   = ExcelUtil.GetRange(52, 13, worksheet).Value2.ToString();
                part1.GTotalSellSum   = ExcelUtil.GetRange(52, 7, worksheet).Value2.ToString();
                part1.GTotalBuySum    = ExcelUtil.GetRange(52, 9, worksheet).Value2.ToString();
                part1.GTotalTotalSum  = ExcelUtil.GetRange(52, 13, worksheet).Value2.ToString();
                JpTRADHInfoPart2 part2            = new JpTRADHInfoPart2();
                string           part2SourceTitle = ExcelUtil.GetRange(5, 3, worksheet).Value2.ToString().Trim();
                part2.Title = part2SourceTitle.Split('(')[0].Trim();
                DateTime[] part2DateArr = ParseToGetTimeDuration(part2SourceTitle.Split('(')[1].Trim());
                part2.StartDate = part2DateArr[0];
                part2.EndDate   = part2DateArr[1];
                for (int i = 5; i < 16; i++)
                {
                    if (ExcelUtil.GetRange(9, i, worksheet).Value2 != null && ExcelUtil.GetRange(9, i, worksheet).Value2.ToString().Trim() != string.Empty)
                    {
                        part2.ShareSumList.Add(ExcelUtil.GetRange(9, i, worksheet).Value2.ToString().Trim());
                    }
                }
                for (int i = 5; i < 16; i++)
                {
                    if (ExcelUtil.GetRange(10, i, worksheet).Value2 != null && ExcelUtil.GetRange(10, i, worksheet).Value2.ToString().Trim() != string.Empty)
                    {
                        part2.TradeVolList.Add(ExcelUtil.GetRange(10, i, worksheet).Value2.ToString().Trim());
                    }
                }
                JpTRADHInfoPart3 part3            = new JpTRADHInfoPart3();
                string           part3SourceTitle = ExcelUtil.GetRange(12, 3, worksheet).Value2.ToString();
                part3.Title = part3SourceTitle.Split('(')[0].Trim();
                part3.Date  = JapanShared.TransferJpDate(part3SourceTitle.Split('(')[1].Trim());
                for (int i = 5; i < 16; i++)
                {
                    if (ExcelUtil.GetRange(15, i, worksheet).Value2 != null && ExcelUtil.GetRange(15, i, worksheet).Value2.ToString().Trim() != string.Empty)
                    {
                        part3.ShareSumList.Add(ExcelUtil.GetRange(15, i, worksheet).Value2.ToString().Trim());
                    }
                }
                for (int i = 5; i < 16; i++)
                {
                    if (ExcelUtil.GetRange(16, i, worksheet).Value2 != null && ExcelUtil.GetRange(16, i, worksheet).Value2.ToString().Trim() != string.Empty)
                    {
                        part3.ShareIncrementList.Add(ExcelUtil.GetRange(16, i, worksheet).Value2.ToString().Trim());
                    }
                }
                for (int i = 5; i < 16; i++)
                {
                    if (ExcelUtil.GetRange(17, i, worksheet).Value2 != null && ExcelUtil.GetRange(17, i, worksheet).Value2.ToString().Trim() != string.Empty)
                    {
                        part3.TradeVolSumList.Add(ExcelUtil.GetRange(17, i, worksheet).Value2.ToString().Trim());
                    }
                }
                for (int i = 5; i < 16; i++)
                {
                    if (ExcelUtil.GetRange(18, i, worksheet).Value2 != null && ExcelUtil.GetRange(18, i, worksheet).Value2.ToString().Trim() != string.Empty)
                    {
                        part3.TradeVolIncrementList.Add(ExcelUtil.GetRange(18, i, worksheet).Value2.ToString().Trim());
                    }
                }
                tradhInfo.Part1 = part1;
                tradhInfo.Part2 = part2;
                tradhInfo.Part3 = part3;
            }
            return(tradhInfo);
        }
예제 #2
0
 public JpTRADHInfo()
 {
     Part1 = new JpTRADHInfoPart1();
     Part2 = new JpTRADHInfoPart2();
     Part3 = new JpTRADHInfoPart3();
 }