56 lines
2.1 KiB
C#
56 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Report;
|
|
using BeWo.Report.DefaultReports;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Service.DCEntityMapper;
|
|
using BeWo.Service.Invoicing;
|
|
using BeWo.Service.Plugins;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.Compact;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace Simmering
|
|
{
|
|
public class CustomReportCreator : DefaultReportCreator
|
|
{
|
|
|
|
public override XtraReport CreateCustomerDataReport(long customerOid)
|
|
{
|
|
XtraReport allReports;
|
|
var lCustomerDataReport = FindReportImp<CustomerDataRO>();
|
|
lCustomerDataReport.SetReportDataSource(CustomerDataRO.Create(MapperFactory.CustomerDC_Customer.MapToNewDC(DAOFactory.GenericDAO.LoadByID<Customer>(customerOid))));
|
|
allReports = lCustomerDataReport as XtraReport;
|
|
allReports.CreateDocument();
|
|
|
|
// sofern vorhanden Medikamentenverodnungsliste und Bedarfsmedikamente
|
|
var c = DAOFactory.GenericDAO.LoadByID<Customer>(customerOid);
|
|
var mvl = c.Medikamentenverordnungslisten.Where(mv => mv.Gueltig && !mv.MedListType).FirstOrDefault();
|
|
if (mvl != null)
|
|
{
|
|
var anhang = FindReportImp<MedVerListRO>();
|
|
anhang.SetReportDataSource(MedVerListRO.Create(mvl.Oid));
|
|
var anhangReport = anhang as XtraReport;
|
|
anhangReport.CreateDocument();
|
|
allReports.Pages.AddRange(anhangReport.Pages);
|
|
}
|
|
var mbl = c.Medikamentenverordnungslisten.Where(mv => mv.Gueltig && mv.MedListType).FirstOrDefault();
|
|
if (mbl != null)
|
|
{
|
|
var anhang = FindReportImp<MedVerListRO>();
|
|
anhang.SetReportDataSource(MedVerListRO.Create(mbl.Oid));
|
|
var anhangReport = anhang as XtraReport;
|
|
anhangReport.CreateDocument();
|
|
allReports.Pages.AddRange(anhangReport.Pages);
|
|
}
|
|
return allReports;
|
|
}
|
|
}
|
|
}
|