Ejemplo n.º 1
0
        public ActionResult WindowSaveClick(string PanelID, string ParentVariable, string ChartType)
        {
            tblReportInfo mo = new tblReportInfo();     //mo.Create\Delflag\remark都已经有值了经过这一步

            mo.CreateDate = DateTime.Now;
            string[]      key       = { CookieKeys.ID, CookieKeys.USERGXID };
            List <string> sUserInfo = (new UserInfoManage()).GetLoginUserInfo(key);

            mo.UserID = Convert.ToInt64(sUserInfo[0]);
            mo.GxID   = Convert.ToInt64(sUserInfo[1]);
            GetParentVariable(ParentVariable);       //获取传过来的参数ParentVariable
            mo.ReportTypeID = Convert.ToInt16(ParentVar.transValue);



            if (!mo.HandleWay)
            {
                mo.HandleFlag = "尚未处理";
            }
            ReportInfoManage reInfoMan = new ReportInfoManage();
            //ReportManage reportMan = new ReportManage();
            long lNewID = reInfoMan.AddOneRecord(mo);

            //if (mo.HandleWay)
            //    reportMan.InportData(lNewID.ToString());

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

            GetParentVariable(ParentVariable);
            setParentVariable(ParentVar.areaName, ParentVar.controlName, ParentVar.actionName, lNewID.ToString(), ParentVar.KeyWords);
            SetHiddenValue(PanelID + "_ParentVariable", ParentVar.DefaultVal);

            string sScripts = "var i = 0; var sSelItems = \"\";var sSelTypeIDs = \"\";";

            sScripts += "while (i < App." + PanelID + "_NowItemsStore" + ".getCount()) { sSelTypeIDs = sSelTypeIDs + App." + PanelID + "_NowItemsStore" + ".getAt(i).get('TypeID') + \",\"; sSelItems = sSelItems + App." + PanelID + "_NowItemsStore" + ".getAt(i).get('ID') + \",\"; i++; }";
            sScripts += " sSelItems = sSelItems.slice(0, sSelItems.length - 1); sSelTypeIDs = sSelTypeIDs.slice(0, sSelTypeIDs.length - 1);";
            sScripts += "App.direct.UserControl.WinCreateReport_CreateReportDirectMethod(sSelItems,sSelTypeIDs,\"" + PanelID + "\",App." + PanelID + "_SelGxdm.getValue(),App." + PanelID + "_OperateStartYear.getValue(),App." + PanelID + "_OperateEndYear.getValue(),\"" + ParentVariable + "\",\"" + ChartType + "\",\"" + lNewID.ToString() + "\");";
            X.AddScript(sScripts);
            return(this.Direct());
        }
Ejemplo n.º 2
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());
        }