public override ActionResult DataList_ReturnExportClick(string PanelID, string selection = "") { if (selection == "") { X.Msg.Alert("注意", "请先选择需要导出的报表!").Show(); return(this.Direct()); } else { ReportInfoDataListManage man = new ReportInfoDataListManage(); List <tblReportInfo> model = man.GetSpecialModelFromCurrentSelection(selection); if ((model != null) && (model.Count > 0)) { string sAddress = ConstAddressPath.REPORT_WEBPATH; string sWholeFileName = sAddress + model[0].ID + ".xls"; FileManager clsFile = new FileManager(); if (clsFile.HasFile(sWholeFileName)) { clsFile.DownloadFile(sWholeFileName, model[0].Name + ".xls"); } else { X.Msg.Alert("注意", "该报表未正确生成,请重新生成后再下载...").Show(); DataList_ReturnDeleteClick(PanelID, selection, null, null); return(this.Direct()); } } DirectResult result = new DirectResult(); result.IsUpload = true; return(result); } }
public ActionResult WindowSaveClick(tblReportInfo mo, string PanelID, string ParentVariable) { GetParentVariable(ParentVariable); ReportInfoDataListManage smpDlgMan = new ReportInfoDataListManage(); string[] EditColumn = { "Name", "Remark" }; long nNewID = smpDlgMan.SaveOneSimpleRecord(mo, null, EditColumn); SetHiddenValue(PanelID + "_ExitCode", "1"); return(this.Direct()); }
public override ActionResult WindowCommonShow(string PanelID, string ParentVariable, string ParentKey) { GetParentVariable(ParentVariable); ReportInfoDataListManage man = new ReportInfoDataListManage(); man.InitSelection(ParentVar.transValue); tblReportInfo model = man.GetSpecialModelFromCurrentID(man.sRowNowID); var form = this.GetCmp <FormPanel>(PanelID + "_Form"); form.SetValues(model); return(this.Direct()); }
public override ActionResult DataList_ReturnDeleteClick(string PanelID, string selection, string keywords, string transvalue) { ReportInfoDataListManage man = new ReportInfoDataListManage(); List <tblReportInfo> model = man.GetSpecialModelFromCurrentSelection(selection); if ((model != null) && (model.Count > 0)) { for (int c = 0; c < model.Count; c++) { man.DeleteRecord(model[c]); FileManager fileMan = new FileManager(); //fileMan.DelOneFile(ConstAddressPath.REPORT_WEBPATH + model[0].Name+"("+model[0].ID+")"+".xlsx"); fileMan.DelOneFile(ConstAddressPath.REPORT_WEBPATH + model[c].ID + ".xls"); RefreashDataList(PanelID); } } return(this.Direct()); }
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()); }