diff --git a/BeWo/View/Detail/Report/FlexibleReportView.xaml b/BeWo/View/Detail/Report/FlexibleReportView.xaml
index 1eb1efdfc..2968b2d67 100644
--- a/BeWo/View/Detail/Report/FlexibleReportView.xaml
+++ b/BeWo/View/Detail/Report/FlexibleReportView.xaml
@@ -8,50 +8,78 @@
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxpg="http://schemas.devexpress.com/winfx/2008/xaml/pivotgrid" x:Class="BeWo.View.Detail.Report.FlexibleReportView"
- Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
+ xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
+ xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
+ Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Focusable="True">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs b/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs
index 328678675..fd1a2039e 100644
--- a/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs
+++ b/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs
@@ -22,201 +22,333 @@ using BS.Shared.Translation;
using DevExpress.Xpf.Core;
using DevExpress.Xpf.Printing;
using DevExpress.Xpf.PivotGrid;
+using DevExpress.Xpf.Charts;
namespace BeWo.View.Detail.Report
{
- ///
- /// Interaction logic for FlexibleReportView.xaml
- ///
- public partial class FlexibleReportView : BeWoView
- {
- public FlexibleReportView()
- {
- InitializeComponent();
+ ///
+ /// Interaction logic for FlexibleReportView.xaml
+ ///
+ public partial class FlexibleReportView : BeWoView
+ {
+ public FlexibleReportView()
+ {
+ InitializeComponent();
- FlexibleAnzahlMinIst.CellFormat = "{0:N0}";
- FlexibleAnzahlStdIst.CellFormat = "{0:N2}";
+ FlexibleAnzahlMinIst.CellFormat = "{0:N0}";
+ FlexibleAnzahlStdIst.CellFormat = "{0:N2}";
- FlexibleAnzahlMinSoll.CellFormat = "{0:N0}";
- FlexibleAnzahlStdSoll.CellFormat = "{0:N2}";
+ FlexibleAnzahlMinSoll.CellFormat = "{0:N0}";
+ FlexibleAnzahlStdSoll.CellFormat = "{0:N2}";
- FlexibleKlient.TotalValueFormat = "{0}";
- FlexibleMitarbeiter.TotalValueFormat = "{0}";
- FlexibleLeistung.TotalValueFormat = "{0}";
- FlexibleLeistungskategorie.TotalValueFormat = "{0}";
+ FlexibleKlient.TotalValueFormat = "{0}";
+ FlexibleMitarbeiter.TotalValueFormat = "{0}";
+ FlexibleLeistung.TotalValueFormat = "{0}";
+ FlexibleLeistungskategorie.TotalValueFormat = "{0}";
+ datePickerStartDate.DateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
+ datePickerEndDate.DateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1);
- datePickerStartDate.DateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
- datePickerEndDate.DateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1);
- }
+ checkBoxChart.IsEnabled = false;
+ }
- private void buttonRefresh_Click(object sender, RoutedEventArgs e)
- {
- if (GridControl.Visibility == Visibility.Hidden)
- GridControl.Visibility = Visibility.Visible;
+ private void buttonRefresh_Click(object sender, RoutedEventArgs e)
+ {
+ var test = ChartControl.DataSource;
- var filter = new FlexibleReportFilterDC()
- {
- StartDatum = datePickerStartDate.DateTime,
- EndDatum = datePickerEndDate.DateTime
- };
+ if (myPivotGridControl.Visibility == Visibility.Hidden)
+ myPivotGridControl.Visibility = Visibility.Visible;
- ServiceFacade.DoOperationsServiceAsync(
- s => s.GetAllFlexibleReportEntrys(filter),
- r =>
- {
- this.Dispatch(delegate
- {
- var liste = new List();
- foreach (var item in r)
- {
- liste.Add(FlexibleReportEntry.InitByFlexibleReportEntryDC(item));
- }
- GridControl.DataSource = liste;
- });
- });
- }
+ var filter = new FlexibleReportFilterDC()
+ {
+ StartDatum = datePickerStartDate.DateTime,
+ EndDatum = datePickerEndDate.DateTime,
+ NullDaten = checkNullEntries.IsChecked.Value
+ };
- private void GridControl_CustomCellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
- {
- if (e.DataField.Name == "FlexibleAnzahlStdSoll")
- {
- if (e.RowField != null && (e.RowField.Name == "FlexibleLeistungskategorie" || e.RowField.Name == "FlexibleLeistung"))
- {
- e.DisplayText = "";
- }
- }
- if (e.Value != null && decimal.TryParse(e.Value.ToString(), out decimal d) && d == 0)
- e.DisplayText = "";
- }
+ ServiceFacade.DoOperationsServiceAsync(
+ s => s.GetAllFlexibleReportEntrys(filter),
+ r =>
+ {
+ this.Dispatch(delegate
+ {
+ var liste = new List();
+ foreach (var item in r)
+ {
+ liste.Add(FlexibleReportEntry.InitByFlexibleReportEntryDC(item));
+ }
+ myPivotGridControl.DataSource = liste;
+ checkBoxChart.IsEnabled = true;
+ });
+ });
+ }
- private void GridControl_CustomFieldValueCells(object sender, PivotCustomFieldValueCellsEventArgs e)
- {
- PivotGridControl pivot = (PivotGridControl)sender;
+ private void InitChart()
+ {
+ ChartControl.Diagram = ChartFactory.GenerateDiagram(typeof(BarStackedSeries2D), false);
+ }
- if (pivot.DataSource == null)
- return;
+ private void GridControl_CustomCellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
+ {
+ if (e.DataField.Name == "FlexibleAnzahlStdSoll")
+ {
+ if (e.RowField != null && (e.RowField.Name == "FlexibleLeistungskategorie" || e.RowField.Name == "FlexibleLeistung"))
+ {
+ e.DisplayText = "";
+ }
+ }
+ if (e.Value != null && decimal.TryParse(e.Value.ToString(), out decimal d) && d == 0)
+ e.DisplayText = "";
+ }
- // Iterates through all row headers.
- for (int i = e.GetCellCount(false) - 1; i >= 0; i--)
- {
- var cell = e.GetCell(false, i);
- if (cell == null)
- continue;
+ private void GridControl_CustomFieldValueCells(object sender, PivotCustomFieldValueCellsEventArgs e)
+ {
+ PivotGridControl pivot = (PivotGridControl)sender;
- if (cell.ValueType == FieldValueType.Total)
- {
+ if (pivot.DataSource == null)
+ return;
- }
+ // Iterates through all row headers.
+ for (int i = e.GetCellCount(false) - 1; i >= 0; i--)
+ {
+ var cell = e.GetCell(false, i);
+ if (cell == null)
+ continue;
- // If the current header corresponds to the "Employee B"
- // field value, and is not the Total Row header,
- // it is removed with all corresponding rows.
- if (Equals(cell.Value, null) && cell.ValueType == FieldValueType.Value)
- e.Remove(cell);
- if (string.IsNullOrWhiteSpace(cell.DisplayText) && cell.ValueType == FieldValueType.Total)
- e.Remove(cell);
- }
- }
- }
+ if (cell.ValueType == FieldValueType.Total)
+ {
- public class FlexibleReportEntry
- {
- public string Customer { get; set; }
+ }
- public string Employee { get; set; }
+ // If the current header corresponds to the "Employee B"
+ // field value, and is not the Total Row header,
+ // it is removed with all corresponding rows.
+ if (Equals(cell.Value, null) && cell.ValueType == FieldValueType.Value)
+ e.Remove(cell);
+ if (string.IsNullOrWhiteSpace(cell.DisplayText) && cell.ValueType == FieldValueType.Total)
+ e.Remove(cell);
+ }
+ }
- public string Team { get; set; }
+ private void CheckChartChanged(object sender, RoutedEventArgs e)
+ {
+ if(myPivotGridControl.DataSource != null)
+ {
+ ChartControl.Visibility = checkBoxChart.IsChecked.Value ? Visibility.Visible : Visibility.Collapsed;
+ if (ChartControl.Visibility == Visibility.Visible)
+ {
+ InitChart();
+ }
+ }
+ }
+ }
- public string Leistungskategorie { get; set; }
+ public class FlexibleReportEntry
+ {
+ public string Customer { get; set; }
- public string Leistung { get; set; }
+ public string Employee { get; set; }
- public string SupportConcept { get; set; }
+ public string Team { get; set; }
- public decimal AnzahlMinutenIst { get; set; }
+ public string Leistungskategorie { get; set; }
- public decimal AnzahlStundenIst
- {
- get
- {
- return AnzahlMinutenIst / 60;
- }
- }
+ public string Leistung { get; set; }
- public decimal? AnzahlMinutenSoll { get; set; }
+ public string SupportConcept { get; set; }
- public decimal? AnzahlStundenSoll
- {
- get
- {
- if (EintraegeProTag == 0)
- {
- return AnzahlMinutenSoll / 60;
- }
- return AnzahlMinutenSoll / 60 / EintraegeProTag;
- }
- }
+ public decimal AnzahlMinutenIst { get; set; }
- public DateTime Datum { get; set; }
+ public decimal AnzahlStundenIst
+ {
+ get
+ {
+ return AnzahlMinutenIst / 60;
+ }
+ }
- public int EintraegeProTag { get; set; }
+ public decimal? AnzahlMinutenSoll { get; set; }
- public FlexibleReportEntryType Type { get; set; }
+ public decimal? AnzahlStundenSoll
+ {
+ get
+ {
+ if (EintraegeProTag == 0)
+ {
+ return AnzahlMinutenSoll / 60;
+ }
+ return AnzahlMinutenSoll / 60 / EintraegeProTag;
+ }
+ }
- public int? Kilometer { get; set; }
+ public DateTime Datum { get; set; }
- public static FlexibleReportEntry InitByFlexibleReportEntryDC(FlexibleReportEntryDC entryDC)
- {
- var returnValue = new FlexibleReportEntry()
- {
- AnzahlMinutenIst = entryDC.AnzahlMinuten,
- Datum = entryDC.Datum,
- //Klient = entryDC.Customer == null ? "" : string.Format("{0}, {1}", entryDC.Customer.LastName, entryDC.Customer.FirstName),
- SupportConcept = entryDC.SupportConcept == null ? "" : string.Format("{0:dd.MM.yyyy} - {1:dd.MM.yyyy}", entryDC.SupportConcept.StartDate, entryDC.SupportConcept.EndDate),
- Leistung = entryDC.Leistung,
- Leistungskategorie = entryDC.Leistungskategorie,
- //Mitarbeiter = entryDC.Employee == null ? "" : string.Format("{0}, {1}", entryDC.Employee.LastName, entryDC.Employee.FirstName),
- Team = entryDC.Team,
- AnzahlMinutenSoll = entryDC.AnzahlMinutenSoll,
- EintraegeProTag = entryDC.EintraegeProTag,
- Type = entryDC.Type,
- Kilometer = entryDC.Kilometer
- };
+ public int EintraegeProTag { get; set; }
- if (entryDC.Customer == null)
- {
- if (entryDC.Type == FlexibleReportEntryType.FullEntry)
- {
- returnValue.Customer = "";
- }
- else
- {
- returnValue.Customer = null;
- }
- }
- else
- {
- returnValue.Customer = string.Format("{0}, {1}", entryDC.Customer.LastName, entryDC.Customer.FirstName);
- }
+ public FlexibleReportEntryType Type { get; set; }
- if (entryDC.Employee == null)
- {
- if (entryDC.Type == FlexibleReportEntryType.FullEntry)
- {
- returnValue.Employee = "";
- }
- else
- {
- returnValue.Employee = null;
- }
- }
- else
- {
- returnValue.Employee = string.Format("{0}, {1}", entryDC.Employee.LastName, entryDC.Employee.FirstName);
- }
+ public int? Kilometer { get; set; }
- return returnValue;
- }
- }
+ public static FlexibleReportEntry InitByFlexibleReportEntryDC(FlexibleReportEntryDC entryDC)
+ {
+ var returnValue = new FlexibleReportEntry()
+ {
+ AnzahlMinutenIst = entryDC.AnzahlMinuten,
+ Datum = entryDC.Datum,
+ SupportConcept = entryDC.SupportConcept == null ? "" : string.Format("{0:dd.MM.yyyy} - {1:dd.MM.yyyy}", entryDC.SupportConcept.StartDate, entryDC.SupportConcept.EndDate),
+ Leistung = entryDC.Leistung,
+ Leistungskategorie = entryDC.Leistungskategorie,
+ Team = entryDC.Team,
+ AnzahlMinutenSoll = entryDC.AnzahlMinutenSoll,
+ EintraegeProTag = entryDC.EintraegeProTag,
+ Type = entryDC.Type,
+ Kilometer = entryDC.Kilometer
+ };
+
+ if (entryDC.Customer == null)
+ {
+ if (entryDC.Type == FlexibleReportEntryType.ServiceRecordEntry)
+ {
+ returnValue.Customer = "";
+ }
+ else
+ {
+ returnValue.Customer = null;
+ }
+ }
+ else
+ {
+ returnValue.Customer = string.Format("{0}, {1}", entryDC.Customer.LastName, entryDC.Customer.FirstName);
+ }
+
+ if (entryDC.Employee == null)
+ {
+ if (entryDC.Type == FlexibleReportEntryType.ServiceRecordEntry)
+ {
+ returnValue.Employee = "";
+ }
+ else
+ {
+ returnValue.Employee = null;
+ }
+ }
+ else
+ {
+ returnValue.Employee = string.Format("{0}, {1}", entryDC.Employee.LastName, entryDC.Employee.FirstName);
+ }
+
+ return returnValue;
+ }
+
+ public override string ToString()
+ {
+ return "'" + Employee + " -> " + Customer;
+ }
+ }
+
+ internal static class ChartFactory
+ {
+ static readonly Type XYDiagram2DType = typeof(XYDiagram2D);
+ static readonly Type XYDiagram3DType = typeof(XYDiagram3D);
+ static readonly Type SimpleDiagram3DType = typeof(SimpleDiagram3D);
+ static readonly Type SimpleDiagram2DType = typeof(SimpleDiagram2D);
+ static readonly Type DefaultSeriesType = typeof(BarStackedSeries2D);
+
+ static Dictionary seriesTypes;
+ public static Dictionary SeriesTypes
+ {
+ get
+ {
+ if (seriesTypes == null)
+ seriesTypes = CreateSeriesTypes();
+ return seriesTypes;
+ }
+ }
+ static Dictionary CreateSeriesTypes()
+ {
+ Dictionary seriesTypes = new Dictionary();
+ seriesTypes.Add(typeof(AreaFullStackedSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText = "Area Full-Stacked Series 2D" });
+ seriesTypes.Add(typeof(AreaSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText="Area Series 2D" });
+ seriesTypes.Add(typeof(AreaStackedSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText="Area Stacked Series 2D" });
+ seriesTypes.Add(typeof(BarFullStackedSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText="Bar Full-Stacked Series 2D" });
+ seriesTypes.Add(typeof(BarStackedSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText="Bar Stacked Series 2D" });
+ seriesTypes.Add(typeof(LineSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText="Line Series 2D" });
+ seriesTypes.Add(typeof(PointSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText = "Point Series 2D" });
+ seriesTypes.Add(typeof(AreaSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText="Area Series 3D" });
+ seriesTypes.Add(typeof(AreaStackedSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText="Area Stacked Series 3D" });
+ seriesTypes.Add(typeof(AreaFullStackedSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText="Area Full-Stacked Series 3D" });
+ seriesTypes.Add(typeof(BarSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText="Bar Series 3D" });
+ seriesTypes.Add(typeof(PointSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText="Point Series 3D" });
+ seriesTypes.Add(typeof(PieSeries3D), new SeriesTypeDescriptor { DiagramType = SimpleDiagram3DType, DisplayText="Pie Series 3D" });
+ seriesTypes.Add(typeof(PieSeries2D), new SeriesTypeDescriptor { DiagramType = SimpleDiagram2DType, DisplayText = "Pie Series 2D" });
+ return seriesTypes;
+ }
+
+ public class SeriesTypeDescriptor
+ {
+ public Type DiagramType { get; set; }
+ public string DisplayText { get; set; }
+ }
+
+ public static Diagram GenerateDiagram(Type seriesType, bool? showPointsLabels)
+ {
+ Series seriesTemplate = CreateSeriesInstance(seriesType);
+ Diagram diagram = CreateDiagramBySeriesType(seriesType);
+ if (diagram is XYDiagram2D)
+ PrepareXYDiagram2D(diagram as XYDiagram2D);
+ if (diagram is XYDiagram3D)
+ PrepareXYDiagram3D(diagram as XYDiagram3D);
+ if (diagram is Diagram3D)
+ ((Diagram3D)diagram).RuntimeRotation = true;
+ diagram.SeriesDataMember = "Series";
+ seriesTemplate.ArgumentDataMember = "Arguments";
+ seriesTemplate.ValueDataMember = "Values";
+ if (seriesTemplate.Label == null)
+ seriesTemplate.Label = new SeriesLabel();
+ seriesTemplate.LabelsVisibility = showPointsLabels == true;
+ if (seriesTemplate is PieSeries2D || seriesTemplate is PieSeries3D)
+ {
+ seriesTemplate.LegendTextPattern = "{A}";
+ seriesTemplate.Label.TextPattern = "{A}: {VP:P0}";
+ }
+ else
+ {
+ seriesTemplate.LegendTextPattern = "{A}: {V:G}";
+ seriesTemplate.ShowInLegend = true;
+ }
+ diagram.SeriesTemplate = seriesTemplate;
+ return diagram;
+ }
+ static void PrepareXYDiagram2D(XYDiagram2D diagram)
+ {
+ if (diagram == null)
+ return;
+ diagram.AxisX = new AxisX2D();
+ diagram.AxisX.Label = new AxisLabel();
+ diagram.AxisX.Label.Staggered = true;
+ }
+ static void PrepareXYDiagram3D(XYDiagram3D diagram)
+ {
+ if (diagram == null)
+ return;
+ diagram.AxisX = new AxisX3D();
+ diagram.AxisX.Label = new AxisLabel();
+ diagram.AxisX.Label.Visible = false;
+ }
+ public static Series CreateSeriesInstance(Type seriesType)
+ {
+ Series series = (Series)Activator.CreateInstance(seriesType);
+ ISupportTransparency supportTransparency = series as ISupportTransparency;
+ if (supportTransparency != null)
+ {
+ bool flag = series is AreaSeries2D || series is AreaSeries3D;
+ supportTransparency.Transparency = flag ? 0.4 : 0;
+ }
+ return series;
+ }
+ static Diagram CreateDiagramBySeriesType(Type seriesType)
+ {
+ return (Diagram)Activator.CreateInstance(SeriesTypes[seriesType].DiagramType);
+ }
+ }
}
diff --git a/Service/ServiceImplementations/OperationsServiceImp.cs b/Service/ServiceImplementations/OperationsServiceImp.cs
index ce414440e..265525f9e 100644
--- a/Service/ServiceImplementations/OperationsServiceImp.cs
+++ b/Service/ServiceImplementations/OperationsServiceImp.cs
@@ -39,13 +39,13 @@ namespace BeWo.Service.ServiceImplementations
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
public class OperationsServiceImp : IOperationsService
{
-
+
public Mandator GetMandatorEntity()
{
return AppSettings.GetMandatorEntity();
}
-
-
+
+
public void DeactivateInvoices(List pInvoices)
{
@@ -356,7 +356,7 @@ namespace BeWo.Service.ServiceImplementations
}
var creator = factory.CreateSettlementInvoiceCreator(costBearer.ID, tenant, lCb2Sc);
-
+
var lResult = creator.GenerateSettlementInvoice(lCb2Sc, periodStart, periodEnd);
return lResult;
@@ -404,9 +404,9 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
- var s = PluginLoader.FindClass();
+ var s = PluginLoader.FindClass();
- return s.GetAllActiveSupportConceptCostbearer(onlyApproved, onlyWithAssignedCostbearer, employeeOid);
+ return s.GetAllActiveSupportConceptCostbearer(onlyApproved, onlyWithAssignedCostbearer, employeeOid);
}
catch (Exception e)
{
@@ -639,7 +639,7 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
-
+
public List GetCustomerServiceRecordsInMonth(long pCustomerOid, DateTime pMonth)
{
try
@@ -668,26 +668,26 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public List GetEmployeesServiceRecords2(long pEmployeeOid, long? days)
- {
- try
- {
- IEnumerable list = DAOFactory.SearchDAO.FindEmployeeServiceRecordsWithoutCustomer(pEmployeeOid, days);
+ public List GetEmployeesServiceRecords2(long pEmployeeOid, long? days)
+ {
+ try
+ {
+ IEnumerable list = DAOFactory.SearchDAO.FindEmployeeServiceRecordsWithoutCustomer(pEmployeeOid, days);
- return MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(list);
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
+ return MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(list);
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
public List GetEmployeesServiceRecordsWithStartEndDate(long pEmployeeOid, DateTime start, DateTime ende)
{
try
{
- IEnumerable list = DAOFactory.SearchDAO.FindEmployeeServiceRecordsWithoutCustomerWithStartEndDate(pEmployeeOid,start,ende);
-
+ IEnumerable list = DAOFactory.SearchDAO.FindEmployeeServiceRecordsWithoutCustomerWithStartEndDate(pEmployeeOid, start, ende);
+
return MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(list);
}
catch (Exception e)
@@ -701,7 +701,7 @@ namespace BeWo.Service.ServiceImplementations
try
{
var result = new List();
- var srList = DAOFactory.SearchDAO.FindServiceRecordsDetailsForLastDaysWithStartEndDate(costbearer2SupportConceptOid, start,ende);
+ var srList = DAOFactory.SearchDAO.FindServiceRecordsDetailsForLastDaysWithStartEndDate(costbearer2SupportConceptOid, start, ende);
if (srList != null)
{
@@ -732,18 +732,18 @@ namespace BeWo.Service.ServiceImplementations
}
public List GetEmployeesServiceRecordsInSpan(long pEmployeeOid, DateTimeSpan limitinDateTimeSpan)
- {
- try
- {
- IEnumerable list = DAOFactory.SearchDAO.FindEmployeeServiceRecordsWithoutCustomerInSpan(pEmployeeOid, limitinDateTimeSpan);
+ {
+ try
+ {
+ IEnumerable list = DAOFactory.SearchDAO.FindEmployeeServiceRecordsWithoutCustomerInSpan(pEmployeeOid, limitinDateTimeSpan);
- return MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(list);
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
+ return MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(list);
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
public List GetFileAttachments(TableID pObjectTid, long pObjectOid)
{
@@ -927,12 +927,12 @@ namespace BeWo.Service.ServiceImplementations
settingValueDict.Add("ShowDistanceFields", "1");
}
}
-
-
+
+
manDc.Settings = "";
-
- foreach (var kv in settingValueDict)
+
+ foreach (var kv in settingValueDict)
{
if (manDc.Settings.Length > 0)
{
@@ -1213,9 +1213,9 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
- var s = PluginLoader.FindClass();
+ var s = PluginLoader.FindClass();
- return s.GetSupportConceptTreeByEmployee(pEmployeeOid);
+ return s.GetSupportConceptTreeByEmployee(pEmployeeOid);
}
catch (Exception e)
{
@@ -1251,15 +1251,15 @@ namespace BeWo.Service.ServiceImplementations
var list = new List();
list.Add(ValueListEntryType.SupportConceptGoalType);
- list.Add(ValueListEntryType.SupportConceptGoalCategoryType);
+ list.Add(ValueListEntryType.SupportConceptGoalCategoryType);
list.Add(ValueListEntryType.SupportConceptIndividualGoalCategoryType);
- list.Add(ValueListEntryType.SupportConceptIndividualGoalType);
+ list.Add(ValueListEntryType.SupportConceptIndividualGoalType);
- dc.SupportConceptGoals =
- MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDCs(
- sc.ValueList.FindByTypes(list)
- .Select(e2o => e2o.Entry)
- .Where(e => e.IsActive == ActivationTypeId.Active));
+ dc.SupportConceptGoals =
+ MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDCs(
+ sc.ValueList.FindByTypes(list)
+ .Select(e2o => e2o.Entry)
+ .Where(e => e.IsActive == ActivationTypeId.Active));
dc.ServiceAccountings = MapperFactory.ServiceAccountingDC_ServiceAccounting.MapToNewDCs(sc.ServiceAccountings);
}
@@ -1532,65 +1532,65 @@ namespace BeWo.Service.ServiceImplementations
var group = MapperFactory.ServiceRecordGroupDC_ServiceRecordGroup.MapToNewEntity(pServiceRecordGroup);
var lServiceRecords = new List();
- if(pServiceRecordGroup.ServiceRecordList != null && pServiceRecordGroup.ServiceRecordList.Count > 0)
+ if (pServiceRecordGroup.ServiceRecordList != null && pServiceRecordGroup.ServiceRecordList.Count > 0)
{
lServiceRecords = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewEntities(pServiceRecordGroup.ServiceRecordList);
- foreach(var iServiceRecord in lServiceRecords)
+ foreach (var iServiceRecord in lServiceRecords)
{
- if(!group.StartDate.HasValue && group.EndDate.HasValue)
+ if (!group.StartDate.HasValue && group.EndDate.HasValue)
{
group.StartDate = group.EndDate.Value.AddMinutes((double)group.RoundedDuration*-1);
}
- if(group.StartDate.HasValue && group.EndDate.HasValue)
+ if (group.StartDate.HasValue && group.EndDate.HasValue)
{
//Korrigieren
if (group.StartDate.Value == group.EndDate.Value)
{
if (iServiceRecord.RoundedDuration > 0)
{
- group.EndDate = group.StartDate.Value.AddMinutes((double) iServiceRecord.RoundedDuration);
+ group.EndDate = group.StartDate.Value.AddMinutes((double)iServiceRecord.RoundedDuration);
}
}
}
-
- if(group.StartDate.HasValue)
+
+ if (group.StartDate.HasValue)
{
iServiceRecord.Start = group.StartDate;
}
-
- if(group.EndDate.HasValue)
+
+ if (group.EndDate.HasValue)
{
iServiceRecord.End = group.EndDate;
}
//if(group.RoundedDuration == 0)
//{
- if (group.EndDate.HasValue && group.StartDate.HasValue)
- {
- var minutes = group.EndDate.Value.Subtract(group.StartDate.Value).TotalMinutes;
+ if (group.EndDate.HasValue && group.StartDate.HasValue)
+ {
+ var minutes = group.EndDate.Value.Subtract(group.StartDate.Value).TotalMinutes;
- group.RoundedDuration = (decimal)minutes;
- }
+ group.RoundedDuration = (decimal)minutes;
+ }
//}
//if(!iServiceRecord.GroupRoundedDuration.HasValue || iServiceRecord.GroupRoundedDuration.Value == 0)
//{
- iServiceRecord.GroupRoundedDuration = group.RoundedDuration;
+ iServiceRecord.GroupRoundedDuration = group.RoundedDuration;
//}
- if(iServiceRecord.IP == null)
+ if (iServiceRecord.IP == null)
{
iServiceRecord.IP = Utils.GetClientIP();
}
// iServiceRecord.Group = group;
}
-
+
group.ServiceRecordList = lServiceRecords;
-
+
var gdc = PluginLoader.FindClass();
gdc?.CalculateGroupDuration(@group);
@@ -1598,7 +1598,7 @@ namespace BeWo.Service.ServiceImplementations
DAOFactory.GenericDAO.Insert(group);
- if(lServiceRecords.Count > 0)
+ if (lServiceRecords.Count > 0)
{
MakeServiceRecordHistoryEntry(lServiceRecords, lServiceRecords.Select(sr => sr.Oid.Value).ToList(), StatementType.Insert);
}
@@ -1619,7 +1619,7 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
- DeleteAdditionalServiceGroupOfPeopleRelations(new Dictionary {{pOid, pVersion}});
+ DeleteAdditionalServiceGroupOfPeopleRelations(new Dictionary { { pOid, pVersion } });
}
catch (Exception e)
{
@@ -1709,7 +1709,8 @@ namespace BeWo.Service.ServiceImplementations
foreach (AssessmentSheetEntry entry in entries2Update)
{
- if (entry.Customer.Oid == null) continue;
+ if (entry.Customer.Oid == null)
+ continue;
if (entry.Customer.Oid.Value.Equals(c2a.CustomerOid))
{
containsEntry = true;
@@ -2093,7 +2094,7 @@ namespace BeWo.Service.ServiceImplementations
{
pServiceRecordGroup.StartDate = originalStart;
pServiceRecordGroup.EndDate = originalEnde;
- pServiceRecordGroup.RoundedDuration = (decimal) originalEnde.Value.Subtract(originalStart.Value).TotalMinutes;
+ pServiceRecordGroup.RoundedDuration = (decimal)originalEnde.Value.Subtract(originalStart.Value).TotalMinutes;
foreach (var srdc in pServiceRecordGroup.ServiceRecordList)
{
srdc.Start = originalStart;
@@ -2103,7 +2104,7 @@ namespace BeWo.Service.ServiceImplementations
}
}
-
+
}
if (!pServiceRecordGroup.StartDate.HasValue && pServiceRecordGroup.EndDate.HasValue)
{
@@ -2120,7 +2121,7 @@ namespace BeWo.Service.ServiceImplementations
MapperFactory.ServiceRecordGroupDC_ServiceRecordGroup.MergeWithEntity(pServiceRecordGroup, lOriginal);
-
+
var lServiceRecords = new List();
// update servicerecords
@@ -2187,20 +2188,20 @@ namespace BeWo.Service.ServiceImplementations
srDc.Start = originalStart;
srDc.End = originalEnde;
//pServiceRecordGroup.RoundedDuration = (decimal)originalEnde.Value.Subtract(originalStart.Value).TotalMinutes;
-
+
}
}
}
}
-
+
MapperFactory.ServiceRecordDC_ServiceRecord.MergeWithEntitys(pServiceRecords, lOriginals);
var srdc = PluginLoader.FindClass();
var gdc = PluginLoader.FindClass();
-
+
foreach (var serviceRecord in lOriginals)
{
if (srdc != null)
@@ -2227,18 +2228,18 @@ namespace BeWo.Service.ServiceImplementations
if (srdc != null)
{
-
+
}
-
+
var si = PluginLoader.FindClass();
- if (si != null)
- {
- foreach (var serviceRecord in lOriginals)
- {
+ if (si != null)
+ {
+ foreach (var serviceRecord in lOriginals)
+ {
si.BeforeSaveServiceRecord(serviceRecord);
- }
- }
- DAOFactory.GenericDAO.Update(lOriginals);
+ }
+ }
+ DAOFactory.GenericDAO.Update(lOriginals);
lOriginals =
@@ -2255,18 +2256,18 @@ namespace BeWo.Service.ServiceImplementations
public bool DoesNotOverlapWithOtherServiceRecord(ServiceRecordDC pServiceRecord, long customerOid, long? employeeOid)
{
- //obsolete
- return false;
- //if (pServiceRecord.ServiceDescription.DoNotCheckOverlapping)
- //{
- // return false;
- //}
- //var span = new DateTimeSpan
- //{StartDate = pServiceRecord.Start.Value, EndDate = pServiceRecord.End.Value.AddDays(1).AddTicks(-1)};
+ //obsolete
+ return false;
+ //if (pServiceRecord.ServiceDescription.DoNotCheckOverlapping)
+ //{
+ // return false;
+ //}
+ //var span = new DateTimeSpan
+ //{StartDate = pServiceRecord.Start.Value, EndDate = pServiceRecord.End.Value.AddDays(1).AddTicks(-1)};
- //List records = DAOFactory.SearchDAO.FindCustomerServiceRecords(customerOid, span, employeeOid, null).ToList();
+ //List records = DAOFactory.SearchDAO.FindCustomerServiceRecords(customerOid, span, employeeOid, null).ToList();
- //return records.Count <= 0 || records.Where(record => record.CostBearer2SupportConcept.CostBearer.Oid == pServiceRecord.CostBearer.OrganisationOid).Select(record => TimeSpanOverlapsWithOtherTimeSpan(pServiceRecord.Start, record.Start, pServiceRecord.RoundedDuration, record.RoundedDuration)).All(timeCheck => !timeCheck);
+ //return records.Count <= 0 || records.Where(record => record.CostBearer2SupportConcept.CostBearer.Oid == pServiceRecord.CostBearer.OrganisationOid).Select(record => TimeSpanOverlapsWithOtherTimeSpan(pServiceRecord.Start, record.Start, pServiceRecord.RoundedDuration, record.RoundedDuration)).All(timeCheck => !timeCheck);
}
public bool OverlapsWithAnotherAdditionalServiceBooking(long additionalServiceRegionOid, List customerOids, DateTime pDatum)
@@ -2323,9 +2324,9 @@ namespace BeWo.Service.ServiceImplementations
public Dictionary> ValidateGroupServiceRecordEntry(ServiceRecordDC pServiceRecord, List groupServiceRecords, List employees, DateTime? date, int maxDaysEditServiceRecordsAllowed, decimal flsTotalRounded, out Dictionary overlappingRecords, out Dictionary overlappingEmployees)
{
- var validator = PluginLoader.FindClass();
- return validator.ValidateGroupServiceRecordEntry(pServiceRecord, groupServiceRecords, employees, date,
- maxDaysEditServiceRecordsAllowed, flsTotalRounded, out overlappingRecords, out overlappingEmployees);
+ var validator = PluginLoader.FindClass();
+ return validator.ValidateGroupServiceRecordEntry(pServiceRecord, groupServiceRecords, employees, date,
+ maxDaysEditServiceRecordsAllowed, flsTotalRounded, out overlappingRecords, out overlappingEmployees);
}
@@ -2336,8 +2337,8 @@ namespace BeWo.Service.ServiceImplementations
public List ValidateServiceRecord(ServiceRecordDC newServiceRecord, SupportConceptStatisticsDC statistics, int maxDaysEditServiceRecordsAllowed, IList employeeOids, IList cb2scOids)
{
- var validator = PluginLoader.FindClass();
- return validator.ValidateServiceRecord(newServiceRecord, statistics, maxDaysEditServiceRecordsAllowed, employeeOids, cb2scOids);
+ var validator = PluginLoader.FindClass();
+ return validator.ValidateServiceRecord(newServiceRecord, statistics, maxDaysEditServiceRecordsAllowed, employeeOids, cb2scOids);
}
public List ValidateServiceRecordDeletion(ServiceRecordDC serviceRecord, long employeeOid)
@@ -2464,10 +2465,10 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
- var s = PluginLoader.FindClass();
+ var s = PluginLoader.FindClass();
+
+ return s.GetCompactSupportConcepts(supportConceptOid, employeeOid);
- return s.GetCompactSupportConcepts(supportConceptOid, employeeOid);
-
}
catch (Exception e)
{
@@ -2490,10 +2491,10 @@ namespace BeWo.Service.ServiceImplementations
dc.Notice5 = sr.Notice5;
if (sr.ServiceDescription != null)
dc.ServiceDescription = MapperFactory.ServiceDescriptionDC_ServiceDescription.MapToNewDC(sr.ServiceDescription);
-
-
+
+
dc.RoundedDuration = sr.RoundedDuration;
-
+
dc.DistanceInMeter = sr.DistanceInMeter;
dc.InsertedOn = sr.InsTs;
dc.InsUser = sr.InsUser;
@@ -2529,8 +2530,8 @@ namespace BeWo.Service.ServiceImplementations
//Goals -------------------------
var list = new List();
list.Add(ValueListEntryType.SupportConceptGoalType);
- list.Add(ValueListEntryType.SupportConceptGoalCategoryType);
- list.Add(ValueListEntryType.SupportConceptIndividualGoalCategoryType);
+ list.Add(ValueListEntryType.SupportConceptGoalCategoryType);
+ list.Add(ValueListEntryType.SupportConceptIndividualGoalCategoryType);
list.Add(ValueListEntryType.SupportConceptIndividualGoalType);
dc.Goals = MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDCs(
sr.ValueList.FindByTypes(list).Select(e2o => e2o.Entry));
@@ -2691,10 +2692,10 @@ namespace BeWo.Service.ServiceImplementations
//Goals -------------------------
var list = new List();
- list.Add(ValueListEntryType.SupportConceptGoalType);
- list.Add(ValueListEntryType.SupportConceptGoalCategoryType);
- list.Add(ValueListEntryType.SupportConceptIndividualGoalCategoryType);
- list.Add(ValueListEntryType.SupportConceptIndividualGoalType);
+ list.Add(ValueListEntryType.SupportConceptGoalType);
+ list.Add(ValueListEntryType.SupportConceptGoalCategoryType);
+ list.Add(ValueListEntryType.SupportConceptIndividualGoalCategoryType);
+ list.Add(ValueListEntryType.SupportConceptIndividualGoalType);
dc.Goals = MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDCs(
sr.ValueList.FindByTypes(list).Select(e2o => e2o.Entry));
@@ -2730,7 +2731,8 @@ namespace BeWo.Service.ServiceImplementations
foreach (BeWoFolderDC cfo in folderDCList)
{
- if (root.Equals(cfo)) continue;
+ if (root.Equals(cfo))
+ continue;
if (cfo.ParentBeWoFolderOid.HasValue)
{
@@ -2795,17 +2797,17 @@ namespace BeWo.Service.ServiceImplementations
private static string GetContractState()
{
-//#if DEBUG
+ //#if DEBUG
-// info.MaxLicenseCount = 9999;
-// info.PercentFreeEmployee = 100;
+ // info.MaxLicenseCount = 9999;
+ // info.PercentFreeEmployee = 100;
-// info.LicenseInUseCount = DAOFactory.GenericDAO.GetAllActive().Count;
-// info.EmployeeCount = DAOFactory.GenericDAO.GetAllActive().Count;
+ // info.LicenseInUseCount = DAOFactory.GenericDAO.GetAllActive().Count;
+ // info.EmployeeCount = DAOFactory.GenericDAO.GetAllActive().Count;
-// info.MaxEmployeeCount = (int)Math.Ceiling(1000000 * ((100 + 100m) / 100));
-// return info;
-//#endif
+ // info.MaxEmployeeCount = (int)Math.Ceiling(1000000 * ((100 + 100m) / 100));
+ // return info;
+ //#endif
try
{
string url = ConfigurationManager.AppSettings.Get("ContractStateUrl");
@@ -2818,7 +2820,7 @@ namespace BeWo.Service.ServiceImplementations
url = url.Replace("[TENANT]", SessionFacade.Tenant);
}
url += "&t=1";
-
+
using (var client = new WebClient())
{
//MessageBox.Show(hostAddress);
@@ -2857,7 +2859,7 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
- var newCategoryDC = new AssessmentSheetCategoryDC {Description = pAdditionalServiceBookingDC.AdditionalServiceRegion.AdditionalService.Name};
+ var newCategoryDC = new AssessmentSheetCategoryDC { Description = pAdditionalServiceBookingDC.AdditionalServiceRegion.AdditionalService.Name };
AssessmentSheetCategory lCategory = MapperFactory.AssessmentSheetCategoryDC_AssessmentSheetCategory.MapToNewEntity(newCategoryDC);
lCategory.SystemEntryID = SystemEntryID.AdditionalServiceAssessmentSheet;
@@ -3051,7 +3053,7 @@ namespace BeWo.Service.ServiceImplementations
DAOFactory.GenericDAO.Insert(hServiceRecords);
}
-
+
public IList GetAllTextModules()
{
try
@@ -3064,20 +3066,20 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public IList GetTextModules(bool pShouldShowAllTextModules, long pEmployeeOid, bool pHasRightToSeeAllTextModules, bool pIsInAdministrationView)
- {
- try
- {
+ public IList GetTextModules(bool pShouldShowAllTextModules, long pEmployeeOid, bool pHasRightToSeeAllTextModules, bool pIsInAdministrationView)
+ {
+ try
+ {
var list = MapperFactory.TextModuleDC_TextModule.MapToNewDCs(DAOFactory.SearchDAO.GetActiveTextModules(pShouldShowAllTextModules, pHasRightToSeeAllTextModules, pIsInAdministrationView, pEmployeeOid));
- return list.OrderBy(t => t.Name).ToList();
- }
- catch(Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
+ return list.OrderBy(t => t.Name).ToList();
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
- public IList GetTextModulesByServiceCategory(long pServiceCategoryOid)
+ public IList GetTextModulesByServiceCategory(long pServiceCategoryOid)
{
try
{
@@ -3133,7 +3135,7 @@ namespace BeWo.Service.ServiceImplementations
{
AddModuleAndChildsToList(textModule, modulesToDelete);
}
- DAOFactory.GenericDAO.Delete(modulesToDelete);
+ DAOFactory.GenericDAO.Delete(modulesToDelete);
}
catch (Exception e)
{
@@ -3153,17 +3155,17 @@ namespace BeWo.Service.ServiceImplementations
}
public IList FindServiceRecordsInSpan(long pCostBearer2SupportConceptOid, DateTimeSpan period)
- {
- try
- {
- var records = DAOFactory.SearchDAO.FindServiceRecordsInSpan(pCostBearer2SupportConceptOid, period);
- return MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(records);
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
+ {
+ try
+ {
+ var records = DAOFactory.SearchDAO.FindServiceRecordsInSpan(pCostBearer2SupportConceptOid, period);
+ return MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(records);
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
public SignatureDC InsertSignature(SignatureDC s)
{
@@ -3192,7 +3194,7 @@ namespace BeWo.Service.ServiceImplementations
public EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid, string kundennummer, string apikey)
- {
+ {
try
{
#if DEBUG
@@ -3224,7 +3226,8 @@ namespace BeWo.Service.ServiceImplementations
isOk = true;
}
- if (isOk) {
+ if (isOk)
+ {
string zufallscode = ErzeugeZufallsCode(apikey, kundennummer, "E" + employeeOid);
if (zufallscode != null)
@@ -3239,7 +3242,7 @@ namespace BeWo.Service.ServiceImplementations
else
{
newCode = new EmployeeAPPCode();
-
+
newCode.EmployeeOid = employeeOid;
}
@@ -3247,8 +3250,8 @@ namespace BeWo.Service.ServiceImplementations
newCode.EmployeeCodeGenDate = DateTime.Now;
newCode.NotfallStatement = "";
newCode.IsChatAktiv = 1;
-
-
+
+
DAOFactory.GenericDAO.Insert(newCode);
var employeeAPPCodeDC = MapperFactory.EmployeeAPPCodeDC_EmployeeAPPCode.MapToNewDC(newCode);
@@ -3299,7 +3302,7 @@ namespace BeWo.Service.ServiceImplementations
}
- DAOFactory.GenericDAO.Update(employeecode);
+ DAOFactory.GenericDAO.Update(employeecode);
}
catch (Exception e)
{
@@ -3308,7 +3311,7 @@ namespace BeWo.Service.ServiceImplementations
}
- public CustomerAPPCodeDC CreateNewCustomerAPPCodeDC(long customerOid,string kundennummer, string apikey)
+ public CustomerAPPCodeDC CreateNewCustomerAPPCodeDC(long customerOid, string kundennummer, string apikey)
{
try
{
@@ -3341,7 +3344,7 @@ namespace BeWo.Service.ServiceImplementations
isOk = true;
}
-
+
if (isOk)
{
string zufallscode = ErzeugeZufallsCode(apikey, kundennummer, "C" + customerOid);
@@ -3385,7 +3388,7 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, bool isDeliverd, long teamid,string messageid)
+ public ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, bool isDeliverd, long teamid, string messageid)
{
try
{
@@ -3398,7 +3401,7 @@ namespace BeWo.Service.ServiceImplementations
ChatText = Encoding.UTF8.GetBytes(message),
IstGelesen = 0,
MessageId = messageid
-
+
};
if (teamid != 0)
@@ -3409,8 +3412,8 @@ namespace BeWo.Service.ServiceImplementations
{
chatMessage.TeamOid = null;
}
-
- DAOFactory.GenericDAO.Insert(chatMessage);
+
+ DAOFactory.GenericDAO.Insert(chatMessage);
var ChatMessagesDC = MapperFactory.ChatMessagesDC_ChatMessages.MapToNewDC(chatMessage);
@@ -3422,7 +3425,7 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public void UpdateIsChatActiveCustomerAPPCodeDC(long customerOid,int activeType)
+ public void UpdateIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType)
{
try
{
@@ -3432,16 +3435,16 @@ namespace BeWo.Service.ServiceImplementations
{
if (activeType == 1)
{
- items.IsChatAktiv = activeType;
+ items.IsChatAktiv = activeType;
// Erstelle hier ein weiteren Code
}
else
{
items.IsChatAktiv = 0;
//Lösche hier den aktuellen Code
- }
+ }
}
- DAOFactory.GenericDAO.Update(customercode);
+ DAOFactory.GenericDAO.Update(customercode);
}
catch (Exception e)
{
@@ -3454,7 +3457,7 @@ namespace BeWo.Service.ServiceImplementations
try
{
var customercode = DAOFactory.SearchDAO.FindAllCustomerAppCodes(customerOid);
-
+
var customerAPPCodeDC = MapperFactory.CustomerAPPCodeDC_CustomerAPPCode.MapToNewDCs(customercode);
return customerAPPCodeDC;
@@ -3465,7 +3468,7 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public int DeletZufallsCode(string apikey,string customerId,string userId)
+ public int DeletZufallsCode(string apikey, string customerId, string userId)
{
try
{
@@ -3474,16 +3477,16 @@ namespace BeWo.Service.ServiceImplementations
apikey = "0b50c09aff87f20d9ced75340e04e5ccaa11dd3e7bcf25e9c4f94dc20d3cbb97";
#endif
-
+
string serverUrl = ErmittleServerURL(customerId);
-
+
if (serverUrl.IsNullOrEmpty())
{
return 3; // ServerURl konnte nicht ermittelt werden
}
else
- {
+ {
try
{
string serverURl = serverUrl + "/api/ownchat/chatcode/revoke/" + apikey + "/" + customerId + "/" + userId; // ändern
@@ -3504,11 +3507,11 @@ namespace BeWo.Service.ServiceImplementations
var def = new { result = "" };
var jsonDatentyp = JsonConvert.DeserializeAnonymousType(responseFromServer, def);
-
+
response.Close();
-
+
return Convert.ToInt32(jsonDatentyp.result);
-
+
}
catch (Exception e)
{
@@ -3521,30 +3524,30 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
-
- public string ErzeugeZufallsCode(string apikey,string customerId, string userId)
+
+ public string ErzeugeZufallsCode(string apikey, string customerId, string userId)
{
-
+
string serverUrl = ErmittleServerURL(customerId);
-
+
try
{
- string serverURl =serverUrl+"/api/ownchat/chatcode/create/"+ apikey +"/"+ customerId + "/"+userId; // ändern
+ string serverURl = serverUrl+"/api/ownchat/chatcode/create/"+ apikey +"/"+ customerId + "/"+userId; // ändern
WebRequest request = WebRequest.Create(serverURl);
request.Credentials = CredentialCache.DefaultCredentials;
WebResponse response;
-
+
response = request.GetResponse();
-
+
// Display the status.
var statusResponse = ((HttpWebResponse)response).StatusDescription;
string responseFromServer = ReadStreamForChatCode(response);
- var definiti = new {result = "", chatcode = ""};
+ var definiti = new { result = "", chatcode = "" };
var jsonDatentyp = JsonConvert.DeserializeAnonymousType(responseFromServer, definiti); // neuen authentifikationstyp erstellen
@@ -3560,13 +3563,13 @@ namespace BeWo.Service.ServiceImplementations
}
}
catch (Exception e)
- {
+ {
throw Utils.CreateBeWoFaultException(e);
}
}
private string ErmittleServerURL(string customerId)
- {
+ {
try
{
string url = "https://dict.ownchat.de/api/server/resolve/1/" + customerId;//customerId; //customerid == kundennummer
@@ -3597,11 +3600,11 @@ namespace BeWo.Service.ServiceImplementations
private string ReadStreamForChatCode(WebResponse response)
{
try
- {
+ {
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
-
+
string responseFromServer = reader.ReadToEnd();
dataStream.Dispose();
@@ -3613,11 +3616,11 @@ namespace BeWo.Service.ServiceImplementations
return responseFromServer;
}
catch (Exception e)
- {
+ {
return null;
}
}
-
+
public List FindUnreadChatMessagesForRecipient(long personOid)
{
try
@@ -3634,7 +3637,8 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public long InsertNewServiceRecordAndSignature(ServiceRecordDC sr, SignatureDC sig) {
+ public long InsertNewServiceRecordAndSignature(ServiceRecordDC sr, SignatureDC sig)
+ {
try
{
@@ -3648,7 +3652,7 @@ namespace BeWo.Service.ServiceImplementations
if (!String.IsNullOrEmpty(sig.DataBild))
{
var lSignature = MapperFactory.SignatureDC_Signature.MapToNewEntity(sig);
- // lSignature.ServiceRecordOid = serviceRecordOid;
+ // lSignature.ServiceRecordOid = serviceRecordOid;
DAOFactory.GenericDAO.Insert(lSignature);
}
@@ -3725,7 +3729,7 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
- ServiceLogic.SetActivationType(new Dictionary{{pOid, pVersion}}, ActivationTypeId.Deleted);
+ ServiceLogic.SetActivationType(new Dictionary { { pOid, pVersion } }, ActivationTypeId.Deleted);
}
catch (Exception e)
{
@@ -3813,7 +3817,7 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public void DeactivateAbsenceTime( Dictionary pOid2Version)
+ public void DeactivateAbsenceTime(Dictionary pOid2Version)
{
try
{
@@ -3831,10 +3835,10 @@ namespace BeWo.Service.ServiceImplementations
public void InsertNewEmployeeAbsenceTime(long employeeOid, AbsenceTimeDC at)
{
try
- {
+ {
var emp = DAOFactory.GenericDAO.GetByID(employeeOid);
emp.AbsenceTimes.Add(MapperFactory.AbsenceTimeDC_AbsenceTime.MapToNewEntity(at));
-
+
DAOFactory.GenericDAO.Update(emp);
}
catch (Exception e)
@@ -3870,7 +3874,7 @@ namespace BeWo.Service.ServiceImplementations
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
- }
+ }
}
public void UpdateVertretung(VertretungDC vert)
@@ -3913,12 +3917,12 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
-
+
public void CreateVertretung(VertretungDC vertretung)
{
try
{
- var x = MapperFactory.VertretungDC_Vertretung.MapToNewEntity(vertretung);
+ var x = MapperFactory.VertretungDC_Vertretung.MapToNewEntity(vertretung);
DAOFactory.GenericDAO.Insert(x);
@@ -3931,14 +3935,14 @@ namespace BeWo.Service.ServiceImplementations
public void UpdateAbsenceTime(AbsenceTimeDC abs)
{
- try
- {
- var x = DAOFactory.GenericDAO.LoadByID(abs.AbsenceTimeOid.Value);
+ try
+ {
+ var x = DAOFactory.GenericDAO.LoadByID(abs.AbsenceTimeOid.Value);
- MapperFactory.AbsenceTimeDC_AbsenceTime.MergeWithEntity(abs, x);
+ MapperFactory.AbsenceTimeDC_AbsenceTime.MergeWithEntity(abs, x);
- DAOFactory.GenericDAO.Update(x);
- }
+ DAOFactory.GenericDAO.Update(x);
+ }
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
@@ -3948,7 +3952,7 @@ namespace BeWo.Service.ServiceImplementations
public List GetVertretungsListe(DateTime datum)
{
try
- {
+ {
VertretungsManager mgr = new VertretungsManager();
return mgr.CreateVertretungsListe(datum.Date, datum.Date);
}
@@ -3958,29 +3962,29 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public List VertretungsMitarbeiterListeWoechentlich(DateTime start, DateTime ende)
- {
- try
- {
- // VertretungsManager mgr = new VertretungsManager();
+ public List VertretungsMitarbeiterListeWoechentlich(DateTime start, DateTime ende)
+ {
+ try
+ {
+ // VertretungsManager mgr = new VertretungsManager();
- //var x = mgr.CreateVertretungsListe(start, ende);
+ //var x = mgr.CreateVertretungsListe(start, ende);
- // return x;
- return null;
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
+ // return x;
+ return null;
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
public VertretungsKlientAccountingsListeItemsDC KlientenAbschlagsInfoListe(DateTime start, DateTime end)
{
try
{
//VertretungsAlgorithmus alorythmus = new VertretungsAlgorithmus(start, end,3);
-
+
//VertretungsKlientAccountingsListeItemsDC cusAcc = new VertretungsKlientAccountingsListeItemsDC();
//cusAcc.CustomerAccountItemList = alorythmus.c2a;
@@ -4022,8 +4026,8 @@ namespace BeWo.Service.ServiceImplementations
{
if (vert.CustomerOid == klientenOid)
{
- vlist.Add(vert);
- }
+ vlist.Add(vert);
+ }
}
List emOidList = new List();
@@ -4036,7 +4040,7 @@ namespace BeWo.Service.ServiceImplementations
}
}
-
+
var employee = DAOFactory.GenericDAO.GetActiveByIDs(emOidList);
var x = MapperFactory.CompactVertreterEmployeeDC_VertreterEmployee.MapToNewDCs(employee);
@@ -4103,10 +4107,10 @@ namespace BeWo.Service.ServiceImplementations
}
catch (Exception e)
{
- throw Utils.CreateBeWoFaultException(e);
+ throw Utils.CreateBeWoFaultException(e);
}
}
-
+
public void UpdateToken(TokenDC token)
{
try
@@ -4124,7 +4128,7 @@ namespace BeWo.Service.ServiceImplementations
public void InsertNewToken(string beschreibung, TokenTyp typ, SchulbegleitenderZugehoerigkeitsTyp zugehoerigkeitsTyp, long? oid)
{
try
- {
+ {
TokenDC token = new TokenDC()
{
Beschreibung = beschreibung,
@@ -4162,7 +4166,7 @@ namespace BeWo.Service.ServiceImplementations
List e2tList = new List();
e2tList.Add(e2t);
- token.RelatedEmployees = e2tList;
+ token.RelatedEmployees = e2tList;
}
var t = MapperFactory.TokenDC_Token.MapToNewEntity(token);
@@ -4179,7 +4183,8 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
- if(art == 1) {
+ if (art == 1)
+ {
if (verfuegbarerAusschlussToken.ContainsKey(token))
{
CompactTokenDC nToken = null;
@@ -4201,10 +4206,10 @@ namespace BeWo.Service.ServiceImplementations
{
InsertNewToken(token, TokenTyp.AusschlussKriterium, zugehoerigkeitsTyp, Oid);
}
- }
+ }
if (art == 0)
- {
+ {
if (verfuegbarerAusschlussToken.ContainsKey(token))
{
CompactTokenDC nToken = null;
@@ -4240,7 +4245,7 @@ namespace BeWo.Service.ServiceImplementations
foreach (var ken in otoken)
{
- if(ken != null)
+ if (ken != null)
DeletTokenRelation(ken, Oid, zugehoerigkeitsTyp);
}
}
@@ -4263,8 +4268,8 @@ namespace BeWo.Service.ServiceImplementations
DeletTokenRelation(ken, Oid, zugehoerigkeitsTyp);
}
}
- }
- }
+ }
+ }
}
catch (Exception e)
{
@@ -4272,12 +4277,12 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public void DoTokenWunschOperation( int art,long? Oid, SchulbegleitenderZugehoerigkeitsTyp zugehoerigkeitsTyp, Dictionary verfuegbarerWunschToken, string token)
- {
+ public void DoTokenWunschOperation(int art, long? Oid, SchulbegleitenderZugehoerigkeitsTyp zugehoerigkeitsTyp, Dictionary verfuegbarerWunschToken, string token)
+ {
try
{
if (art == 1)
- {
+ {
if (verfuegbarerWunschToken.ContainsKey(token))
{
CompactTokenDC nToken = null;
@@ -4299,11 +4304,11 @@ namespace BeWo.Service.ServiceImplementations
{
InsertNewToken(token.ToString(), TokenTyp.WunschKriterium, zugehoerigkeitsTyp, Oid);
}
-
+
}
if (art == 0)
- {
+ {
if (verfuegbarerWunschToken.ContainsKey(token))
{
CompactTokenDC nToken = null;
@@ -4357,12 +4362,12 @@ namespace BeWo.Service.ServiceImplementations
}
foreach (var ken in otoken)
{
- DeletTokenRelation(ken, Oid, zugehoerigkeitsTyp);
+ DeletTokenRelation(ken, Oid, zugehoerigkeitsTyp);
}
}
- }
+ }
}
-
+
}
catch (Exception e)
{
@@ -4414,7 +4419,7 @@ namespace BeWo.Service.ServiceImplementations
var tok = DAOFactory.GenericDAO.GetByID(token.TokenOid.Value);
- var t = MapperFactory.TokenDC_Token.MergeWithEntity(token,tok);
+ var t = MapperFactory.TokenDC_Token.MergeWithEntity(token, tok);
DAOFactory.GenericDAO.Update(t);
}
@@ -4438,18 +4443,18 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public void DeletTokenRelation(CompactTokenDC token,long? oid, SchulbegleitenderZugehoerigkeitsTyp typ)
+ public void DeletTokenRelation(CompactTokenDC token, long? oid, SchulbegleitenderZugehoerigkeitsTyp typ)
{
try
{
- if(typ == SchulbegleitenderZugehoerigkeitsTyp.Klient)
+ if (typ == SchulbegleitenderZugehoerigkeitsTyp.Klient)
{
var tokenEntity = DAOFactory.GenericDAO.LoadByID(token.TokenOid.Value);
-
- Customer2Token t = null;
+
+ Customer2Token t = null;
foreach (var c2tToken in tokenEntity.Customer2TokenList)
- {
+ {
if (c2tToken.Customer.Oid == oid)
{
t = c2tToken;
@@ -4476,7 +4481,8 @@ namespace BeWo.Service.ServiceImplementations
}
}
- if(t != null) {
+ if (t != null)
+ {
tokenEntity.Employee2TokenList.Remove(t);
DAOFactory.GenericDAO.Update(tokenEntity);
}
@@ -4519,7 +4525,7 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
-
+
public string PrepareAuslastungReport(AuslastungAnalysisRootDC pReport, string id)
{
try
@@ -4596,16 +4602,16 @@ namespace BeWo.Service.ServiceImplementations
return null;
}
- public GroupDurationDC CalculateGroupDuration2(int personCount, int employeeCount, decimal totalDuration, long[] costBearer2SupportConceptArray)
- {
- var calc = PluginLoader.FindClass();
+ public GroupDurationDC CalculateGroupDuration2(int personCount, int employeeCount, decimal totalDuration, long[] costBearer2SupportConceptArray)
+ {
+ var calc = PluginLoader.FindClass();
- if (calc != null)
- {
- return calc.CalculateGroupDuration(personCount, employeeCount, totalDuration, costBearer2SupportConceptArray);
- }
- return null;
- }
+ if (calc != null)
+ {
+ return calc.CalculateGroupDuration(personCount, employeeCount, totalDuration, costBearer2SupportConceptArray);
+ }
+ return null;
+ }
public IList GetUiElements(UiElementType? uiType, long? employeeOid, long? teamOid, long[] oidArray)
{
@@ -4658,8 +4664,8 @@ namespace BeWo.Service.ServiceImplementations
{
var contactList = new List
{
- new Contact {Type = ContactType.business_Fax, Value = pFaxNumber},
- new Contact {Type = ContactType.business_Mail, Value = pMailAddress},
+ new Contact {Type = ContactType.business_Fax, Value = pFaxNumber},
+ new Contact {Type = ContactType.business_Mail, Value = pMailAddress},
new Contact {Type = ContactType.business_Phone, Value = pPhoneNumber}
};
@@ -4668,8 +4674,8 @@ namespace BeWo.Service.ServiceImplementations
Organisation = DAOFactory.GenericDAO.LoadByID(pOrganisationOid),
Notice = pNotice,
RolleInOrganisation = pValue != null ? DAOFactory.GenericDAO.LoadByID(pValue.ValueListEntryOid.Value) : null,
- Person = DAOFactory.GenericDAO.LoadByID(personOid),
- Contacts = contactList
+ Person = DAOFactory.GenericDAO.LoadByID(personOid),
+ Contacts = contactList
};
DAOFactory.GenericDAO.Insert(organisation2Person);
@@ -4693,8 +4699,8 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
-
- public PdfChatHandoutDC GetHandOutPdfForChat(string customerId,string apikey)
+
+ public PdfChatHandoutDC GetHandOutPdfForChat(string customerId, string apikey)
{
try
{
@@ -4717,7 +4723,7 @@ namespace BeWo.Service.ServiceImplementations
var endurl = serverUrl + "/api/ownchat/createpdfmanual/" + apikey + "/" + customerId;
-
+
//Bereich zum Testen Multiform Test gedönse
//using (MultipartFormDataContent multiPartContent = new MultipartFormDataContent())
//{
@@ -4752,9 +4758,9 @@ namespace BeWo.Service.ServiceImplementations
// return jsonDatentyp;
//}
-
-
+
+
//neu post bereich
//Dictionary dic = new Dictionary();
@@ -4787,7 +4793,7 @@ namespace BeWo.Service.ServiceImplementations
//neu ende
-
+
//############################
Dictionary postparameter = new Dictionary();
@@ -4828,7 +4834,7 @@ namespace BeWo.Service.ServiceImplementations
catch (Exception e)
{
MessageBox.Show("Es konnte keine Verbindung aufgebaut werden.", "Fehler", MessageBoxButton.OK);
-
+
}
//response bereich | Verarbeiten
@@ -4879,23 +4885,24 @@ namespace BeWo.Service.ServiceImplementations
handout.Result = 60;
handout.File = e.Message;
- return handout;
+ return handout;
}
}
-
- public CustomerAPPCodeDC DeletCustomerChatCode(string apikey,string kundennummer,long customeroid)
+
+ public CustomerAPPCodeDC DeletCustomerChatCode(string apikey, string kundennummer, long customeroid)
{
CustomerAPPCodeDC aa = new CustomerAPPCodeDC();
var result = DeletZufallsCode(apikey, kundennummer, "C" + customeroid);
-
+
if (result == 0 || result == 32)
{
try
{
-
+
var customerappcode = DAOFactory.SearchDAO.FindAllCustomerAppCodes(customeroid);
- if(customerappcode != null) {
+ if (customerappcode != null)
+ {
var anzahl = customerappcode.Count();
if (anzahl > 0)
@@ -4923,7 +4930,7 @@ namespace BeWo.Service.ServiceImplementations
}
catch (Exception e)
- {
+ {
throw Utils.CreateBeWoFaultException(e);
}
}
@@ -4931,10 +4938,10 @@ namespace BeWo.Service.ServiceImplementations
{
aa.Result = result;
return aa;
- }
+ }
}
- public EmployeeAPPCodeDC DeletEmployeeChatCode(string apikey, string kundennummer,long employeeoid)
+ public EmployeeAPPCodeDC DeletEmployeeChatCode(string apikey, string kundennummer, long employeeoid)
{
EmployeeAPPCodeDC emp = new EmployeeAPPCodeDC();
var result = DeletZufallsCode(apikey, kundennummer, "E" + employeeoid);
@@ -4965,7 +4972,7 @@ namespace BeWo.Service.ServiceImplementations
DAOFactory.GenericDAO.Update(employeeappcode);
emp.Result = 0; // alles ok
- return emp;
+ return emp;
}
else
{
@@ -5078,7 +5085,7 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
-
+
public void SaveSbdConfig(SbdConfigDC config)
{
try
@@ -5089,7 +5096,7 @@ namespace BeWo.Service.ServiceImplementations
{
pi.SaveSbdConfig(config);
}
-
+
}
catch (Exception e)
{
@@ -5104,9 +5111,9 @@ namespace BeWo.Service.ServiceImplementations
const string anonimyzedName = "Anonymisiert";
var pPerson = DAOFactory.GenericDAO.LoadByID(pPersonOid);
-
+
pPerson.Abbreviation = null;
- if(pPerson.DateOfBirth != null)
+ if (pPerson.DateOfBirth != null)
{
pPerson.DateOfBirth = new DateTime(pPerson.DateOfBirth.Value.Year, 1, 1);
}
@@ -5115,7 +5122,7 @@ namespace BeWo.Service.ServiceImplementations
pPerson.LastName = anonimyzedName;
pPerson.Notice = null;
- if(pPerson.Address != null)
+ if (pPerson.Address != null)
{
pPerson.Address.AddressLine1 = null;
pPerson.Address.AddressLine2 = null;
@@ -5135,13 +5142,13 @@ namespace BeWo.Service.ServiceImplementations
pPerson.UdpUser = anonimyzedName;
var bankaccountOid = pPerson.BankAccount?.Oid;
- if(bankaccountOid != null)
+ if (bankaccountOid != null)
{
pPerson.BankAccount = null;
}
pPerson.FamilyStatus = null;
- if(pPerson.InvoiceAddress != null)
+ if (pPerson.InvoiceAddress != null)
{
pPerson.InvoiceAddress.AddressLine1 = null;
pPerson.InvoiceAddress.AddressLine2 = null;
@@ -5157,15 +5164,15 @@ namespace BeWo.Service.ServiceImplementations
pPerson.Contacts.Clear();
pPerson.Images?.Clear();
-
+
DAOFactory.GenericDAO.Update(pPerson);
}
- catch(Exception e)
+ catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
-
+
public void AnonymizeCustomer(long pCustomerOid)
{
try
@@ -5173,11 +5180,11 @@ namespace BeWo.Service.ServiceImplementations
const string anonimyzedName = "Anonymisiert";
var customer = DAOFactory.GenericDAO.GetByID(pCustomerOid);
- if(customer.Person.Oid != null)
+ if (customer.Person.Oid != null)
{
AnonymizePerson(customer.Person.Oid.Value);
}
-
+
customer.VarFieldValueList?.Clear();
customer.AbWelchemKrankheitsTag = 0;
@@ -5187,7 +5194,7 @@ namespace BeWo.Service.ServiceImplementations
at.InsUser = anonimyzedName;
at.UdpUser = anonimyzedName;
});
-
+
customer.Ansprechpartner = null;
customer.AssessmentSheetCategoryList?.Clear();
customer.AssistanceBegin = null;
@@ -5214,7 +5221,7 @@ namespace BeWo.Service.ServiceImplementations
personRelation.UdpUser = anonimyzedName;
personRelation.Notice = null;
});
-
+
customer.CustomerAlias = null;
customer.DebitorNumber = null;
customer.Diagnosis = null;
@@ -5244,7 +5251,8 @@ namespace BeWo.Service.ServiceImplementations
customer.VertretungDringendErforderlich = false;
customer.VertretungGewuenscht = false;
- customer.ServiceRecordList?.DoForEach(record => {
+ customer.ServiceRecordList?.DoForEach(record =>
+ {
record.Notice = null;
record.Notice2 = null;
record.Notice3 = null;
@@ -5274,20 +5282,20 @@ namespace BeWo.Service.ServiceImplementations
});
});
- if(customer.Oid != null)
+ if (customer.Oid != null)
{
var bargeldKassen = DAOFactory.SearchDAO.FindBargeldkasse(TableID.Customer, customer.Oid.Value);
-
+
DAOFactory.GenericDAO.Delete(bargeldKassen);
var fileAttachments = DAOFactory.SearchDAO.FindFileAttachments(TableID.Customer, customer.Oid.Value);
-
+
DAOFactory.GenericDAO.Delete(fileAttachments);
}
-
+
DAOFactory.GenericDAO.Update(customer);
}
- catch(Exception e)
+ catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
@@ -5298,137 +5306,137 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
- var deletionHistoryEntry = new DeletionHistory();
+ //var deletionHistoryEntry = new DeletionHistory();
- var appointments = DAOFactory.SearchDAO.FindAppointmentsForCustomer(pCustomerOid);
- var customer = DAOFactory.GenericDAO.LoadByID(pCustomerOid);
- var supportConceptOids = customer.SupportConcepts.Select(sc => sc.Oid.Value).ToList();
+ //var appointments = DAOFactory.SearchDAO.FindAppointmentsForCustomer(pCustomerOid);
+ //var customer = DAOFactory.GenericDAO.LoadByID(pCustomerOid);
+ //var supportConceptOids = customer.SupportConcepts.Select(sc => sc.Oid.Value).ToList();
- UserDC user;
- if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
- {
- user = MapperFactory.UserDC_User.MapToNewDC(LoggedInUserOperationContextExt.Current.User);
- }
- else
- {
- user = MapperFactory.UserDC_User.MapToNewDC(SessionFacade.LoggedInUser);
- }
+ //UserDC user;
+ //if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
+ //{
+ // user = MapperFactory.UserDC_User.MapToNewDC(LoggedInUserOperationContextExt.Current.User);
+ //}
+ //else
+ //{
+ // user = MapperFactory.UserDC_User.MapToNewDC(SessionFacade.LoggedInUser);
+ //}
- if(user != null)
- {
- string initial;
+ //if(user != null)
+ //{
+ // string initial;
- if(customer.Person.FirstName.Length > 0)
- {
- initial = customer.Person.FirstName[0].ToString();
- }
- else if(customer.Person.LastName.Length > 0)
- {
- initial = customer.Person.LastName[0].ToString();
- }
- else if(customer.CustomerAlias?.Length > 0)
- {
- initial = customer.CustomerAlias[0].ToString();
- }
- else
- {
- initial = "unbekannt";
- }
+ // if(customer.Person.FirstName.Length > 0)
+ // {
+ // initial = customer.Person.FirstName[0].ToString();
+ // }
+ // else if(customer.Person.LastName.Length > 0)
+ // {
+ // initial = customer.Person.LastName[0].ToString();
+ // }
+ // else if(customer.CustomerAlias?.Length > 0)
+ // {
+ // initial = customer.CustomerAlias[0].ToString();
+ // }
+ // else
+ // {
+ // initial = "unbekannt";
+ // }
- deletionHistoryEntry.DeletingEmployeeName = $"{user.Employee.FirstName} {user.Employee.LastName}";
- deletionHistoryEntry.DeletedEntityName = initial;
- deletionHistoryEntry.DeletedEntityTableId = TableID.Customer;
- }
+ // deletionHistoryEntry.DeletingEmployeeName = $"{user.Employee.FirstName} {user.Employee.LastName}";
+ // deletionHistoryEntry.DeletedEntityName = initial;
+ // deletionHistoryEntry.DeletedEntityTableId = TableID.Customer;
+ //}
- appointments.DoForEach(app => app.CustomerList.Remove(customer));
+ //appointments.DoForEach(app => app.CustomerList.Remove(customer));
- DAOFactory.GenericDAO.Update(appointments);
+ //DAOFactory.GenericDAO.Update(appointments);
- var costBearer2SupportConcepts = new List();
- var groupsToGetReferencesRemoved = new List();
- foreach(var sc in customer.SupportConcepts)
- {
- foreach(var cb2sc in sc.CostBearer2SupportConceptList)
- {
- groupsToGetReferencesRemoved.AddRangeIfElementsNotIn(DAOFactory.SearchDAO.GroupOfPeopleForSupportConcept(cb2sc.Oid.Value));
- costBearer2SupportConcepts.AddIfNotIn(cb2sc);
- }
- }
+ //var costBearer2SupportConcepts = new List();
+ //var groupsToGetReferencesRemoved = new List();
+ //foreach(var sc in customer.SupportConcepts)
+ //{
+ // foreach(var cb2sc in sc.CostBearer2SupportConceptList)
+ // {
+ // groupsToGetReferencesRemoved.AddRangeIfElementsNotIn(DAOFactory.SearchDAO.GroupOfPeopleForSupportConcept(cb2sc.Oid.Value));
+ // costBearer2SupportConcepts.AddIfNotIn(cb2sc);
+ // }
+ //}
- foreach(var group in groupsToGetReferencesRemoved)
- {
- group.CostBearer2SupportConceptList.RemoveRange(costBearer2SupportConcepts);
- }
+ //foreach(var group in groupsToGetReferencesRemoved)
+ //{
+ // group.CostBearer2SupportConceptList.RemoveRange(costBearer2SupportConcepts);
+ //}
- DAOFactory.GenericDAO.Update(groupsToGetReferencesRemoved);
+ //DAOFactory.GenericDAO.Update(groupsToGetReferencesRemoved);
- DAOFactory.GenericDAO.Update(customer.SupportConcepts);
+ //DAOFactory.GenericDAO.Update(customer.SupportConcepts);
- var additionalServiceGroups = DAOFactory.SearchDAO.GetAdditionalServiceGroupOfPeopleForCustomer(customer.Oid.Value);
- foreach(var additionalServiceGroup in additionalServiceGroups)
- {
- additionalServiceGroup.CustomerList.Remove(customer);
- }
+ //var additionalServiceGroups = DAOFactory.SearchDAO.GetAdditionalServiceGroupOfPeopleForCustomer(customer.Oid.Value);
+ //foreach(var additionalServiceGroup in additionalServiceGroups)
+ //{
+ // additionalServiceGroup.CustomerList.Remove(customer);
+ //}
- DAOFactory.GenericDAO.Update(additionalServiceGroups);
+ //DAOFactory.GenericDAO.Update(additionalServiceGroups);
- var additionalServiceBookings = DAOFactory.SearchDAO.GetAllAdditionalServiceBookingsForCustomer(customer.Oid.Value);
- DAOFactory.GenericDAO.Delete(additionalServiceBookings);
+ //var additionalServiceBookings = DAOFactory.SearchDAO.GetAllAdditionalServiceBookingsForCustomer(customer.Oid.Value);
+ //DAOFactory.GenericDAO.Delete(additionalServiceBookings);
- var images2delete = customer.Person.Images;
- customer.Person.Images.Clear();
+ //var images2delete = customer.Person.Images;
+ //customer.Person.Images.Clear();
- DAOFactory.GenericDAO.Delete(images2delete);
- DAOFactory.GenericDAO.Update(customer);
+ //DAOFactory.GenericDAO.Delete(images2delete);
+ //DAOFactory.GenericDAO.Update(customer);
- customer.SupportConcepts.DoForEach(s => s.CostBearer2SupportConceptList?.Clear());
- foreach(var assessmentSheetCategory in customer.AssessmentSheetCategoryList)
- {
- assessmentSheetCategory.Customers.Remove(customer);
- }
+ //customer.SupportConcepts.DoForEach(s => s.CostBearer2SupportConceptList?.Clear());
+ //foreach(var assessmentSheetCategory in customer.AssessmentSheetCategoryList)
+ //{
+ // assessmentSheetCategory.Customers.Remove(customer);
+ //}
- var assessmentSheetEntries = DAOFactory.SearchDAO.GetAssessmentSheetEntriesForCustomer(customer.Oid.Value, DateTime.MinValue, DateTime.MaxValue);
+ //var assessmentSheetEntries = DAOFactory.SearchDAO.GetAssessmentSheetEntriesForCustomer(customer.Oid.Value, DateTime.MinValue, DateTime.MaxValue);
- var invoiceBases2Delete = DAOFactory.SearchDAO.GetInvoiceBasesBySupportConceptOids(supportConceptOids);
- invoiceBases2Delete.DoForEach(ib => ib.InvoiceItems.Clear());
+ //var invoiceBases2Delete = DAOFactory.SearchDAO.GetInvoiceBasesBySupportConceptOids(supportConceptOids);
+ //invoiceBases2Delete.DoForEach(ib => ib.InvoiceItems.Clear());
- var settlementInvoices = DAOFactory.SearchDAO.GetSettlementInvoiceBySupportConceptOids(supportConceptOids);
- var serviceInvoices = DAOFactory.SearchDAO.GetServiceInvoicesByInvoiceBaseOids(invoiceBases2Delete.Select(s => s.Oid.Value).ToList());
+ //var settlementInvoices = DAOFactory.SearchDAO.GetSettlementInvoiceBySupportConceptOids(supportConceptOids);
+ //var serviceInvoices = DAOFactory.SearchDAO.GetServiceInvoicesByInvoiceBaseOids(invoiceBases2Delete.Select(s => s.Oid.Value).ToList());
- var invoiceItems = new List();
- invoiceBases2Delete.DoForEach(ib => invoiceItems.AddRange(ib.InvoiceItems));
- DAOFactory.GenericDAO.Update(invoiceBases2Delete);
+ //var invoiceItems = new List();
+ //invoiceBases2Delete.DoForEach(ib => invoiceItems.AddRange(ib.InvoiceItems));
+ //DAOFactory.GenericDAO.Update(invoiceBases2Delete);
- if(supportConceptOids.Any())
- {
- var tasksAndAppointments2Delete = DAOFactory.SearchDAO.GetTasksAndAppointmentsBySupportConceptOids(supportConceptOids);
- DAOFactory.GenericDAO.Delete(tasksAndAppointments2Delete);
- }
+ //if(supportConceptOids.Any())
+ //{
+ // var tasksAndAppointments2Delete = DAOFactory.SearchDAO.GetTasksAndAppointmentsBySupportConceptOids(supportConceptOids);
+ // DAOFactory.GenericDAO.Delete(tasksAndAppointments2Delete);
+ //}
- DAOFactory.GenericDAO.Delete(invoiceItems);
- DAOFactory.GenericDAO.Delete(settlementInvoices);
- DAOFactory.GenericDAO.Delete(serviceInvoices);
+ //DAOFactory.GenericDAO.Delete(invoiceItems);
+ //DAOFactory.GenericDAO.Delete(settlementInvoices);
+ //DAOFactory.GenericDAO.Delete(serviceInvoices);
- invoiceBases2Delete = DAOFactory.SearchDAO.GetInvoiceBasesBySupportConceptOids(supportConceptOids);
- DAOFactory.GenericDAO.Delete(invoiceBases2Delete);
+ //invoiceBases2Delete = DAOFactory.SearchDAO.GetInvoiceBasesBySupportConceptOids(supportConceptOids);
+ //DAOFactory.GenericDAO.Delete(invoiceBases2Delete);
- var customer2Tokens2Delete = DAOFactory.SearchDAO.GetCustomer2TokensByCustomerOid(customer.Oid.Value);
- DAOFactory.GenericDAO.Delete(customer2Tokens2Delete);
+ //var customer2Tokens2Delete = DAOFactory.SearchDAO.GetCustomer2TokensByCustomerOid(customer.Oid.Value);
+ //DAOFactory.GenericDAO.Delete(customer2Tokens2Delete);
- DAOFactory.GenericDAO.Delete(assessmentSheetEntries);
-
- DAOFactory.GenericDAO.Update(customer);
+ //DAOFactory.GenericDAO.Delete(assessmentSheetEntries);
- DAOFactory.GenericDAO.Delete(customer.SupportConcepts);
+ //DAOFactory.GenericDAO.Update(customer);
- DAOFactory.GenericDAO.Delete(DAOFactory.GenericDAO.LoadByID(customer.Oid.Value));
+ //DAOFactory.GenericDAO.Delete(customer.SupportConcepts);
- if(deletionHistoryEntry.DeletingEmployeeName != null)
- {
- DAOFactory.GenericDAO.Insert(deletionHistoryEntry);
- }
+ //DAOFactory.GenericDAO.Delete(DAOFactory.GenericDAO.LoadByID(customer.Oid.Value));
+
+ //if(deletionHistoryEntry.DeletingEmployeeName != null)
+ //{
+ // DAOFactory.GenericDAO.Insert(deletionHistoryEntry);
+ //}
}
- catch(Exception e)
+ catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
@@ -5441,7 +5449,7 @@ namespace BeWo.Service.ServiceImplementations
{
}
- catch(Exception e)
+ catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
@@ -5454,7 +5462,7 @@ namespace BeWo.Service.ServiceImplementations
{
}
- catch(Exception e)
+ catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
@@ -5467,7 +5475,7 @@ namespace BeWo.Service.ServiceImplementations
{
var employee = DAOFactory.GenericDAO.LoadByID(pEmployeeOid);
- if(employee.Person.Oid != null)
+ if (employee.Person.Oid != null)
{
AnonymizePerson(employee.Person.Oid.Value);
}
@@ -5480,7 +5488,7 @@ namespace BeWo.Service.ServiceImplementations
DAOFactory.GenericDAO.Update(employee);
}
- catch(Exception e)
+ catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
@@ -5494,12 +5502,12 @@ namespace BeWo.Service.ServiceImplementations
var appointments2Delete = DAOFactory.SearchDAO.LoadFilteredAppointments(pHasRightToSeeAllEmployeeAppointments, pEmployeeOid, new DateTime(1, 1, 1), pIntervalEnd, pSelectedEmployees, pSelectedCustomers, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments, true);
DAOFactory.GenericDAO.Delete(appointments2Delete);
}
- catch(Exception e)
+ catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
-
+
public string GetMessageFromServer(TableID pObjectTid, long? pObjectOid, MessageType pMessageType)
{
try
@@ -5507,35 +5515,35 @@ namespace BeWo.Service.ServiceImplementations
var actualTextMessage = "";
const string foreground = "Foreground=\"Red\"";
const string fontWeight = "FontWeight=\"Bold\"";
-
- if(pObjectTid == TableID.Customer && pMessageType == MessageType.Anonymization)
+
+ if (pObjectTid == TableID.Customer && pMessageType == MessageType.Anonymization)
{
actualTextMessage = "Achtung!
Das Anonymisieren eines Klienten kann nicht rückgängig gemacht werden!
";
}
- if(pObjectTid == TableID.Customer && pMessageType == MessageType.DeleteForGood)
+ if (pObjectTid == TableID.Customer && pMessageType == MessageType.DeleteForGood)
{
actualTextMessage = "Achtung!
Das endgültige Löschen eines Klienten kann nicht rückgängig gemacht werden!
";
}
- if(pObjectTid == TableID.Person && pMessageType == MessageType.DeleteForGood)
+ if (pObjectTid == TableID.Person && pMessageType == MessageType.DeleteForGood)
{
actualTextMessage = "Achtung!
Das endgültige Löschen einer Person kann nicht rückgängig gemacht werden!
";
}
- if(pObjectTid == TableID.Employee && pMessageType == MessageType.Anonymization)
+ if (pObjectTid == TableID.Employee && pMessageType == MessageType.Anonymization)
{
actualTextMessage = "Achtung!
Das Anonymisieren eines Mitarbeiters kann nicht rückgängig gemacht werden!
";
}
- if(pObjectTid == TableID.Employee && pMessageType == MessageType.DeleteForGood)
+ if (pObjectTid == TableID.Employee && pMessageType == MessageType.DeleteForGood)
{
actualTextMessage = "Achtung!
Das endgültige Löschen eines Mitarbeiters kann nicht rückgängig gemacht werden!
";
}
return $"";
}
- catch(Exception e)
+ catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
@@ -5544,7 +5552,7 @@ namespace BeWo.Service.ServiceImplementations
public string GetMessageFromServerForDeletingAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalEnd, List pSelectedEmployees, List pSelectedCustomers, List pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, Dictionary pUserRights)
{
var appointments2Delete = DAOFactory.SearchDAO.LoadFilteredAppointments(pHasRightToSeeAllEmployeeAppointments, pEmployeeOid, new DateTime(1, 1, 1), pIntervalEnd, pSelectedEmployees, pSelectedCustomers, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments, true);
-
+
var actualTextMessage = $"Achtung!
Das Löschen von {appointments2Delete.Count} {(appointments2Delete.Count == 1 ? "Termin" : "Terminen")} bis zum {pIntervalEnd.ToShortDateString()} kann nicht rückgängig gemacht werden!
";
return $"";
@@ -5627,173 +5635,182 @@ namespace BeWo.Service.ServiceImplementations
var result = new List();
var span = new DateTimeSpan() { StartDateTime = filter.StartDatum.Date, EndDateTime = filter.EndDatum.Date.AddDays(1).AddTicks(-1) };
- var alleHps = DAOFactory.SearchDAO.FindSupportConceptsInSpan(span);
- var alleEmps = DAOFactory.GenericDAO.GetAllActive();
+ var alleRec = DAOFactory.SearchDAO.FindServiceRecordsInSpan(span, null).ToList();
- #region Erzeuge leere Daten
- foreach (var item in alleHps)
+ if (filter.NullDaten)
{
- var resultEntry = new FlexibleReportEntryDC();
+ var alleHps = DAOFactory.SearchDAO.FindSupportConceptsInSpan(span);
+ var alleEmps = DAOFactory.GenericDAO.GetAllActive();
- var added = false;
-
-
- if (span.StartDate <= item.EndDate && span.EndDate >= item.StartDate)
+ foreach (var hilfePlan in alleHps.Where(x => span.StartDate <= x.EndDate && span.EndDate >= x.StartDate))
{
- foreach (var c2s in item.CostBearer2SupportConceptList)
+ foreach (var c2s in hilfePlan.CostBearer2SupportConceptList.Where(x => span.StartDate <= x.EndDate && span.EndDate >= x.StartDate))
{
- if (span.StartDate <= c2s.EndDate && span.EndDate >= c2s.StartDate)
+ result.AddRange(CreateFlexibleReportsInTimeSpan(span, null, hilfePlan, FlexibleReportEntryType.CustomerNullEntry));
+
+ foreach (var e2c in hilfePlan.Customer.Employee2CustomerList)
{
- foreach (var e2c in item.Customer.Employee2CustomerList)
+ if (IstHauptbetreuer(hilfePlan.Customer, e2c.Employee))
{
- if (IstHauptbetreuer(item.Customer, e2c.Employee))
- {
- added = true;
- result.AddRange(GetEmptyFlexibleReportsInTimeSpan(span, e2c.Employee, item, FlexibleReportEntryType.CustomerEmployeeNullEntry));
- }
+ result.AddRange(CreateFlexibleReportsInTimeSpan(span, e2c.Employee, hilfePlan, FlexibleReportEntryType.CustomerEmployeeNullEntry));
}
}
}
+ }
- if (!added)
+ foreach (var item in alleEmps)
+ {
+ for (DateTime date = span.StartDate; date <= span.EndDate; date = date.AddDays(1))
{
- result.AddRange(GetEmptyFlexibleReportsInTimeSpan(span, null, item, FlexibleReportEntryType.CustomerNullEntry));
+ result.Add(new FlexibleReportEntryDC()
+ {
+ Employee = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(item),
+ Type = FlexibleReportEntryType.EmployeeNullEntry,
+ Datum = date
+ });
}
}
}
- foreach (var item in alleEmps)
+ foreach (var serviceRecordListEntry in alleRec)
{
- for (DateTime date = span.StartDate; date <= span.EndDate; date = date.AddDays(1))
- {
- result.Add(new FlexibleReportEntryDC()
- {
- Employee = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(item),
- Type = FlexibleReportEntryType.EmployeeNullEntry,
- Datum = date
- });
- }
- }
- #endregion
+ var resultEntry = result.Where(
+ x =>
+ x.CustomerOid == serviceRecordListEntry.CustomerOid &&
+ x.Type == FlexibleReportEntryType.CustomerNullEntry &&
+ x.Datum == serviceRecordListEntry.Start.Value.Date)
+ .FirstOrDefault();
- var list = DAOFactory.SearchDAO.FindServiceRecordsInSpan(span, null).ToList();
+ if (resultEntry == null)
+ result.Add(resultEntry = new FlexibleReportEntryDC());
- foreach (var serviceRecordListEntry in list)
- {
- FlexibleReportEntryDC resultEntry;
-
- if (serviceRecordListEntry.Customer != null)
- resultEntry = result.Where(x => x.CustomerOid == serviceRecordListEntry.CustomerOid && x.Type == FlexibleReportEntryType.CustomerNullEntry).FirstOrDefault() ?? new FlexibleReportEntryDC();
- else
- resultEntry = new FlexibleReportEntryDC();
-
- if (serviceRecordListEntry.CustomerOid != null)
- {
- var key = CreateFlexibleDictionaryKey(
- serviceRecordListEntry.CustomerOid.Value,
- serviceRecordListEntry.Start.Value,
- serviceRecordListEntry.EmployeeOid ?? 0,
- GetTeamNameByTeam2CustomerList(serviceRecordListEntry.Customer.Team2CustomerList));//,
- //serviceRecordListEntry.ServiceDescription.Name,
- //serviceRecordListEntry.ServiceDescription.ServiceCategory.Name);
-
- // Wenn sich noch kein Eintrag in der Liste befindet
- if (!dict.ContainsKey(key))
- {
- DateTime start = span.StartDate.Date;
- DateTime ende = span.EndDate.Date;
-
- if (serviceRecordListEntry.SupportConcept != null)
- {
- // Holt sich den Hilfeplan und erstellt den Solltermin
- resultEntry.SupportConcept = MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDC(serviceRecordListEntry.SupportConcept);
-
- CreateFlexibleReportSoll(resultEntry, serviceRecordListEntry, serviceRecordListEntry.Start.Value, calc);
-
- // Schaut, ob der Hilfeplan nach dem ausgewählten Startdatum anfängt
- if (resultEntry.SupportConcept.StartDate.HasValue)
- if (span.StartDate.Date < resultEntry.SupportConcept.StartDate.Value)
- start = resultEntry.SupportConcept.StartDate.Value;
-
- // Schaut, ob der Hilfeplan vor dem ausgewählten Endzeitpunkt ausläuft
- if (resultEntry.SupportConcept.EndDate.HasValue)
- if (span.EndDate.Date > resultEntry.SupportConcept.EndDate.Value)
- ende = resultEntry.SupportConcept.EndDate.Value;
- }
-
- if (serviceRecordListEntry.Customer != null)
- {
- // Erstellt die leeren Objekte zur Berechnung der Sollanzahl
-
- foreach (var nullEntry in CreateFlexibleNullEntries(serviceRecordListEntry, start, ende, resultEntry.AnzahlMinutenSoll))
- {
- CreateFlexibleReportSoll(nullEntry, serviceRecordListEntry, nullEntry.Datum, calc);
-
- var newKey = CreateFlexibleDictionaryKey(
- serviceRecordListEntry.CustomerOid.Value,
- nullEntry.Datum,
- serviceRecordListEntry.EmployeeOid ?? 0,
- GetTeamNameByTeam2CustomerList(serviceRecordListEntry.Customer.Team2CustomerList));
- //,
- // serviceRecordListEntry.ServiceDescription.Name,
- // serviceRecordListEntry.ServiceDescription.ServiceCategory.Name);
-
- // Schaut, ob sich der Schlüssel bereits in dem Dict befindet
- if (!dict.ContainsKey(newKey))
- {
- // Schaut, ob das Objekt direkt in die Liste geworfen wird oder vorher noch bearbeitet werden muss
- if (nullEntry.Datum != serviceRecordListEntry.Start.Value.Date)
- {
- dict.Add(newKey, nullEntry);
- result.Add(nullEntry);
- }
- else
- {
- dict.Add(newKey, resultEntry);
- }
- }
- }
- }
- }
- // Wenn sich bereits eine Zeiterfassung oder ein Platzhalter des Klientens an dem Tag in der Liste befindet
- else
- {
- var existingEntry = dict[key];
-
- // Platzhalter
- if (existingEntry.EintraegeProTag == 0)
- {
- // Entfernt den Eintrag temporär aus der Liste (wird am Ende hinzugefügt)
- result.Remove(existingEntry);
- resultEntry = existingEntry;
- }
- // Existierende Zeiterfassung
- else
- {
- resultEntry.EintraegeProTag = existingEntry.EintraegeProTag;
- existingEntry.EintraegeProTag += 1;
- }
- }
- }
-
- // Überträgt Daten
- resultEntry.EintraegeProTag++;
resultEntry.AnzahlMinuten = serviceRecordListEntry.RoundedDuration;
- resultEntry.Kilometer = serviceRecordListEntry.DistanceInMeter;
+ resultEntry.AnzahlMinutenSoll = 0.0M;
+ resultEntry.Customer = serviceRecordListEntry.Customer == null ? null : MapperFactory.CompactCustomerDC_Customer.MapToNewDC(serviceRecordListEntry.Customer);
resultEntry.Datum = serviceRecordListEntry.Start.Value;
resultEntry.Employee = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(serviceRecordListEntry.Employee);
+ resultEntry.Kilometer = serviceRecordListEntry.DistanceInMeter;
resultEntry.Leistung = serviceRecordListEntry.ServiceDescription.Name;
resultEntry.Leistungskategorie = serviceRecordListEntry.ServiceDescription.ServiceCategory.Name;
- resultEntry.Type = FlexibleReportEntryType.FullEntry;
-
- if (serviceRecordListEntry.Customer != null)
- {
- resultEntry.Customer = MapperFactory.CompactCustomerDC_Customer.MapToNewDC(serviceRecordListEntry.Customer);
- }
-
- result.Add(resultEntry);
+ resultEntry.SupportConcept = serviceRecordListEntry.SupportConcept == null ? null : MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDC(serviceRecordListEntry.SupportConcept);
+ resultEntry.Team = GetTeamNameByTeam2CustomerList(serviceRecordListEntry.Customer.Team2CustomerList);
+ resultEntry.Type = FlexibleReportEntryType.ServiceRecordEntry;
}
+ //foreach (var serviceRecordListEntry in alleRec)
+ //{
+ // FlexibleReportEntryDC resultEntry;
+
+ // if (serviceRecordListEntry.Customer != null)
+ // resultEntry = result.Where(x => x.CustomerOid == serviceRecordListEntry.CustomerOid && x.Type == FlexibleReportEntryType.CustomerNullEntry).FirstOrDefault() ?? new FlexibleReportEntryDC();
+ // else
+ // resultEntry = new FlexibleReportEntryDC();
+
+ // if (serviceRecordListEntry.CustomerOid != null)
+ // {
+ // var key = CreateFlexibleDictionaryKey(
+ // serviceRecordListEntry.CustomerOid.Value,
+ // serviceRecordListEntry.Start.Value,
+ // serviceRecordListEntry.EmployeeOid ?? 0,
+ // GetTeamNameByTeam2CustomerList(serviceRecordListEntry.Customer.Team2CustomerList));
+
+ // Wenn sich noch kein Eintrag in der Liste befindet
+ // if (!dict.ContainsKey(key))
+ // {
+ // DateTime start = span.StartDate.Date;
+ // DateTime ende = span.EndDate.Date;
+
+ // if (serviceRecordListEntry.SupportConcept != null)
+ // {
+ // Holt sich den Hilfeplan und erstellt den Solltermin
+ // resultEntry.SupportConcept = MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDC(serviceRecordListEntry.SupportConcept);
+
+ // CreateFlexibleReportSoll(resultEntry, serviceRecordListEntry, serviceRecordListEntry.Start.Value, calc);
+
+ // Schaut, ob der Hilfeplan nach dem ausgewählten Startdatum anfängt
+ // if (resultEntry.SupportConcept.StartDate.HasValue)
+ // if (span.StartDate.Date < resultEntry.SupportConcept.StartDate.Value)
+ // start = resultEntry.SupportConcept.StartDate.Value;
+
+ // Schaut, ob der Hilfeplan vor dem ausgewählten Endzeitpunkt ausläuft
+ // if (resultEntry.SupportConcept.EndDate.HasValue)
+ // if (span.EndDate.Date > resultEntry.SupportConcept.EndDate.Value)
+ // ende = resultEntry.SupportConcept.EndDate.Value;
+ // }
+
+ // if (serviceRecordListEntry.Customer != null)
+ // {
+ // Erstellt die leeren Objekte zur Berechnung der Sollanzahl
+
+ // foreach (var nullEntry in CreateFlexibleNullEntries(serviceRecordListEntry, start, ende, resultEntry.AnzahlMinutenSoll))
+ // {
+ // CreateFlexibleReportSoll(nullEntry, serviceRecordListEntry, nullEntry.Datum, calc);
+
+ // var newKey = CreateFlexibleDictionaryKey(
+ // serviceRecordListEntry.CustomerOid.Value,
+ // nullEntry.Datum,
+ // serviceRecordListEntry.EmployeeOid ?? 0,
+ // GetTeamNameByTeam2CustomerList(serviceRecordListEntry.Customer.Team2CustomerList));
+ // ,
+ // serviceRecordListEntry.ServiceDescription.Name,
+ // serviceRecordListEntry.ServiceDescription.ServiceCategory.Name);
+
+ // Schaut, ob sich der Schlüssel bereits in dem Dict befindet
+ // if (!dict.ContainsKey(newKey))
+ // {
+ // Schaut, ob das Objekt direkt in die Liste geworfen wird oder vorher noch bearbeitet werden muss
+ // if (nullEntry.Datum != serviceRecordListEntry.Start.Value.Date)
+ // {
+ // dict.Add(newKey, nullEntry);
+ // result.Add(nullEntry);
+ // }
+ // else
+ // {
+ // dict.Add(newKey, resultEntry);
+ // }
+ // }
+ // }
+ // }
+ // }
+ // Wenn sich bereits eine Zeiterfassung oder ein Platzhalter des Klientens an dem Tag in der Liste befindet
+ // else
+ // {
+ // var existingEntry = dict[key];
+
+ // Platzhalter
+ // if (existingEntry.EintraegeProTag == 0)
+ // {
+ // Entfernt den Eintrag temporär aus der Liste (wird am Ende hinzugefügt)
+ // result.Remove(existingEntry);
+ // resultEntry = existingEntry;
+ // }
+ // Existierende Zeiterfassung
+ // else
+ // {
+ // resultEntry.EintraegeProTag = existingEntry.EintraegeProTag;
+ // existingEntry.EintraegeProTag += 1;
+ // }
+ // }
+ // }
+
+ // Überträgt Daten
+ // resultEntry.EintraegeProTag++;
+ // resultEntry.AnzahlMinuten = serviceRecordListEntry.RoundedDuration;
+ // resultEntry.Kilometer = serviceRecordListEntry.DistanceInMeter;
+ // resultEntry.Datum = serviceRecordListEntry.Start.Value;
+ // resultEntry.Employee = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(serviceRecordListEntry.Employee);
+ // resultEntry.Leistung = serviceRecordListEntry.ServiceDescription.Name;
+ // resultEntry.Leistungskategorie = serviceRecordListEntry.ServiceDescription.ServiceCategory.Name;
+ // resultEntry.Type = FlexibleReportEntryType.FullEntry;
+
+ // if (serviceRecordListEntry.Customer != null)
+ // {
+ // resultEntry.Customer = MapperFactory.CompactCustomerDC_Customer.MapToNewDC(serviceRecordListEntry.Customer);
+ // }
+
+ // result.Add(resultEntry);
+ //}
+
return result;
}
catch (Exception e)
@@ -5866,9 +5883,24 @@ namespace BeWo.Service.ServiceImplementations
}
}
+ private decimal? blabla(CostBearer2SupportConcept c, DateTime d, Calculations calculations)
+ {
+ var c2sDc = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(c);
+ return calculations.GetApprovedHoursPerDay(c2sDc, d) * 60;
+ }
+
+ private decimal? CalcSollMin(ServiceRecord serviceRecord, DateTime datum, Calculations calc)
+ {
+ if (serviceRecord.CostBearer2SupportConcept != null && IstHauptbetreuer(serviceRecord.Customer, serviceRecord.Employee))
+ {
+ var c2sDc = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(serviceRecord.CostBearer2SupportConcept);
+ return calc.GetApprovedHoursPerDay(c2sDc, datum) * 60;
+ }
+ return null;
+ }
+
private bool IstHauptbetreuer(Customer c, Employee e)
{
-
foreach (Employee2Customer e2c in c.Employee2CustomerList)
{
foreach (ValueListEntry2Object vle2o in e2c.ValueList)
@@ -5884,7 +5916,7 @@ namespace BeWo.Service.ServiceImplementations
return false;
}
- private IEnumerable GetEmptyFlexibleReportsInTimeSpan(DateTimeSpan span, Employee employee, SupportConcept supportConcept, FlexibleReportEntryType type)
+ private IEnumerable CreateFlexibleReportsInTimeSpan(DateTimeSpan span, Employee employee, SupportConcept supportConcept, FlexibleReportEntryType type)
{
for (DateTime date = span.StartDate; date <= span.EndDate; date = date.AddDays(1))
{
diff --git a/Shared/BeWoEntityEnums.cs b/Shared/BeWoEntityEnums.cs
index 92fc6f84f..3a81c233a 100644
--- a/Shared/BeWoEntityEnums.cs
+++ b/Shared/BeWoEntityEnums.cs
@@ -1000,6 +1000,7 @@ namespace BS.Shared
EmployeeNullEntry,
CustomerNullEntry,
CustomerEmployeeNullEntry,
- FullEntry
+ ServiceRecordEntry,
+ SollEntry
}
}
\ No newline at end of file
diff --git a/Shared/DataContracts/FlexibleReportFilterDC.cs b/Shared/DataContracts/FlexibleReportFilterDC.cs
index 6a414a9ec..7a33d29a2 100644
--- a/Shared/DataContracts/FlexibleReportFilterDC.cs
+++ b/Shared/DataContracts/FlexibleReportFilterDC.cs
@@ -22,5 +22,8 @@ namespace BS.Shared.DataContracts
[DataMember]
public IList Leistungen { get; set; }
- }
+
+ [DataMember]
+ public bool NullDaten { get; set; }
+ }
}