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);
        }
Example #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);
        }
Example #3
0
        private void button17_Click(object sender, EventArgs e)
        {
            ExcelBus excelBiz = new ExcelBus();
            DateTime CorpTriWeeklygenerateDate = dateTimePicker1.Value;

            excelBiz.PrepareFilesForCorpTricareMonday(CorpTriWeeklygenerateDate);

            ReportBusiness rptBiz = new ReportBusiness();

            rptBiz.GenerateCorpTriMonday(CorpTriWeeklygenerateDate);
        }
Example #4
0
        private void button18_Click(object sender, EventArgs e)
        {
            string weekday = dateTimePicker1.Value.DayOfWeek.ToString();

            if (weekday == "Thursday")
            {
                DateTime TriWeeklygenerateDate = dateTimePicker1.Value;
                ExcelBus excelBiz = new ExcelBus();
                excelBiz.PrepareFilesForTricareRpt(TriWeeklygenerateDate);
                MessageBox.Show("Successed!");
            }
            else
            {
                MessageBox.Show("请选择正确日期!");
            }
        }
Example #5
0
 private void button5_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == "")
     {
         MessageBox.Show("请选择文件!");
     }
     else
     {
         ExcelBus excelBiz   = new ExcelBus();
         string   excelPath  = textBox3.Text;
         DataSet  dsOpenTask = excelBiz.getDataSetFromExcel(excelPath, "Page1-1$");
         _dba.ExecuteCommand("truncate table TaskAssignedRaw");
         _dba.InsertTaskData(dsOpenTask);
         MessageBox.Show("Successed!");
     }
 }
Example #6
0
        private void button13_Click(object sender, EventArgs e)
        {
            string weekday = dateTimePicker1.Value.DayOfWeek.ToString();

            if (weekday == "Monday")
            {
                DateTime generatedate = dateTimePicker1.Value;
                ExcelBus excelBiz     = new ExcelBus();
                excelBiz.PrepareFilesForRADTricareMonday(generatedate);
                ReportBusiness rptBiz = new ReportBusiness();
                rptBiz.GenerateTricareMonday(generatedate);
            }
            else
            {
                MessageBox.Show("请选择正确日期!");
            }
        }
Example #7
0
        /// <summary>
        /// Generates tricarte weekly report on Thursday.
        /// </summary>
        public void GenerateTricareWeeklyRpt(DateTime generateDate, out string errorMsg)
        {
            DateTime todayDate      = DateTime.Now;
            int      delayDays      = (generateDate - todayDate).Days; //get number for store procedure parameter
            int      startDelayDays = delayDays - 6;                   //get number for store procedure parameter

            string[] ProcNamesW = new string[4] {
                "IMRpt_TricareForMulti", "SRRpt_TricareForMulti", "PBLMRpt_TricareForMulti", "TriBenchMarkRpt_MatchedBacklog"
            };
            string[,] ParamsW = new string[3, 2] {
                { delayDays.ToString(), startDelayDays.ToString() }
                , { delayDays.ToString(), startDelayDays.ToString() }
                , { delayDays.ToString(), startDelayDays.ToString() }
            };                                     //benchmark para add in ExecuteProcWithParam method
            string[] sheetnameW = new string[4] {
                "IM", "SR", "PM", "BenchMarkData"
            };
            string filename1W = "TRICATE Team Weekly-demo.xls";

            DBAccess dbAccess = new DBAccess();

            dbAccess.ExecuteProcWithParam(filename1W, ProcNamesW, sheetnameW, ParamsW, true, generateDate);

            DateTime EndDay   = generateDate.AddDays(-1);
            DateTime StartDay = generateDate.AddDays(-7);

            string endDate      = EndDay.ToString("yyyyMMdd");
            string startDate    = StartDay.ToString("yyyyMMdd");
            string endDateShort = EndDay.ToString("MMdd");

            //TRICATE Team Weekly-demo.xls
            ExcelHelper excelHelper    = new ExcelHelper();
            string      sourceFilePath = finalReportsPath + endDate + @"\" + "TRICATE Team Weekly-demo-" + endDateShort + ".xls";
            string      copyToPath     = trackWeekly4Path + endDate;
            string      copyToFullPath = copyToPath + @"\" + "TRICATE Team Weekly-" + startDate + "-" + endDate + ".xls";

            if (!Directory.Exists(copyToPath))
            {
                Directory.CreateDirectory(copyToPath);
            }
            File.Copy(sourceFilePath, copyToFullPath, true);

            ExcelBus excelBiz = new ExcelBus();

            errorMsg = excelBiz.handleBenchmarkReportSheet(generateDate);
        }
