Exemplo n.º 1
0
        public void REGENERATE_DATA()
        {
            //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;

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

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

            path = "\\\\10.0.0.6\\shopdata\\Development\\Robin\\test\\New folder\\Income Statement Report at " + process.fiscalMonth + "-" + process.fiscalYear + ".xlsx";
            File.Delete(path);
            excelWriter.OutputToFile(path);
            Console.WriteLine("Done");
            //}

            //}
        }
Exemplo n.º 2
0
        public void Process()
        {
            int fiscalYear  = Convert.ToInt32(fiscal_year);
            int fiscalMonth = 10;

            if (generate_files)
            {
                for (int i = 1; i < 13; i++)
                {
                    Console.Write("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
                    IncomeStatementReport.ExcelWriter excelWriter = new IncomeStatementReport.ExcelWriter(process);
                    excelWriter.FillSheets();
                    // write to file
                    string path = "";
                    path = "\\\\10.0.0.6\\shopdata\\Development\\Robin\\test\\New folder\\Income Statement Report at " + process.fiscalMonth + "-" + process.fiscalYear + ".xlsx";
                    File.Delete(path);
                    excelWriter.OutputToFile(path);
                    fiscalMonth++;
                    excel.Quit();
                    Console.WriteLine("Done");
                    Console.WriteLine("");
                }
                //}
            }

            Update(fiscalYear.ToString());
        }