using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BeWo.Service.DCEntityMapper;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using DevExpress.XtraReports.UI;

namespace VkmHamm
{
	public class VkmHammReportCreator : DefaultReportCreator
	{
		public override XtraReport CreateFlsReport(string flsReportId, string subType)
		{
			string flsReportPath = Path.Combine(TempPath, flsReportId + ".xml");
			var lFLSAnalysisDataReportDC = Utils.XMLDeserialize<FLSAnalysisDataReportDC>(flsReportPath);


			IBeWoReport<FLSReportRO> lFLSReportObject = null;

			if (lFLSAnalysisDataReportDC.ReportType == 0)
			{
				lFLSReportObject = new Mitarbeiterstunden();
			}
			else
			{
				lFLSReportObject = this.FindReportImp<FLSReportRO>(lFLSAnalysisDataReportDC.ShowGroups
					? "FLSAuswertung"
					: "Leistungsdokumentation");
			}

			lFLSReportObject.SetReportDataSource(FLSReportRO.Create(lFLSAnalysisDataReportDC));
			return lFLSReportObject as XtraReport;
		}

		
	}
}