Example #8
0
 private void button10_Click(object sender, EventArgs e)
 {
     string weekday = dateTimePicker1.Value.DayOfWeek.ToString();
     string generatedateday = dateTimePicker1.Value.ToString("yyyy-MM-dd");
     if (weekday == "Monday")
     {
     ReportBusiness rptBiz = new ReportBusiness();
     ExcelBus excelBiz = new ExcelBus();
     DateTime generatedate = dateTimePicker1.Value;
     rptBiz.GenerateDailyRptForMultiDays(generatedate);
     rptBiz.GenerateServiceRemedyGroupLevel(generatedate);
     excelBiz.PrepareFilesForDailyReport(generatedate);
     }
     else
     {
         MessageBox.Show(generatedateday + "不是星期一,请使用Process Daily Data按钮");
     }
 }
Example #9
0
        private void button15_Click(object sender, EventArgs e)
        {
            string weekday = dateTimePicker1.Value.DayOfWeek.ToString();

            if (weekday == "Monday")
            {
                ExcelBus excelbiz  = new ExcelBus();
                string   sheetName = excelbiz.GetFirstSheetName(textBox3.Text);
                DataSet  dsRemedy7 = excelbiz.getDataSetFromExcel(textBox3.Text, sheetName);
                _dba.ExecuteCommand("truncate table " + "CorpRemedy");
                _dba.InsertDataToDB(dsRemedy7, "CorpRemedy");
                MessageBox.Show("Insert CorpRemdy Successed!");
            }
            else
            {
                MessageBox.Show("请选择正确日期!");
            }
        }
Example #10
0
        private void button10_Click(object sender, EventArgs e)
        {
            string weekday         = dateTimePicker1.Value.DayOfWeek.ToString();
            string generatedateday = dateTimePicker1.Value.ToString("yyyy-MM-dd");

            if (weekday == "Monday")
            {
                ReportBusiness rptBiz       = new ReportBusiness();
                ExcelBus       excelBiz     = new ExcelBus();
                DateTime       generatedate = dateTimePicker1.Value;
                rptBiz.GenerateDailyRptForMultiDays(generatedate);
                rptBiz.GenerateServiceRemedyGroupLevel(generatedate);
                excelBiz.PrepareFilesForDailyReport(generatedate);
            }
            else
            {
                MessageBox.Show(generatedateday + "不是星期一,请使用Process Daily Data按钮");
            }
        }
Example #11
0
 private void button7_Click(object sender, EventArgs e)
 {
     if (dateTimePicker1.Value.DayOfWeek.ToString() == "Monday")
     {
         MessageBox.Show(dateTimePicker1.Value.ToString("yyyy-MM-dd") + "是星期一,请使用Generate MON Reports按钮");
     }
     else
     {
         ReportBusiness rptBiz       = new ReportBusiness();
         ExcelBus       excelBiz     = new ExcelBus();
         DateTime       generatedate = dateTimePicker1.Value;
         rptBiz.GenerateDailyRptForSingleDays(generatedate);
         //add for generate service remedy group level report to George
         rptBiz.GenerateServiceRemedyGroupLevel(generatedate);
         //end add by navy
         excelBiz.PrepareFilesForDailyReport(generatedate);
         //MessageBox.Show("Generate Daily Reports Success!");
     }
 }
