Beispiel #1
0
        public ActionResult WinCreateReport_CreateReportDirectMethod(string sSelItems, string sSelTypeIDs, string PanelID, string sGxID, string sStartYear, string sEndYear, string ParentVariable, string sChartType, string sID)
        {
            if (sSelItems == "")
            {
                X.Msg.Alert("注意!", "已选项不能为空!").Show();
                return(this.Direct());
            }

            ReportInfoManage man = new ReportInfoManage();
            tblReportInfo    mo  = man.GetOneRecordbyID <tblReportInfo, string>(sID);

            string GxName = "", FileName = "";
            DepartmentInfoManage Deman         = new DepartmentInfoManage();
            tblDepartmentInfo    model         = Deman.GetOneRecordbyID <tblDepartmentInfo, string>(sGxID); //获取数据库表中的一条记录

            if (model != null)
            {
                GxName = model.Name;
            }
            Expression <Func <tblReportType, bool> > where = (c => c.ID == mo.ReportTypeID && c.DelFlag == false);
            ReportTypeDataListManage reMan     = new ReportTypeDataListManage();
            List <tblReportType>     list      = reMan.GetRecord(where); //获取数据库表中的多条记录

            if (sEndYear == sStartYear)
            {
                FileName = GxName + sStartYear + "年" + list[0].Name;
            }
            else
            {
                FileName = GxName + sStartYear + "-" + sEndYear + "年" + list[0].Name;
            }
            mo.Name = FileName;

            ReportInfoDataListManage smpDlgMan = new ReportInfoDataListManage();

            string[] EditColumn                = { "Name" };
            long     nNewID                    = smpDlgMan.SaveOneSimpleRecord(mo, null, EditColumn);

            SetHiddenValue(PanelID + "_ExitCode", "1");

            switch (mo.ReportTypeID)
            {
            case 1:
                JHReportManage JHReport = new JHReportManage();
                JHReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID);
                break;

            case 2:
                LQReportManage LQReport = new LQReportManage();
                LQReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID);
                break;

            case 3:
                if (!sSelTypeIDs.Contains("pcdmTable"))
                {
                    X.Msg.Alert("注意", "招生批次必须选择,生成报表失败!").Show();
                    return(this.Direct());
                }
                PCReportManage PCReport = new PCReportManage();
                PCReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID);
                break;

            case 4:
                if (!sSelTypeIDs.Contains("Department"))
                {
                    X.Msg.Alert("注意", "院系必须选择,生成报表失败!").Show();
                    return(this.Direct());
                }
                DYZYReportManage DYZYReport = new DYZYReportManage();
                DYZYReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID);
                break;

            //    case "5":
            //FSReportManage FSReport = new FSReportManage();
            //FSReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType);
            //        break;
            case 6:
                SYDReportManage SYDReport = new SYDReportManage();
                SYDReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID);
                break;

            case 7:
                FSReportManage FSReport = new FSReportManage();
                FSReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sStartYear, sEndYear, sChartType, mo.ReportTypeID);
                break;
            }

            //JHReportManage manReport = new JHReportManage();
            //manReport.CreateReport(sSelItems, sSelTypeIDs, sID, sGxID, sYear);


            //SetHiddenValue(PanelID + "_ExitCode", "1");


            return(this.Direct());
        }