43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using BeWo.Service.Core;
|
|
using BeWo.Service.Plugins;
|
|
using BS.Shared.Extensions;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Mittelpunkt.Export
|
|
{
|
|
public class CustomDataExporter : DataExporter
|
|
{
|
|
public override string CreateExportString(string pFileID, string[] pHeaderCaption, string[][] pContent)
|
|
{
|
|
// Die wollen bei Mitarbeiter-Auswertung der Stundenübersicht in jeder Spalte den MA-Namen haben, nicht nur in der ersten.
|
|
// Also in leeren Zellen den vorherigen Mitarbeiternamen reinsetzen
|
|
if (pHeaderCaption != null && pHeaderCaption.Length > 0 && pHeaderCaption[0].ToLower().Contains("mitarbeiter"))
|
|
{
|
|
string letzterMA = "";
|
|
foreach (var item in pContent)
|
|
{
|
|
if (!item[0].IsNullOrEmpty())
|
|
{
|
|
letzterMA = item[0];
|
|
}
|
|
else
|
|
{
|
|
item[0] = letzterMA;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (pHeaderCaption != null && pHeaderCaption.Length > 0 && pHeaderCaption[0].Contains("Diamant"))
|
|
{
|
|
return DiamantExporter.CreateExportString(pHeaderCaption, pContent);
|
|
}
|
|
return WriteHTMLFile(pHeaderCaption, pContent);
|
|
|
|
}
|
|
}
|
|
}
|