Example #12
0
        public void ExecuteProcWithParam(string fileName, string[] procNames, string[] sheetNames, string[,] parameters, bool isTwoParas, DateTime generateDate)
        {
            string para;

            for (int i = 0; i < procNames.Length; i++)
            {
                try
                {
                    _sqlCon.Open();
                    _sqlCmd.CommandType = CommandType.StoredProcedure;
                    string ProcName = procNames[i].ToString();
                    _sqlCmd.CommandText = ProcName;
                    if (ProcName == "TriBenchMarkRpt_MatchedBacklog")//add if condition for benchmark report.
                    {
                        DateTime EndDay        = generateDate.AddDays(-2);
                        DateTime StartDay      = generateDate.AddDays(-8);
                        string   ParaEndDate   = EndDay.ToString("yyyy-MM-dd");
                        string   ParaStartDate = StartDay.ToString("yyyy-MM-dd");
                        _sqlCmd.Parameters.AddWithValue("@startDate", ParaStartDate);
                        _sqlCmd.Parameters.AddWithValue("@endDate", ParaEndDate);
                    }
                    else
                    {
                        if (isTwoParas)
                        {
                            for (int j = 0; j < 2; j++)
                            {
                                if (parameters[i, j] == "")
                                {
                                    ;
                                }
                                else
                                {
                                    if (j == 0)
                                    {
                                        para = "@diffn";
                                    }
                                    else
                                    {
                                        para = "@diffb";
                                    }
                                    _sqlCmd.Parameters.AddWithValue(para, Int32.Parse(parameters[i, j].ToString()));
                                }
                            }
                        }
                        else
                        {
                            for (int j = 0; j < 1; j++)
                            {
                                if (parameters[i, j] == "")
                                {
                                    ;
                                }
                                else
                                {
                                    if (j == 0)
                                    {
                                        para = "@diffn";
                                    }
                                    else
                                    {
                                        para = "@diffb";
                                    }
                                    _sqlCmd.Parameters.AddWithValue(para, Int32.Parse(parameters[i, j].ToString()));
                                }
                            }
                        }
                    }

                    _sqlDA.SelectCommand = _sqlCmd;
                    _sqlDA.Fill(_ds, ProcName);
                }
                catch (Exception e)
                {
                    throw e;
                }
                finally
                {
                    _sqlCmd.Parameters.Clear();
                    _sqlCon.Close();
                }
            }
            //filename1:the template file name
            ExcelBus excelBiz = new ExcelBus();

            excelBiz.ExportDataToExcel(fileName, procNames, sheetNames, _ds, generateDate);
        }
Example #13
0
 private void button15_Click(object sender, EventArgs e)
 {
     string weekday = dateTimePicker1.Value.DayOfWeek.ToString();
     if (weekday == "Monday")
     {
         ExcelBus excelbiz = new ExcelBus();
         string sheetName = excelbiz.GetFirstSheetName(textBox3.Text);
         DataSet dsRemedy7 = excelbiz.getDataSetFromExcel(textBox3.Text, sheetName);
         _dba.ExecuteCommand("truncate table " + "CorpRemedy");
         _dba.InsertDataToDB(dsRemedy7, "CorpRemedy");
         MessageBox.Show("Insert CorpRemdy Successed!");
     }
     else
     {
         MessageBox.Show("请选择正确日期!");
     }
 }
