Ejemplo n.º 1
0
        public void GenerateCorpTriMonday(DateTime generateDate)
        {
            DateTime ReprtStartDate = generateDate.AddDays(-9);
            DateTime ReprtEndDate   = generateDate.AddDays(-3);

            string[] ProcNamesW = new string[5] {
                "Corp_IM", "Corp_SR", "Corp_PBI", "Corp_PKE", "Corp_WO"
            };
            string[,] ParamsW = new string[5, 2] {
                { ReprtStartDate.ToString("yyyy-MM-dd"), ReprtEndDate.ToString("yyyy-MM-dd") }
                , { ReprtStartDate.ToString("yyyy-MM-dd"), ReprtEndDate.ToString("yyyy-MM-dd") }
                , { ReprtStartDate.ToString("yyyy-MM-dd"), ReprtEndDate.ToString("yyyy-MM-dd") }
                , { ReprtStartDate.ToString("yyyy-MM-dd"), ReprtEndDate.ToString("yyyy-MM-dd") }
                , { ReprtStartDate.ToString("yyyy-MM-dd"), ReprtEndDate.ToString("yyyy-MM-dd") }
            };                                     //benchmark para add in ExecuteProcWithParam method
            string[] sheetnameW = new string[5] {
                "IM", "SR", "PBI", "PKE", "WO"
            };
            string templateReportfile = "Corp Tricare Weekly New -demo.xls";

            DBAccess dbAccess = new DBAccess();
            DataSet  CorpDs   = dbAccess.ExecuteProcWithParam_Navy(templateReportfile, ProcNamesW, sheetnameW, ParamsW, ReprtEndDate);

            string   reportStartStr     = ReprtStartDate.ToString("MMdd");
            string   reportEndStr       = ReprtEndDate.ToString("MMdd");
            ExcelBus excelBiz           = new ExcelBus();
            string   savePath           = corpTrackWeekly1Path + reportStartStr + "-" + reportEndStr;
            string   corpReportSavePath = savePath + @"\Corp Tricare Weekly New " + reportStartStr + "-" + reportEndStr + ".xls";

            if (!Directory.Exists(savePath))
            {
                Directory.CreateDirectory(savePath);
            }
            excelBiz.ExportDataToExcel_New(corpReportSavePath, templateReportfile, ProcNamesW, sheetnameW, CorpDs);
        }
Ejemplo n.º 2
0
        public void GenerateCorpTriMonday(DateTime generateDate)
        {
            DateTime ReprtStartDate = generateDate.AddDays(-9);
            DateTime ReprtEndDate = generateDate.AddDays(-3);

            string[] ProcNamesW = new string[5] { "Corp_IM", "Corp_SR", "Corp_PBI", "Corp_PKE", "Corp_WO" };
            string[,] ParamsW = new string[5, 2] {
                                                    { ReprtStartDate.ToString("yyyy-MM-dd"), ReprtEndDate.ToString("yyyy-MM-dd") }
                                                    ,{ ReprtStartDate.ToString("yyyy-MM-dd"), ReprtEndDate.ToString("yyyy-MM-dd") }
                                                    ,{ ReprtStartDate.ToString("yyyy-MM-dd"), ReprtEndDate.ToString("yyyy-MM-dd") }
                                                    ,{ ReprtStartDate.ToString("yyyy-MM-dd"), ReprtEndDate.ToString("yyyy-MM-dd") }
                                                    ,{ ReprtStartDate.ToString("yyyy-MM-dd"), ReprtEndDate.ToString("yyyy-MM-dd") }
                                                 };//benchmark para add in ExecuteProcWithParam method
            string[] sheetnameW = new string[5] { "IM", "SR", "PBI", "PKE", "WO" };
            string templateReportfile = "Corp Tricare Weekly New -demo.xls";

            DBAccess dbAccess = new DBAccess();
            DataSet CorpDs = dbAccess.ExecuteProcWithParam_Navy(templateReportfile, ProcNamesW, sheetnameW, ParamsW, ReprtEndDate);

            string reportStartStr = ReprtStartDate.ToString("MMdd");
            string reportEndStr = ReprtEndDate.ToString("MMdd");
            ExcelBus excelBiz = new ExcelBus();
            string savePath = corpTrackWeekly1Path + reportStartStr + "-" + reportEndStr;
            string corpReportSavePath = savePath + @"\Corp Tricare Weekly New " + reportStartStr + "-" + reportEndStr + ".xls";

            if (!Directory.Exists(savePath))
            {
                Directory.CreateDirectory(savePath);
            }
            excelBiz.ExportDataToExcel_New(corpReportSavePath, templateReportfile, ProcNamesW, sheetnameW, CorpDs);
        }