Ejemplo n.º 1
0
        public void RefreshData()
        {
            //if (DateTime.Now.Year == Convert.ToInt32("20" + fiscal_year))
            //{
            //for (int i = 1; i < 13; i++)
            //{
            int i = Convert.ToInt32(fiscal_month);                //DateTime.Now.Month;

            Log.Append("    Retrieving required information..."); //d " + (i + 1).ToString() + "...");
            Process process = new Process(Convert.ToInt32(fiscal_year), i);

            // create excel object
            MvcApplication1.Financial_Reports.Income_Statement.ExcelWriter excelWriter = new MvcApplication1.Financial_Reports.Income_Statement.ExcelWriter(process);
            excelWriter.FillSheets();
            // write to file
            string path = "";

            path = @"\\10.0.0.8\EmailAPI\Financials\YTD-IS-Reports\Repository\Income Statement Report at " + process.fiscalMonth + "-" + process.fiscalYear + ".xlsx";
            File.Delete(path);
            excelWriter.OutputToFile(path);
            Log.Append("    Done");
            //}

            //}
        }
Ejemplo n.º 2
0
        public void RefreshDataAll()
        {
            int fiscalYear = Convert.ToInt32(fiscal_year);

            //int fiscalMonth = Convert.ToInt32(fiscal_month);
            //int fiscalMonth = 10;
            for (int i = 1; i < 13; i++)
            {
                Log.Append("    Retrieving information for period... " + (i).ToString() + "...");
                //if (fiscalMonth > 12) fiscalMonth = 1;
                //Process process = new Process((fiscalMonth > 9 ? fiscalYear - 1 : fiscalYear), fiscalMonth);
                Process process = new Process(fiscalYear, i);
                // create excel object
                MvcApplication1.Financial_Reports.Income_Statement.ExcelWriter excelWriter = new MvcApplication1.Financial_Reports.Income_Statement.ExcelWriter(process);
                excelWriter.FillSheets();
                // write to file
                string path = @"\\10.0.0.8\EmailAPI\Financials\YTD-IS-Reports\Repository\Income Statement Report at " + process.fiscalMonth + "-" + process.fiscalYear + ".xlsx";
                File.Delete(path);
                excelWriter.OutputToFile(path);
                //fiscalMonth++;
                Log.Append("    Done");
            }
        }