Example #14
0
        /// <summary>
        /// Generates daily reports for multiple days.
        /// </summary>
        /// <param name="generateDate"></param>
        /// <param name="ischecked"></param>
        public void GenerateDailyRptForMultiDays(DateTime generateDate)
        {
            DateTime todayDate      = DateTime.Now;
            int      delayDays      = (generateDate - todayDate).Days; //get number for store procedure parameter
            int      startDelayDays = delayDays - 2;                   //get number for store procedure parameter
            string   StartDateStr   = generateDate.AddDays(-3).ToString("yyyy-MM-dd");
            string   EndDateStr     = generateDate.AddDays(-1).ToString("yyyy-MM-dd");
            string   filename1W     = "Service and TricareDaily.xls";

            string[] sheetnameW = new string[5] {
                "ServiceMgRpt", "AssignedInAndOut_Service", "IM", "SR", "PM"
            };
            string[] ProcNamesW = new string[5] {
                "ServiceMgRptByNumbers"
                , "sp_TaskInAndOut_ServiceRPT"
                , "IMRpt_TricareForMulti"
                , "SRRpt_TricareForMulti"
                , "PBLMRpt_TricareForMulti"
            };
            string[,] ParamsW = new string[5, 2] {
                { delayDays.ToString(), startDelayDays.ToString() }
                , { "", "" }
                , { delayDays.ToString(), startDelayDays.ToString() }
                , { delayDays.ToString(), startDelayDays.ToString() }
                , { delayDays.ToString(), startDelayDays.ToString() }
            };
            //prds.ExecuteProcWithParam(filename1W, ProcNamesW, sheetnameW, ParamsW, ischecked);
            DBAccess dbAccess = new DBAccess();

            dbAccess.ExecuteProcWithParam(filename1W, ProcNamesW, sheetnameW, ParamsW, true, generateDate);

            //Annuity and Compensation daily reports
            string AEfilename = "Annuity and EBusiness.xls";

            string[] AEWorksheetName = new string[4] {
                "AnnuityRpt",
                "AnnuityStatus",
                "AnnuityFinal",
                "EBusinessRpt Grouped"
            };
            //Porcedure names and datatable names
            string[] AEProcName = new string[6] {
                "AnnuityRpt",                      //{1,1}
                "AnnuityOpenPeriod",               //{51,2}
                "AnnuityUrgent",                   //{61,2}
                "AnnuityStatus",                   //{1,1}
                "AnnuityStatusUrgent",             //{73,2}
                "EBusinessRpt"
            };                                     //{123,2}
            //Params of procedures
            string[,] AEParam = new string[6, 3] {
                { StartDateStr, EndDateStr, "1" },
                { StartDateStr, EndDateStr, "1" },
                { StartDateStr, EndDateStr, "1" },
                { "", "", "" },
                { "", "", "" },
                { StartDateStr, EndDateStr, "1" }
            };
            //Row number of excel when write the ds data into excel
            int[] sheetWriteStartRow = new int[6] {
                1, 89, 99, 1, 109, 2
            };

            DataSet  dsOfAE   = dbAccess.getDSByProcs(AEProcName, AEParam);
            ExcelBus excelBiz = new ExcelBus();

            excelBiz.AEExportDataToExcel(AEfilename, AEProcName, AEWorksheetName, dsOfAE, sheetWriteStartRow, generateDate);

            //EBusiness backlog tickets
            string[] ProcName = new string[1] {
                "getEBusinessData"
            };
            string[,] Param = new string[1, 1] {
                { "" }
            };
            string[] sheetnameE = new string[1] {
                "EBusiness Raw Data"
            };
            string filenameE = "EBusiness ticket.xls";

            dbAccess.ExecuteProcWithParam(filenameE, ProcName, sheetnameE, Param, false, generateDate);

            //Annuity backlog tickets
            string[] ProcNameAnnuity = new string[1] {
                "getAnnuityData"
            };
            string[,] ParamAnnuity = new string[1, 1] {
                { "" }
            };
            string[] sheetnameAnnuity = new string[1] {
                "Annuity Raw Data"
            };
            string filenameAnnuity = "Annuity ticket.xls";

            dbAccess.ExecuteProcWithParam(filenameAnnuity, ProcNameAnnuity, sheetnameAnnuity, ParamAnnuity, false, generateDate);
        }
