diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs
index 7f5cd6494..31551b9d2 100644
--- a/BeWo/ServiceProxy/Generated.cs
+++ b/BeWo/ServiceProxy/Generated.cs
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
+// Dieser Code wurde von einem Tool generiert.
+// Laufzeitversion:4.0.30319.42000
//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
+// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
+// der Code erneut generiert wird.
//
//------------------------------------------------------------------------------
@@ -3616,24 +3616,24 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IStreamingService/UpdateBeWoFoldersBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void UpdateBeWoFolders(System.Collections.Generic.List dcs);
- // CODEGEN: Generating message contract since the wrapper name (UploadPackage) of message UploadPackage does not match the default value (UploadDocument)
+ // CODEGEN: Der Nachrichtenvertrag wird generiert, da der Wrappername (UploadPackage) von Nachricht "UploadPackage" nicht mit dem Standardwert (UploadDocument) übereinstimmt.
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStreamingService/UploadDocument", ReplyAction="http://tempuri.org/IStreamingService/UploadDocumentResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IStreamingService/UploadDocumentBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BeWo.ServiceProxy.UploadResult UploadDocument(BeWo.ServiceProxy.UploadPackage request);
- // CODEGEN: Generating message contract since the wrapper name (UpdatePackage) of message UpdatePackage does not match the default value (UpdateDocument)
+ // CODEGEN: Der Nachrichtenvertrag wird generiert, da der Wrappername (UpdatePackage) von Nachricht "UpdatePackage" nicht mit dem Standardwert (UpdateDocument) übereinstimmt.
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStreamingService/UpdateDocument", ReplyAction="http://tempuri.org/IStreamingService/UpdateDocumentResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IStreamingService/UpdateDocumentBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BeWo.ServiceProxy.UploadResult UpdateDocument(BeWo.ServiceProxy.UpdatePackage request);
- // CODEGEN: Generating message contract since the wrapper name (UploadChatPackage) of message UploadChatPackage does not match the default value (CreateNewSpeziallStreamChatMessagesDC)
+ // CODEGEN: Der Nachrichtenvertrag wird generiert, da der Wrappername (UploadChatPackage) von Nachricht "UploadChatPackage" nicht mit dem Standardwert (CreateNewSpeziallStreamChatMessagesDC) übereinstimmt.
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStreamingService/CreateNewSpeziallStreamChatMessagesDC", ReplyAction="http://tempuri.org/IStreamingService/CreateNewSpeziallStreamChatMessagesDCRespons" +
"e")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IStreamingService/CreateNewSpeziallStreamChatMessagesDCBeWoFau" +
"ltFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BeWo.ServiceProxy.UploadChatResult CreateNewSpeziallStreamChatMessagesDC(BeWo.ServiceProxy.UploadChatPackage request);
- // CODEGEN: Generating message contract since the wrapper name (UploadPackage) of message UploadPackage does not match the default value (UploadImportFile)
+ // CODEGEN: Der Nachrichtenvertrag wird generiert, da der Wrappername (UploadPackage) von Nachricht "UploadPackage" nicht mit dem Standardwert (UploadImportFile) übereinstimmt.
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStreamingService/UploadImportFile", ReplyAction="http://tempuri.org/IStreamingService/UploadImportFileResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IStreamingService/UploadImportFileBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BeWo.ServiceProxy.UploadImportFileResult UploadImportFile(BeWo.ServiceProxy.UploadPackage request);
@@ -4907,6 +4907,10 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetColorForStatusBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
string GetColorForStatus(bool status);
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetColorForForeground", ReplyAction="http://tempuri.org/IOperationsService/GetColorForForegroundResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetColorForForegroundBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ string GetColorForForeground();
+
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetColorForServiceRecordView2", ReplyAction="http://tempuri.org/IOperationsService/GetColorForServiceRecordView2Response")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetColorForServiceRecordView2BeWoFaultFault" +
"", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
@@ -6186,6 +6190,11 @@ namespace BeWo.ServiceProxy
return base.Channel.GetColorForStatus(status);
}
+ public string GetColorForForeground()
+ {
+ return base.Channel.GetColorForForeground();
+ }
+
public string GetColorForServiceRecordView2()
{
return base.Channel.GetColorForServiceRecordView2();
diff --git a/BeWo/View/Controls/DPCtrlDay.cs b/BeWo/View/Controls/DPCtrlDay.cs
index e1b3a964e..2df2f75f6 100644
--- a/BeWo/View/Controls/DPCtrlDay.cs
+++ b/BeWo/View/Controls/DPCtrlDay.cs
@@ -18,6 +18,8 @@ namespace BeWo.View.Controls
{
public class DPCtrlDay : DienstplanerControl
{
+ public static bool bemerkungVorhanden = false;
+
public static readonly DependencyProperty DPCtrlDayInformationProperty = DependencyProperty.Register(
"DPCtrlDayInformation",
typeof(DPCtrlDayInformation),
@@ -74,9 +76,20 @@ namespace BeWo.View.Controls
c.Text = $"{dc.Kurz}";
if (!info.Bemerkung.IsNullOrEmpty())
{
+ bemerkungVorhanden = true;
c.BorderThickness = new Thickness(2, 2, 2, 2);
- c.BorderBrush = Brushes.CornflowerBlue;
+ c.BorderBrush = (SolidColorBrush)new BrushConverter().ConvertFrom(ServiceFacade.DoOperationsServiceSync(se => se.GetColorForForeground()));
}
+ else
+ {
+ c.BorderThickness = new Thickness(0, 0, 0, 0);
+ c.BorderBrush = Brushes.Transparent;
+ }
+ }
+ else
+ {
+ c.BorderThickness = new Thickness(0, 0, 0, 0);
+ c.BorderBrush = Brushes.Transparent;
}
}
else
@@ -110,6 +123,10 @@ namespace BeWo.View.Controls
//MouseLeftButtonDown += DienstplanerControl_LeftMouseDown;
//MouseRightButtonDown += DienstplanerControl_RightMouseDown;
MouseDown += DienstplanerControl_MouseDown;
+
+ if(bemerkungVorhanden)
+ Path_Notice.Visibility = Visibility.Visible;
+ bemerkungVorhanden = false;
}
public new Brush Background
@@ -131,24 +148,6 @@ namespace BeWo.View.Controls
set { SetValue(DPCtrlDayInformationProperty, value); }
}
- /*private void DienstplanerControl_LeftMouseDown(object sender, MouseButtonEventArgs e)
- {
- DienstplanerView entryView = null;
-
- DependencyObject parent = VisualTreeHelper.GetParent(this);
-
- while (parent != null && entryView == null)
- {
- entryView = parent as DienstplanerView;
- var fe = parent as FrameworkElement;
- parent = fe != null ? VisualTreeHelper.GetParent(fe) : null;
- }
-
- if (entryView != null)
- {
- entryView.DienstplanerControl_LeftMouseDown(sender, e);
- }
- }*/
private void DienstplanerControl_MouseDown(object sender, MouseButtonEventArgs e)
{
DienstplanerView entryView = null;
diff --git a/BeWo/View/Controls/DienstplanerControl.xaml b/BeWo/View/Controls/DienstplanerControl.xaml
index 1f5eb4614..6cca144f3 100644
--- a/BeWo/View/Controls/DienstplanerControl.xaml
+++ b/BeWo/View/Controls/DienstplanerControl.xaml
@@ -3,5 +3,13 @@
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Report/DienstplanerView.xaml b/BeWo/View/Detail/Report/DienstplanerView.xaml
index e057db51f..e28fa3b60 100644
--- a/BeWo/View/Detail/Report/DienstplanerView.xaml
+++ b/BeWo/View/Detail/Report/DienstplanerView.xaml
@@ -10,6 +10,7 @@
xmlns:dxschi="http://schemas.devexpress.com/winfx/2008/xaml/scheduler/internal"
xmlns:XtraScheduler="clr-namespace:DevExpress.XtraScheduler;assembly=DevExpress.XtraScheduler.v17.1.Core"
xmlns:controls="clr-namespace:BeWo.View.Controls"
+ xmlns:t="clr-namespace:BeWo.MultiLanguage.Markup"
x:Class="BeWo.View.Detail.Report.DienstplanerView"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Focusable="True" Loaded="BeWoView_Loaded">
@@ -60,7 +61,7 @@
-
+
@@ -113,7 +114,7 @@
-
+
@@ -124,7 +125,7 @@
-
+
diff --git a/BeWo/View/Detail/Report/DienstplanerView.xaml.cs b/BeWo/View/Detail/Report/DienstplanerView.xaml.cs
index 4873082a9..a5e60eb65 100644
--- a/BeWo/View/Detail/Report/DienstplanerView.xaml.cs
+++ b/BeWo/View/Detail/Report/DienstplanerView.xaml.cs
@@ -550,6 +550,7 @@ namespace BeWo.View.Detail.Report
button_neuerMitarbeiter.Visibility = Visibility.Visible;
_BtnRemoveAllDiensteForMonth.Visibility = Visibility.Visible;
+ textblock_link_pdfexport.Visibility = Visibility.Visible;
}
private void FillDienstLists()
@@ -564,6 +565,13 @@ namespace BeWo.View.Detail.Report
{
popUp_neuerMitarbeiterFuerWohnheim.IsOpen = true;
+ var mitarbeiterMitVertrag = GetEmployeeForCombobox();
+
+ combobox_mitarbeiter.ItemsSource = mitarbeiterMitVertrag.OrderBy(m => m.LastName);
+ }
+
+ private List GetEmployeeForCombobox()
+ {
var alleMitarbeiter = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllActiveEmployees());
List mitarbeiterMitVertrag = new List();
@@ -573,7 +581,7 @@ namespace BeWo.View.Detail.Report
mitarbeiterMitVertrag.Add(emp);
}
-
+
foreach (var entry in _DienstDCListe)
{
for (int i = mitarbeiterMitVertrag.Count - 1; i >= 0; i--)
@@ -587,7 +595,7 @@ namespace BeWo.View.Detail.Report
}
}
- combobox_mitarbeiter.ItemsSource = mitarbeiterMitVertrag.OrderBy(m => m.LastName);
+ return mitarbeiterMitVertrag;
}
private bool CheckForContracts(EmployeeDC emp)
@@ -619,10 +627,6 @@ namespace BeWo.View.Detail.Report
_DienstEintragListe.AddRange(Init(newDC, _AlleDienste, RefreshGrid, _AuswahlMonat));
RefreshGrid();
- var emps = combobox_mitarbeiter.ItemsSource as List;
- combobox_mitarbeiter.ItemsSource = null;
- emps.Remove(emp);
- combobox_mitarbeiter.ItemsSource = emps;
popUp_neuerMitarbeiterFuerWohnheim.IsOpen = false;
}
@@ -634,6 +638,7 @@ namespace BeWo.View.Detail.Report
textbox_bemerkung.Text = "";
textbox_startzeit.Foreground = Brushes.Black;
textbox_endzeit.Foreground = Brushes.Black;
+ var foregroundColor = (SolidColorBrush)new BrushConverter().ConvertFrom(ServiceFacade.DoOperationsServiceSync(s => s.GetColorForForeground()));
_AuswahlDienstZeileDC = _GridControl.GetRow(_GridControl.View.GetRowHandleByMouseEventArgs(e)) as DienstZeileDC;
@@ -665,9 +670,9 @@ namespace BeWo.View.Detail.Report
{
combobox_dienste.SelectedItem = info;
if (TimeSpan.Parse(eintrag.Startzeit) != info.Start.TimeOfDay)
- textbox_startzeit.Foreground = Brushes.CornflowerBlue;
+ textbox_startzeit.Foreground = foregroundColor;
if (TimeSpan.Parse(eintrag.Endzeit) != info.Ende.TimeOfDay)
- textbox_endzeit.Foreground = Brushes.CornflowerBlue;
+ textbox_endzeit.Foreground = foregroundColor;
break;
}
}
@@ -695,9 +700,9 @@ namespace BeWo.View.Detail.Report
{
combobox_dienste.SelectedItem = info;
if (TimeSpan.Parse(vertretung.Startzeit) != info.Start.TimeOfDay)
- textbox_startzeit.Foreground = Brushes.CornflowerBlue;
+ textbox_startzeit.Foreground = foregroundColor;
if (TimeSpan.Parse(vertretung.Endzeit) != info.Ende.TimeOfDay)
- textbox_endzeit.Foreground = Brushes.CornflowerBlue;
+ textbox_endzeit.Foreground = foregroundColor;
break;
}
}
diff --git a/BeWo/View/Navigation/WohnheimNavigationView.xaml b/BeWo/View/Navigation/WohnheimNavigationView.xaml
index 0d72be205..7b6ffb47a 100644
--- a/BeWo/View/Navigation/WohnheimNavigationView.xaml
+++ b/BeWo/View/Navigation/WohnheimNavigationView.xaml
@@ -1,8 +1,12 @@
-
+
();
- report.SetReportDataSource(RosterRO.Create(service.GetDienstEintraege(wOid, dt.Year, dt.Month), service.GetAllDienste(), service2.GetAllActiveWohnheimeCompact().First(x => x.WohnheimOid == wOid), dt.Year, dt.Month));
+ var dienstEintraege = service.GetAllDienstEintraegeAsList(wOid, dt.Year, dt.Month);
+ var vertretungen = service.GetAllDienstvertretungenAsList(wOid, dt.Year, dt.Month);
+
+ List employeeOids = new List();
+ foreach (var eintrag in dienstEintraege)
+ {
+ if (!employeeOids.Contains(eintrag.EmployeeOid))
+ employeeOids.Add(eintrag.EmployeeOid);
+ }
+ foreach (var vertretung in vertretungen)
+ {
+ if (!employeeOids.Contains(vertretung.EmployeeOid))
+ employeeOids.Add(vertretung.EmployeeOid);
+ }
+
+ var employee = MapperFactory.EmployeeDC_Employee.MapToNewDCs(DAOFactory.GenericDAO.GetActiveByIDs(employeeOids));
+
+ //report.SetReportDataSource(RosterRO.Create(service.GetDienstEintraege(wOid, dt.Year, dt.Month), service.GetAllDienste(), service2.GetAllActiveWohnheimeCompact().First(x => x.WohnheimOid == wOid), dt.Year, dt.Month));
+ report.SetReportDataSource(RosterRO.CreateNew(dienstEintraege, vertretungen, employee,
+ service.GetAllDienste(), service2.GetAllActiveWohnheimeCompact().First(x => x.WohnheimOid == wOid), dt.Year, dt.Month));
return report as XtraReport;
}
diff --git a/Report/DefaultReports/RosterReport.Designer.cs b/Report/DefaultReports/RosterReport.Designer.cs
index 27c6f37e1..57d993415 100644
--- a/Report/DefaultReports/RosterReport.Designer.cs
+++ b/Report/DefaultReports/RosterReport.Designer.cs
@@ -32,6 +32,8 @@ namespace BeWo.Report.DefaultReports
this.components = new System.ComponentModel.Container();
this.Detail = new DevExpress.XtraReports.UI.DetailBand();
this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand();
+ this.xrLabel_Time = new DevExpress.XtraReports.UI.XRLabel();
+ this.xrLabel_Image = new DevExpress.XtraReports.UI.XRLabel();
this.lblCustomerName = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
this.DetailReport = new DevExpress.XtraReports.UI.DetailReportBand();
@@ -58,11 +60,43 @@ namespace BeWo.Report.DefaultReports
// ReportHeader
//
this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+ this.xrLabel_Time,
+ this.xrLabel_Image,
this.lblCustomerName,
this.xrLabel1});
- this.ReportHeader.HeightF = 75F;
+ this.ReportHeader.HeightF = 223.9583F;
this.ReportHeader.Name = "ReportHeader";
//
+ // xrLabel_Time
+ //
+ this.xrLabel_Time.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.xrLabel_Time.LocationFloat = new DevExpress.Utils.PointFloat(37F, 73.23335F);
+ this.xrLabel_Time.Multiline = true;
+ this.xrLabel_Time.Name = "xrLabel_Time";
+ this.xrLabel_Time.SizeF = new System.Drawing.SizeF(124.36F, 25F);
+ this.xrLabel_Time.StylePriority.UseFont = false;
+ this.xrLabel_Time.StylePriority.UseTextAlignment = false;
+ this.xrLabel_Time.Text = "\r\n";
+ this.xrLabel_Time.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
+ //
+ // xrLabel_Image
+ //
+ this.xrLabel_Image.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top)
+ | DevExpress.XtraPrinting.BorderSide.Right)
+ | DevExpress.XtraPrinting.BorderSide.Bottom)));
+ this.xrLabel_Image.BorderWidth = 0.25F;
+ this.xrLabel_Image.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.xrLabel_Image.LocationFloat = new DevExpress.Utils.PointFloat(0F, 73.22919F);
+ this.xrLabel_Image.Multiline = true;
+ this.xrLabel_Image.Name = "xrLabel_Image";
+ this.xrLabel_Image.SizeF = new System.Drawing.SizeF(25F, 25F);
+ this.xrLabel_Image.StylePriority.UseBorders = false;
+ this.xrLabel_Image.StylePriority.UseBorderWidth = false;
+ this.xrLabel_Image.StylePriority.UseFont = false;
+ this.xrLabel_Image.StylePriority.UseTextAlignment = false;
+ this.xrLabel_Image.Text = "\r\n";
+ this.xrLabel_Image.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
+ //
// lblCustomerName
//
this.lblCustomerName.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
@@ -203,5 +237,7 @@ namespace BeWo.Report.DefaultReports
private DevExpress.XtraReports.UI.TopMarginBand topMarginBand1;
private DevExpress.XtraReports.UI.BottomMarginBand bottomMarginBand1;
private DevExpress.XtraReports.UI.XRLabel lblCustomerName;
+ private DevExpress.XtraReports.UI.XRLabel xrLabel_Time;
+ private DevExpress.XtraReports.UI.XRLabel xrLabel_Image;
}
}
diff --git a/Report/DefaultReports/RosterReport.cs b/Report/DefaultReports/RosterReport.cs
index 812bcc7bf..208d8cfad 100644
--- a/Report/DefaultReports/RosterReport.cs
+++ b/Report/DefaultReports/RosterReport.cs
@@ -20,7 +20,9 @@ namespace BeWo.Report.DefaultReports
public Tuple Title { get; set; }
public Tuple[] Days { get; set; }
public Tuple[] Weeks { get; set; }
+ public Tuple Month { get; set; }
+ public DateTime monthAndYear { get; set; }
public RosterReport()
{
@@ -31,6 +33,7 @@ namespace BeWo.Report.DefaultReports
public void SetReportDataSource(RosterRO pRO)
{
int days = DateTime.DaysInMonth(pRO.ReportDateTime.Year, pRO.ReportDateTime.Month);
+ monthAndYear = new DateTime(pRO.ReportDateTime.Year, pRO.ReportDateTime.Month, 1);
Table1.BeginInit();
Table2.BeginInit();
@@ -52,16 +55,81 @@ namespace BeWo.Report.DefaultReports
if (pRO.ReportDateTime.AddDays(i).DayOfWeek == DayOfWeek.Sunday)
{
var week = Weeks[w++];
-
Row1.Cells.Add(week.Item1);
Row2.Cells.Add(week.Item2);
}
}
+ Row1.Cells.Add(Month.Item1);
+ Row2.Cells.Add(Month.Item2);
+
Table1.EndInit();
Table2.EndInit();
bindingSource1.DataSource = pRO;
+
+ List dienste = new List();
+ foreach (var dienst in pRO.RosterReportRows[0].AlleDienste)
+ dienste.Add(dienst.Value);
+
+ xrLabel_Image.Text = dienste[0].Kurz;
+ xrLabel_Image.BackColor = ColorTranslator.FromHtml(dienste[0].Farbe);
+ xrLabel_Time.Text = AdaptTime(dienste[0].Start.TimeOfDay, dienste[0].Ende.TimeOfDay);
+ dienste.RemoveAt(0);
+ int zeile = 0;
+ int elem = 1;
+ int counter = 1;
+ int schwellwert = 7;
+ foreach (var d in dienste)
+ {
+ var foreColor = TransformStringToColor(d.Farbe).IsBrighter(70) ? Color.Black : Color.White;
+
+ this.ReportHeader.Controls.Add(
+ new XRLabel()
+ {
+ LocationF = new PointF(xrLabel_Image.WidthF * elem + xrLabel_Time.WidthF * elem, xrLabel_Time.LocationF.Y + zeile * (xrLabel_Image.HeightF + 10)),
+ Font = xrLabel_Image.Font,
+ TextAlignment = xrLabel_Image.TextAlignment,
+ WidthF = xrLabel_Image.WidthF,
+ HeightF = xrLabel_Image.HeightF,
+ Borders = xrLabel_Image.Borders,
+ BorderWidth = xrLabel_Image.BorderWidth,
+ BackColor = ColorTranslator.FromHtml(d.Farbe),
+ ForeColor = foreColor,
+ Text = d.Kurz
+ });
+ this.ReportHeader.Controls.Add(
+ new XRLabel()
+ {
+ LocationF = new PointF(xrLabel_Image.WidthF * (elem + 1) + xrLabel_Time.WidthF * elem + 12f, xrLabel_Time.LocationF.Y + zeile * (xrLabel_Time.HeightF + 10)),
+ Font = xrLabel_Time.Font,
+ TextAlignment = xrLabel_Time.TextAlignment,
+ WidthF = xrLabel_Time.WidthF,
+ HeightF = xrLabel_Time.HeightF,
+ Text = AdaptTime(d.Start.TimeOfDay, d.Ende.TimeOfDay)
+ });
+
+ elem++;
+ counter++;
+
+ if (counter % schwellwert == 0) //Hier muss Wert für x wieder resettet werden
+ {
+ zeile++;
+ elem = 0;
+ if (schwellwert == 7)
+ schwellwert++;
+ counter = 1;
+ }
+
+ }
+ }
+
+ private string AdaptTime(TimeSpan start, TimeSpan ende)
+ {
+ string[] startArray = start.ToString().Split(':');
+ string[] endeArray = ende.ToString().Split(':');
+
+ return startArray[0] + ":" + startArray[1] + " - " + endeArray[0] + ":" + endeArray[1];
}
private void InitializeComponent2()
@@ -75,7 +143,7 @@ namespace BeWo.Report.DefaultReports
Table2.BeginInit();
- Table1.BackColor = System.Drawing.Color.LightSteelBlue;
+ Table1.BackColor = System.Drawing.Color.LightBlue;
Table1.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) | DevExpress.XtraPrinting.BorderSide.Bottom)));
Table1.Font = new System.Drawing.Font("Arial", 7F, System.Drawing.FontStyle.Bold);
Table1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
@@ -124,10 +192,9 @@ namespace BeWo.Report.DefaultReports
for (int i = 0; i < Days.Length; i++)
{
var dayColumn = CreateColumn(0x0C, $"{i + 1}.", 0.08, false);
-
+ monthAndYear = new DateTime(monthAndYear.Year, monthAndYear.Month, i + 1);
dayColumn.Item2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, $"RosterReportRows.Day{ i + 1 }") });
dayColumn.Item2.EvaluateBinding += new DevExpress.XtraReports.UI.BindingEventHandler(this.Cell_EvaluateBinding);
-
Days[i] = dayColumn;
}
@@ -141,6 +208,9 @@ namespace BeWo.Report.DefaultReports
Weeks[i] = weekColumns;
}
+ var monthColumn = CreateColumn(0x0D, "Month", 0.16, false);
+ monthColumn.Item2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "RosterReportRows.MonthSum", "{0:F2}" )});
+ Month = monthColumn;
PageHeader.Controls.Add(Table1);
@@ -193,5 +263,13 @@ namespace BeWo.Report.DefaultReports
cell.ForeColor = Color.Black;
}
}
+
+ private System.Windows.Media.Color TransformStringToColor(string colorString)
+ {
+ int argb = Int32.Parse(colorString.Replace("#", ""), NumberStyles.HexNumber);
+ var clr = Color.FromArgb(argb);
+
+ return System.Windows.Media.Color.FromRgb(clr.R, clr.G, clr.B);
+ }
}
}
diff --git a/Report/ReportObjects/RosterRO.cs b/Report/ReportObjects/RosterRO.cs
index 81a68e21a..a9df396af 100644
--- a/Report/ReportObjects/RosterRO.cs
+++ b/Report/ReportObjects/RosterRO.cs
@@ -80,18 +80,261 @@ namespace BeWo.Report.ReportObjects
row.WeekSum = sum;
}
+ return res;
+ }
+ public static RosterRO CreateNew(List dienstEintragDCs, List dienstvertretungDCs, List employee, List dienstInfoDCs, BS.Shared.DataContracts.Compact.CompactWohnheimDC compactWohnheimDC, int year, int month)
+ {
+ var dt = new DateTime(year, month, 1);
+ // Result
+ var res = new RosterRO()
+ {
+ WohnheimName = compactWohnheimDC.WohnheimName,
+ ReportDateTime = dt,
+ FirstWeekDay = ((int)dt.DayOfWeek - 1) % 7
+ };
+ // WD V F Formel
+ // Mo 1 0 (tag - 1) / 7
+ // Di 2 1 (tag + 0) / 7
+ // Mi 3 2 (tag + 1) / 7
+ // Do 4 3 (tag + 2) / 7
+ // Fr 5 4 (tag + 3) / 7
+ // Sa 6 5 (tag + 4) / 7
+ // So 0 6 (tag + 5) / 7
+ //
+ // int week = (day + res.FirstWeekDay - 1) / 7;
+
+
+ var infoDict = dienstInfoDCs.ToDictionary(x => x.Oid.Value, x => x); //alle Dienste
+ List> alleEintraegeSortiert = EintraegeSortieren(dienstEintragDCs);
+ List> alleVertretungenSortiert = VertretungenSortieren(dienstvertretungDCs);
+
+ res = EintraegeEinfuegen(res, alleEintraegeSortiert, employee, infoDict);
+ res = VertretungenEinfuegen(res, alleVertretungenSortiert, employee, infoDict);
+ return res;
+ }
+
+ private static List> EintraegeSortieren(List dienstEintragDCs)
+ {
+ List> alleEintraegeSortiert = new List>();
+
+ List empOids = new List();
+ foreach (var eintrag in dienstEintragDCs)
+ {
+ if (!empOids.Contains(eintrag.EmployeeOid))
+ empOids.Add(eintrag.EmployeeOid);
+ }
+
+ foreach (var oid in empOids)
+ {
+ List eintraegeProMitarbeiter = new List();
+
+ foreach (var eintrag in dienstEintragDCs)
+ {
+ if (eintrag.EmployeeOid == oid)
+ eintraegeProMitarbeiter.Add(eintrag);
+ }
+
+ alleEintraegeSortiert.Add(eintraegeProMitarbeiter);
+ }
+
+ return alleEintraegeSortiert;
+ }
+ private static List> VertretungenSortieren(List dienstvertetungDCs)
+ {
+ List> allevertretungenSortiert = new List>();
+
+ List empOids = new List();
+ foreach (var vertretung in dienstvertetungDCs)
+ {
+ if (!empOids.Contains(vertretung.EmployeeOid))
+ empOids.Add(vertretung.EmployeeOid);
+ }
+
+ foreach (var oid in empOids)
+ {
+ List vertretungenProMitarbeiter = new List();
+
+ foreach (var vertretung in dienstvertetungDCs)
+ {
+ if (vertretung.EmployeeOid == oid)
+ vertretungenProMitarbeiter.Add(vertretung);
+ }
+
+ allevertretungenSortiert.Add(vertretungenProMitarbeiter);
+ }
+
+ return allevertretungenSortiert;
+ }
+ private static RosterRO EintraegeEinfuegen(RosterRO res, List> alleEintraegeSortiert, List employee, Dictionary infoDict)
+ {
+ foreach (var block in alleEintraegeSortiert)
+ {
+ RosterReportRow row = null;
+ double[] sum = new double[6];
+ List[] eintraegeNachZeilen = new List[3];
+ eintraegeNachZeilen[0] = new List();
+ eintraegeNachZeilen[1] = new List();
+ eintraegeNachZeilen[2] = new List();
+
+ foreach (var b in block)
+ eintraegeNachZeilen[b.Zeile].Add(b);
+
+ EmployeeDC currentEmployee = new EmployeeDC();
+ double monthlyHours = 0;
+ for (int i = 0; i < eintraegeNachZeilen.Length; i++)
+ {
+ var aktuellerBlock = eintraegeNachZeilen[i];
+
+ row = new RosterReportRow()
+ {
+ Pos = i,
+ DienstDict = new Dictionary(),
+ AlleDienste = infoDict
+ };
+
+ EmployeeDC emp = new EmployeeDC();
+ foreach (var e in employee)
+ {
+ foreach (var b in aktuellerBlock)
+ {
+ if (b.EmployeeOid == e.EmployeeOid)
+ {
+ emp = e;
+ currentEmployee = e;
+ break;
+ }
+ }
+ if (emp.EmployeeOid != null)
+ break;
+ }
+
+ if (i % 2 == 0 && i != 0)
+ {
+ res.RosterReportRows[res.RosterReportRows.Count - 1 - 1].Title = currentEmployee.LastNameFirstName;
+ currentEmployee = new EmployeeDC();
+ }
+
+ DienstInfoDC dienst = null;
+ foreach (var b in aktuellerBlock)
+ {
+ foreach (var d in infoDict)
+ {
+ if (d.Value.Oid == b.DienstOid)
+ {
+ dienst = d.Value;
+ break;
+ }
+ }
+ var day = b.Datum.Day;
+ row.DienstDict.Add(day, dienst);
+
+ int week = (day + res.FirstWeekDay - 1) / 7;
+ sum[week] += b.DauerInStunden;
+ monthlyHours += b.DauerInStunden;
+
+ }
+ res.RosterReportRows.Add(row);
+ }
+
+ row.WeekSum = sum;
+ row.MonthSum = monthlyHours;
+ }
+
+ return res;
+ }
+ private static RosterRO VertretungenEinfuegen(RosterRO res, List> alleVertretungenSortiert, List employee, Dictionary infoDict)
+ {
+ foreach (var block in alleVertretungenSortiert)
+ {
+ RosterReportRow row = null;
+ double[] sum = new double[6];
+ List[] vertretungenNachZeilen = new List[3];
+ vertretungenNachZeilen[0] = new List();
+ vertretungenNachZeilen[1] = new List();
+ vertretungenNachZeilen[2] = new List();
+
+ foreach (var b in block)
+ vertretungenNachZeilen[b.Zeile].Add(b);
+
+ EmployeeDC currentEmployee = new EmployeeDC();
+ double monthlyHours = 0;
+ for (int i = 0; i < vertretungenNachZeilen.Length; i++)
+ {
+ var aktuellerBlock = vertretungenNachZeilen[i];
+
+ row = new RosterReportRow()
+ {
+ Pos = i,
+ DienstDict = new Dictionary(),
+ AlleDienste = infoDict
+ };
+
+ EmployeeDC emp = new EmployeeDC();
+ foreach (var e in employee)
+ {
+ foreach (var b in aktuellerBlock)
+ {
+ if (b.EmployeeOid == e.EmployeeOid)
+ {
+ emp = e;
+ currentEmployee = e;
+ break;
+ }
+ }
+ if (emp.EmployeeOid != null)
+ break;
+ }
+
+ if (i % 2 == 0 && i != 0)
+ {
+ res.RosterReportRows[res.RosterReportRows.Count - 1 - 1].Title = currentEmployee.LastNameFirstName;
+ currentEmployee = new EmployeeDC();
+ }
+ //row.Title = i == 0 ? emp.LastNameFirstName : null;
+
+ DienstInfoDC dienst = null;
+ foreach (var b in aktuellerBlock)
+ {
+ foreach (var d in infoDict)
+ {
+ if (d.Value.Oid == b.DienstOid)
+ {
+ dienst = d.Value;
+ break;
+ }
+ }
+ var day = b.Datum.Day;
+ row.DienstDict.Add(day, dienst);
+
+ int week = (day + res.FirstWeekDay - 1) / 7;
+ sum[week] += b.DauerInStunden;
+ monthlyHours += b.DauerInStunden;
+ }
+ res.RosterReportRows.Add(row);
+ }
+
+ row.WeekSum = sum;
+ row.MonthSum = (double)monthlyHours;
+
+ }
+
return res;
}
}
+
public class RosterReportRow
{
+ public Dictionary AlleDienste { get; set; }
+
public string Title { get; set; }
public int Pos { get; set; }
public double[] WeekSum { get; set; }
+ public double? MonthSum { get; set; }
+
public Dictionary DienstDict { get; set; }
public double? Week1 => WeekSum?[0];
diff --git a/Service/Dienstplanung/DienstplanungsManager.cs b/Service/Dienstplanung/DienstplanungsManager.cs
index c168da29d..92a0215be 100644
--- a/Service/Dienstplanung/DienstplanungsManager.cs
+++ b/Service/Dienstplanung/DienstplanungsManager.cs
@@ -9,6 +9,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Windows.Media;
namespace BeWo.Service.Dienstplanung
{
@@ -304,7 +305,10 @@ namespace BeWo.Service.Dienstplanung
{
return (status) ? "#FF228B22" : "#FFCD5C5C";
}
-
+ public static string GetColorForForeground()
+ {
+ return "#FF6495ED";
+ }
diff --git a/Service/Plugins/TranslationDictionary.cs b/Service/Plugins/TranslationDictionary.cs
index 3b0b8a7ab..77e7ce8fd 100644
--- a/Service/Plugins/TranslationDictionary.cs
+++ b/Service/Plugins/TranslationDictionary.cs
@@ -18,7 +18,7 @@ namespace BeWo.Service.Plugins
public virtual Dictionary GetTranslationDictionary()
{
var dict = new Dictionary();
-
+
AddOrReplaceTranslation(dict, "MitarbeiterSingular", "Mitarbeiter");
AddOrReplaceTranslation(dict, "MitarbeiterPlural", "Mitarbeiter");
@@ -32,7 +32,7 @@ namespace BeWo.Service.Plugins
AddOrReplaceTranslation(dict, "HilfepläneMenuItem", "Hilfepläne");
AddOrReplaceTranslation(dict, "KlientenMenuItem", "Klienten");
AddOrReplaceTranslation(dict, "KliententeamsMenuItem", "Kliententeams");
- AddOrReplaceTranslation(dict, "WohnheimeMenuItem", "Wohnheime");
+ AddOrReplaceTranslation(dict, "WohnheimeMenuItem", "Wohnprojekte");
AddOrReplaceTranslation(dict, "OrganisationenMenuItem", "Organisationen");
AddOrReplaceTranslation(dict, "PersonenMenuItem", "Personen");
AddOrReplaceTranslation(dict, "MitarbeiterMenuItem", "Mitarbeiter");
diff --git a/Service/ServiceContracts/IOperationsService.cs b/Service/ServiceContracts/IOperationsService.cs
index 3603bfdfc..b6f1b88bb 100644
--- a/Service/ServiceContracts/IOperationsService.cs
+++ b/Service/ServiceContracts/IOperationsService.cs
@@ -1123,6 +1123,10 @@ namespace BeWo.Service.ServiceContracts
[OperationContract]
string GetColorForStatus(bool status);
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ string GetColorForForeground();
+
[FaultContract(typeof(BeWoFault))]
[OperationContract]
string GetColorForServiceRecordView2();
diff --git a/Service/ServiceImplementations/OperationsServiceImp.cs b/Service/ServiceImplementations/OperationsServiceImp.cs
index 0272dddbf..ca2a2aa51 100644
--- a/Service/ServiceImplementations/OperationsServiceImp.cs
+++ b/Service/ServiceImplementations/OperationsServiceImp.cs
@@ -6649,6 +6649,18 @@ namespace BeWo.Service.ServiceImplementations
}
}
+ public string GetColorForForeground()
+ {
+ try
+ {
+ return DienstplanungsManager.GetColorForForeground();
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
public string GetColorForServiceRecordView2()
{
try
diff --git a/Shared/DataContracts/DienstInfoDC.cs b/Shared/DataContracts/DienstInfoDC.cs
index a5d9748a7..7a03eefaa 100644
--- a/Shared/DataContracts/DienstInfoDC.cs
+++ b/Shared/DataContracts/DienstInfoDC.cs
@@ -41,14 +41,15 @@ namespace BS.Shared.DataContracts
public override string ToString()
{
- string vonStunden = Start.TimeOfDay.Hours < 10 ? "0" + Start.TimeOfDay.Hours : Start.TimeOfDay.Hours.ToString();
- string vonMinuten = Start.TimeOfDay.Minutes < 10 ? "0" + Start.TimeOfDay.Minutes : Start.TimeOfDay.Minutes.ToString();
- string bisStunden = Ende.TimeOfDay.Hours < 10 ? "0" + Ende.TimeOfDay.Hours : Ende.TimeOfDay.Hours.ToString();
- string bisMinuten = Ende.TimeOfDay.Minutes < 10 ? "0" + Ende.TimeOfDay.Minutes : Ende.TimeOfDay.Minutes.ToString();
+ //string vonStunden = Start.TimeOfDay.Hours < 10 ? "0" + Start.TimeOfDay.Hours : Start.TimeOfDay.Hours.ToString();
+ //string vonMinuten = Start.TimeOfDay.Minutes < 10 ? "0" + Start.TimeOfDay.Minutes : Start.TimeOfDay.Minutes.ToString();
+ //string bisStunden = Ende.TimeOfDay.Hours < 10 ? "0" + Ende.TimeOfDay.Hours : Ende.TimeOfDay.Hours.ToString();
+ //string bisMinuten = Ende.TimeOfDay.Minutes < 10 ? "0" + Ende.TimeOfDay.Minutes : Ende.TimeOfDay.Minutes.ToString();
- string vonbis = vonStunden + ":" + vonMinuten + " Uhr - " + bisStunden + ":" + bisMinuten + " Uhr";
- return string.IsNullOrEmpty(Kurz) ? "" : vonbis + " (" + DienstName + ")";
+ //string vonbis = vonStunden + ":" + vonMinuten + " Uhr - " + bisStunden + ":" + bisMinuten + " Uhr";
+ //return string.IsNullOrEmpty(Kurz) ? "" : vonbis + " (" + DienstName + ")";
//return $"ID:{Oid}|N:{DienstName}|K:{Kurz}";
+ return Kurz;
}
public override bool Equals(object obj)
@@ -76,7 +77,14 @@ namespace BS.Shared.DataContracts
{
get
{
- return ToString();
+ string vonStunden = Start.TimeOfDay.Hours < 10 ? "0" + Start.TimeOfDay.Hours : Start.TimeOfDay.Hours.ToString();
+ string vonMinuten = Start.TimeOfDay.Minutes < 10 ? "0" + Start.TimeOfDay.Minutes : Start.TimeOfDay.Minutes.ToString();
+ string bisStunden = Ende.TimeOfDay.Hours < 10 ? "0" + Ende.TimeOfDay.Hours : Ende.TimeOfDay.Hours.ToString();
+ string bisMinuten = Ende.TimeOfDay.Minutes < 10 ? "0" + Ende.TimeOfDay.Minutes : Ende.TimeOfDay.Minutes.ToString();
+
+ string vonbis = vonStunden + ":" + vonMinuten + " Uhr - " + bisStunden + ":" + bisMinuten + " Uhr";
+ return string.IsNullOrEmpty(Kurz) ? "" : vonbis + " (" + DienstName + ")";
+ //return ToString();
//var startHour = Start.Hour < 10 ? "0" + Start.Hour.ToString() : Start.Hour.ToString();
//var startMinute = Start.Minute < 10 ? "0" + Start.Minute.ToString() : Start.Minute.ToString();
//var endeHour = Ende.Hour < 10 ? "0" + Ende.Hour.ToString() : Ende.Hour.ToString();