Exemple #1
0
        public void TestGetDepartmentReportViewModelByBuild_Date_YY()
        {
            DateTime today = DateTime.Now;
            DepartmentReportService   service         = new DepartmentReportService();
            DepartmentReportViewModel reportViewModel = service.GetViewModel("000001G001", "2018", "YY");

            Console.WriteLine(UtilTest.GetJson(reportViewModel));
        }
Exemple #2
0
        public void TestGetDepartmentReportViewModelByUser()
        {
            DateTime today = DateTime.Now;
            DepartmentReportService   service         = new DepartmentReportService();
            DepartmentReportViewModel reportViewModel = service.GetViewModel("admin");

            Console.WriteLine(UtilTest.GetJson(reportViewModel));
        }
Exemple #3
0
        public FileResult GetExcel(string buildId, string energyCode, string departmentIDs, string date, string type)
        {
            string[] formulars = departmentIDs.Split(',');

            string basePath = HttpContext.Server.MapPath("~/App_Data/");
            //CircuitReportService service = new CircuitReportService();
            DepartmentReportService service = new DepartmentReportService();
            Excel excel = service.ExportReportToExcel(basePath, buildId, energyCode, formulars, date, type);

            return(File(excel.Data, "application/ms-excel", excel.Name));
        }
Exemple #4
0
        public void TestGetDepartmentReportViewModelByBuild_Date_YY2()
        {
            DateTime today = DateTime.Now;

            string[] departmentIDs          = { "D000001G001001", "D000001G001002", "D000001G001003" };
            DepartmentReportService service = new DepartmentReportService();

            DepartmentReportViewModel reportViewModel = service.GetViewModel("01000", departmentIDs, today.ToString(), "YY");

            Console.WriteLine(UtilTest.GetJson(reportViewModel));
        }