Example #15
0
        public void ExecuteProcWithParam(string fileName, string[] procNames, string[] sheetNames, string[,] parameters, bool isTwoParas, DateTime generateDate)
        {
            string para;
            for (int i = 0; i < procNames.Length; i++)
            {
                try
                {
                    _sqlCon.Open();
                    _sqlCmd.CommandType = CommandType.StoredProcedure;
                    string ProcName = procNames[i].ToString();
                    _sqlCmd.CommandText = ProcName;
                    if (ProcName == "TriBenchMarkRpt_MatchedBacklog")//add if condition for benchmark report.
                    {
                        DateTime EndDay = generateDate.AddDays(-2);
                        DateTime StartDay = generateDate.AddDays(-8);
                        string ParaEndDate = EndDay.ToString("yyyy-MM-dd");
                        string ParaStartDate = StartDay.ToString("yyyy-MM-dd");
                        _sqlCmd.Parameters.AddWithValue("@startDate", ParaStartDate);
                        _sqlCmd.Parameters.AddWithValue("@endDate", ParaEndDate);
                    }
                    else
                    {
                        if (isTwoParas)
                        {
                            for (int j = 0; j < 2; j++)
                            {
                                if (parameters[i, j] == "")
                                {
                                    ;
                                }
                                else
                                {
                                    if (j == 0)
                                    {
                                        para = "@diffn";
                                    }
                                    else
                                    {
                                        para = "@diffb";
                                    }
                                    _sqlCmd.Parameters.AddWithValue(para, Int32.Parse(parameters[i, j].ToString()));
                                }
                            }
                        }
                        else
                        {
                            for (int j = 0; j < 1; j++)
                            {
                                if (parameters[i, j] == "")
                                {
                                    ;
                                }
                                else
                                {
                                    if (j == 0)
                                    {
                                        para = "@diffn";
                                    }
                                    else
                                    {
                                        para = "@diffb";
                                    }
                                    _sqlCmd.Parameters.AddWithValue(para, Int32.Parse(parameters[i, j].ToString()));
                                }
                            }
                        }
                    }

                    _sqlDA.SelectCommand = _sqlCmd;
                    _sqlDA.Fill(_ds, ProcName);
                }
                catch (Exception e)
                {
                    throw e;
                }
                finally
                {
                    _sqlCmd.Parameters.Clear();
                    _sqlCon.Close();
                }
            }
            //filename1:the template file name
            ExcelBus excelBiz = new ExcelBus();
            excelBiz.ExportDataToExcel(fileName, procNames, sheetNames, _ds, generateDate);
        }
