Files
BeWoPlaner/ReportService/Plugins/TimeSheetReportService.cs
Lyndon Jetten 9783999104 MoK:
Medikamentenlistenansicht ausgeblendet, wenn man nicht im Debug-Modus ist
5- und 7-tägige Ansicht implementiert

Fat-Client:
Das Ändern von Zeitelementen von Serienterminen ist nun möglich und es werden dabei auch keine Ausnahmen gelöscht.
2021-11-08 20:24:26 +01:00

69 lines
2.4 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using BeWo.Report;
using BeWo.Service.Plugins;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using DevExpress.XtraReports.UI;
namespace ReportingService.Plugins
{
public class TimeSheetReportService : AbstractIDSpecificDefaultClass<TimeSheetReportService>
{
public virtual string SendTimeSheetMail(TimeSheetStatusItemDC item, bool saveMailToDatabase)
{
try
{
var tss = PluginLoader.FindClass<TimeSheetService>();
var reportCreator = CreateReportCreator();
if (item.Customer != null && item.Customer.Count > 0 && item.Monat.HasValue && item.Employee != null)
{
//foreach (var cc in item.Customer)
//{
var report = reportCreator.CreateServiceOverviewSingleCustomerReport(0, item.Monat.Value.Month,
item.Monat.Value.Year, 0, item.Employee.EmployeeOid, null, 1,
DateTime.DaysInMonth(item.Monat.Value.Year, item.Monat.Value.Month));
var additionalReports = CreateAdditionalReports(item.Customer, reportCreator, item);
var result = tss.SendTimeSheetMail(item, saveMailToDatabase, report, additionalReports);
if (!String.IsNullOrWhiteSpace(result))
{
return result;
}
//}
}
}
catch (Exception e)
{
return e.Message;
}
return "";
}
public virtual Dictionary<string, XtraReport> CreateAdditionalReports(IList<CompactCustomerDC> cc, DefaultReportCreator reportCreator, TimeSheetStatusItemDC item)
{
return null;
}
private static DefaultReportCreator CreateReportCreator()
{
var reportCreator = PluginLoader.FindClass<DefaultReportCreator>();
reportCreator.Tenant = PluginLoader.Tenant;
#if DEBUG
reportCreator.ReportPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"bin\" + PluginLoader.Tenant + "_reports.dll");
#else
reportCreator.ReportPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Customer\" + PluginLoader.Tenant + "_reports.dll");
#endif
return reportCreator;
}
}
}