public static List <ReportTypeItem> GetDefaultReportItems(ReportNameEnum name) { if (ReportTypeData.ContainsKey(name)) { return(ReportTypeData[name]); } else { return(new List <ReportTypeItem>()); } }
public static ReportType GetDefaultReportType(ReportNameEnum typesName) { if (ReportTypeData.ContainsKey(typesName)) { var item = ReportTypeData[typesName]; return(new ReportType(typesName, item)); } else { throw (new Exception("找不到" + typesName + "的报告类型")); } }
public bool ExportItemExcel(string path, ReportNameEnum reportType, DateTime selectedMonth) { var excelFile = Resource.采购申请表; //包含多个tab using (ExcelPackage newpackage = new ExcelPackage()) { if (reportType == ReportNameEnum.物品盘点) { using (var templateStream = new MemoryStream(excelFile)) { using (ExcelPackage package = new ExcelPackage(templateStream)) { var template = package.Workbook.Worksheets[ReportNameEnum.物品盘点.ToString()]; GenerateItemSummarySheet(template, true); //显示Position newpackage.Workbook.Worksheets.Add("物品盘点(库位)", template); var templateWithImage = newpackage.Workbook.Worksheets["物品盘点(库位)"]; InsertImageToItemSummarySheet(templateWithImage, true); } } using (var templateStream = new MemoryStream(excelFile)) { using (ExcelPackage package = new ExcelPackage(templateStream)) { var template = package.Workbook.Worksheets[ReportNameEnum.物品盘点.ToString()]; GenerateItemSummarySheet(template, false); //显示上限下限 newpackage.Workbook.Worksheets.Add("物品盘点(库存上下限)", template); //var templateWithImage = newpackage.Workbook.Worksheets["物品盘点(库存上下限)"]; //InsertImageToItemSummarySheet(templateWithImage, false); } } } try { FileInfo file = new FileInfo(path); newpackage.SaveAs(file); return(true); } catch (Exception e) { var msg = e.Message; return(false); } } }
public ReportType(ReportNameEnum name, List <ReportTypeItem> items) { Name = name; RegistReports = new EFSeriousStringCollection(items.Select(x => x.ID).ToList()); }
public ReportType(ReportNameEnum name, List <string> ids) { Name = name; RegistReports = new EFSeriousStringCollection(ids); }