Example #16
0
        /// <summary>
        /// Generates daily reports for multiple days.
        /// </summary>
        /// <param name="generateDate"></param>
        /// <param name="ischecked"></param>
        public void GenerateDailyRptForMultiDays(DateTime generateDate)
        {
            DateTime todayDate = DateTime.Now;
            int delayDays = (generateDate - todayDate).Days;//get number for store procedure parameter
            int startDelayDays = delayDays - 2;//get number for store procedure parameter
            string StartDateStr = generateDate.AddDays(-3).ToString("yyyy-MM-dd");
            string EndDateStr = generateDate.AddDays(-1).ToString("yyyy-MM-dd");
            string filename1W = "Service and TricareDaily.xls";
            string[] sheetnameW = new string[5] { "ServiceMgRpt", "AssignedInAndOut_Service", "IM", "SR", "PM" };
            string[] ProcNamesW = new string[5] {
                                                    "ServiceMgRptByNumbers"
                                                    , "sp_TaskInAndOut_ServiceRPT"
                                                    , "IMRpt_TricareForMulti"
                                                    , "SRRpt_TricareForMulti"
                                                    , "PBLMRpt_TricareForMulti" };
            string[,] ParamsW = new string[5, 2] {
                                                    { delayDays.ToString(), startDelayDays.ToString() }
                                                    , { "", "" }
                                                    , { delayDays.ToString(), startDelayDays.ToString() }
                                                    , { delayDays.ToString(), startDelayDays.ToString() }
                                                    , { delayDays.ToString(), startDelayDays.ToString() }
                                                };
            //prds.ExecuteProcWithParam(filename1W, ProcNamesW, sheetnameW, ParamsW, ischecked);
            DBAccess dbAccess = new DBAccess();
            dbAccess.ExecuteProcWithParam(filename1W, ProcNamesW, sheetnameW, ParamsW, true, generateDate);

            //Annuity and Compensation daily reports
            string AEfilename = "Annuity and EBusiness.xls";
            string[] AEWorksheetName = new string[4] {
                                                        "AnnuityRpt",
                                                        "AnnuityStatus" ,
                                                        "AnnuityFinal",
                                                        "EBusinessRpt Grouped"
                                                    };
            //Porcedure names and datatable names
            string[] AEProcName = new string[6] {
                                                    "AnnuityRpt",         //{1,1}
                                                    "AnnuityOpenPeriod",   //{51,2}
                                                    "AnnuityUrgent",  //{61,2}
                                                    "AnnuityStatus", //{1,1}
                                                    "AnnuityStatusUrgent" ,//{73,2}
                                                    "EBusinessRpt"
                                                }; //{123,2}
            //Params of procedures
            string[,] AEParam = new string[6, 3] {
                                                    { StartDateStr,EndDateStr , "1" },
                                                    { StartDateStr,EndDateStr, "1" },
                                                    { StartDateStr,EndDateStr, "1" },
                                                    {"","",""},
                                                    {"","",""},
                                                    { StartDateStr,EndDateStr, "1" }
                                                 };
            //Row number of excel when write the ds data into excel
            int[] sheetWriteStartRow = new int[6] { 1, 89, 99, 1, 109, 2 };

            DataSet dsOfAE = dbAccess.getDSByProcs(AEProcName, AEParam);
            ExcelBus excelBiz = new ExcelBus();
            excelBiz.AEExportDataToExcel(AEfilename, AEProcName, AEWorksheetName, dsOfAE, sheetWriteStartRow, generateDate);

            //EBusiness backlog tickets
            string[] ProcName = new string[1] { "getEBusinessData" };
            string[,] Param = new string[1, 1] { { "" } };
            string[] sheetnameE = new string[1] { "EBusiness Raw Data" };
            string filenameE = "EBusiness ticket.xls";
            dbAccess.ExecuteProcWithParam(filenameE, ProcName, sheetnameE, Param, false, generateDate);

            //Annuity backlog tickets
            string[] ProcNameAnnuity = new string[1] { "getAnnuityData" };
            string[,] ParamAnnuity = new string[1, 1] { { "" } };
            string[] sheetnameAnnuity = new string[1] { "Annuity Raw Data" };
            string filenameAnnuity = "Annuity ticket.xls";
            dbAccess.ExecuteProcWithParam(filenameAnnuity, ProcNameAnnuity, sheetnameAnnuity, ParamAnnuity, false, generateDate);
        }
Example #17
0
        /// <summary>
        /// Generates tricarte weekly report on Thursday.
        /// </summary>
        public void GenerateTricareWeeklyRpt(DateTime generateDate, out string errorMsg)
        {
            DateTime todayDate = DateTime.Now;
            int delayDays = (generateDate - todayDate).Days;//get number for store procedure parameter
            int startDelayDays = delayDays - 6;//get number for store procedure parameter
            string[] ProcNamesW = new string[4] { "IMRpt_TricareForMulti", "SRRpt_TricareForMulti", "PBLMRpt_TricareForMulti", "TriBenchMarkRpt_MatchedBacklog" };
            string[,] ParamsW = new string[3, 2] {
                                                    { delayDays.ToString(), startDelayDays.ToString() }
                                                    ,{ delayDays.ToString(), startDelayDays.ToString() }
                                                    ,{ delayDays.ToString(), startDelayDays.ToString() }
                                                 };//benchmark para add in ExecuteProcWithParam method
            string[] sheetnameW = new string[4] { "IM", "SR", "PM", "BenchMarkData" };
            string filename1W = "TRICATE Team Weekly-demo.xls";

            DBAccess dbAccess = new DBAccess();
            dbAccess.ExecuteProcWithParam(filename1W, ProcNamesW, sheetnameW, ParamsW, true, generateDate);

            DateTime EndDay = generateDate.AddDays(-1);
            DateTime StartDay = generateDate.AddDays(-7);

            string endDate = EndDay.ToString("yyyyMMdd");
            string startDate = StartDay.ToString("yyyyMMdd");
            string endDateShort = EndDay.ToString("MMdd");

            //TRICATE Team Weekly-demo.xls
            ExcelHelper excelHelper = new ExcelHelper();
            string sourceFilePath = finalReportsPath + endDate + @"\" + "TRICATE Team Weekly-demo-" + endDateShort + ".xls";
            string copyToPath = trackWeekly4Path + endDate;
            string copyToFullPath = copyToPath + @"\" + "TRICATE Team Weekly-" + startDate + "-" + endDate + ".xls";

            if (!Directory.Exists(copyToPath))
            {
                Directory.CreateDirectory(copyToPath);
            }
            File.Copy(sourceFilePath, copyToFullPath, true);

            ExcelBus excelBiz = new ExcelBus();
            errorMsg = excelBiz.handleBenchmarkReportSheet(generateDate);
        }
Example #18
0
        private void button17_Click(object sender, EventArgs e)
        {
            ExcelBus excelBiz = new ExcelBus();
            DateTime CorpTriWeeklygenerateDate = dateTimePicker1.Value;
            excelBiz.PrepareFilesForCorpTricareMonday(CorpTriWeeklygenerateDate);

            ReportBusiness rptBiz = new ReportBusiness();
            rptBiz.GenerateCorpTriMonday(CorpTriWeeklygenerateDate);
        }
Example #19
0
 private void button18_Click(object sender, EventArgs e)
 {
     string weekday = dateTimePicker1.Value.DayOfWeek.ToString();
     if (weekday == "Thursday")
     {
         DateTime TriWeeklygenerateDate = dateTimePicker1.Value;
         ExcelBus excelBiz = new ExcelBus();
         excelBiz.PrepareFilesForTricareRpt(TriWeeklygenerateDate);
         MessageBox.Show("Successed!");
     }
     else
     {
         MessageBox.Show("请选择正确日期!");
     }
 }
Example #20
0
 public Form1()
 {
     InitializeComponent();
     _dba = new DBAccess();
     _excel = new ExcelBus();
 }
Example #21
0
 private void button5_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == "")
     {
         MessageBox.Show("请选择文件!");
     }
     else
     {
         ExcelBus excelBiz = new ExcelBus();
         string excelPath = textBox3.Text;
         DataSet dsOpenTask = excelBiz.getDataSetFromExcel(excelPath, "Page1-1$");
         _dba.ExecuteCommand("truncate table TaskAssignedRaw");
         _dba.InsertTaskData(dsOpenTask);
         MessageBox.Show("Successed!");
     }
 }
Example #22
0
 private void button7_Click(object sender, EventArgs e)
 {
     if (dateTimePicker1.Value.DayOfWeek.ToString() == "Monday")
     {
         MessageBox.Show(dateTimePicker1.Value.ToString("yyyy-MM-dd") + "是星期一,请使用Generate MON Reports按钮");
     }
     else
     {
         ReportBusiness rptBiz = new ReportBusiness();
         ExcelBus excelBiz = new ExcelBus();
         DateTime generatedate = dateTimePicker1.Value;
         rptBiz.GenerateDailyRptForSingleDays(generatedate);
         //add for generate service remedy group level report to George
         rptBiz.GenerateServiceRemedyGroupLevel(generatedate);
         //end add by navy
         excelBiz.PrepareFilesForDailyReport(generatedate);
         //MessageBox.Show("Generate Daily Reports Success!");
     }
 }
Example #23
0
 private void button13_Click(object sender, EventArgs e)
 {
     string weekday = dateTimePicker1.Value.DayOfWeek.ToString();
     if (weekday == "Monday")
     {
         DateTime generatedate = dateTimePicker1.Value;
         ExcelBus excelBiz = new ExcelBus();
         excelBiz.PrepareFilesForRADTricareMonday(generatedate);
         ReportBusiness rptBiz = new ReportBusiness();
         rptBiz.GenerateTricareMonday(generatedate);
     }
     else {
         MessageBox.Show("请选择正确日期!");
     }
 }
Example #24
0
 public Form1()
 {
     InitializeComponent();
     _dba   = new DBAccess();
     _excel = new ExcelBus();
 }