From 34ff768dde400d7040d48fc36de773a86f941c98 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 29 Oct 2023 21:33:19 +0100 Subject: [PATCH] Version 3.17 --- BeWo/BeWo.csproj | 160 +++--- BeWo/BeWoApp.xaml.cs | 4 +- .../TagesVertretung.cs | 2 + .../SchulbegleitenderDienst/TagesansichtVM.cs | 4 + .../VertretungsMainViewV2.xaml | 4 +- .../VertretungsSearchView.xaml.cs | 10 +- Data/Access/SearchDAO.cs | 4 +- Model/Changes_alle_fuer_neue_db.txt | 6 +- .../SBDCharacteristicsReport.Designer.cs | 1 - .../SBDEmployeeReport.Designer.cs | 536 ++++++++++++++++++ ReportImp/SHKServiceSBD/SBDEmployeeReport.cs | 117 ++++ .../SHKServiceSBD/SBDEmployeeReport.resx | 123 ++++ ReportImp/SHKServiceSBD/SHKServiceSBD.csproj | 10 + .../Service/CustomVertretungsManager.cs | 1 + Service/Plugins/EmployeeService.cs | 7 +- Service/Plugins/UserService.cs | 65 ++- Service/SBD/VertretungsManager.cs | 54 +- .../AnalysisServiceImp.cs | 2 +- Shared/DataContracts/VertretungsItemDC.cs | 6 + 19 files changed, 1011 insertions(+), 105 deletions(-) create mode 100644 ReportImp/SHKServiceSBD/SBDEmployeeReport.Designer.cs create mode 100644 ReportImp/SHKServiceSBD/SBDEmployeeReport.cs create mode 100644 ReportImp/SHKServiceSBD/SBDEmployeeReport.resx diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index 3519ef4e1..ca0d8d53d 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -43,12 +43,12 @@ de-DE BeWoPlaner ownSoft GmbH - 2.0.1.228 + 2.0.1.230 true publish.htm false true - 229 + 231 2.0.1.%2a false true @@ -2555,392 +2555,392 @@ False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly False - Include - True + Include + True Assembly diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs index 1e917648f..ebebee1c3 100644 --- a/BeWo/BeWoApp.xaml.cs +++ b/BeWo/BeWoApp.xaml.cs @@ -49,8 +49,8 @@ namespace BeWo public static LoginControl LoginControl; public static MainControl MainControl; - public static string ShortVersion = "3.16"; - public static string Version = "Version 3.16"; + public static string ShortVersion = "3.17"; + public static string Version = "Version 3.17"; public static int RenderTier = 0; diff --git a/BeWo/SchulbegleitenderDienst/TagesVertretung.cs b/BeWo/SchulbegleitenderDienst/TagesVertretung.cs index 3e80a3d5e..5a9511746 100644 --- a/BeWo/SchulbegleitenderDienst/TagesVertretung.cs +++ b/BeWo/SchulbegleitenderDienst/TagesVertretung.cs @@ -62,6 +62,8 @@ namespace BeWo.SchulbegleitenderDienst EmployeeAddressString = vertretungsItem.EmployeeAddressString, Id = vertretungsItem.Id, AssistanceTimeEntry = vertretungsItem.AssistanceTime, + AlleBetreuungszeiten = vertretungsItem.AlleBetreuungszeiten, + BetreuungszeitenAmDatum = vertretungsItem.BetreuungszeitenAmDatum, MailCustomer = vertretungsItem.MailCustomer, MailEmployee = vertretungsItem.MailEmployee, MailVertretung = vertretungsItem.MailVertretung, diff --git a/BeWo/SchulbegleitenderDienst/TagesansichtVM.cs b/BeWo/SchulbegleitenderDienst/TagesansichtVM.cs index 244ecfb45..7e040d24a 100644 --- a/BeWo/SchulbegleitenderDienst/TagesansichtVM.cs +++ b/BeWo/SchulbegleitenderDienst/TagesansichtVM.cs @@ -271,5 +271,9 @@ namespace BeWo.SchulbegleitenderDienst public Guid Id { get; set; } public ArbeitszeitEintragDC AssistanceTimeEntry { get; set; } + + public string AlleBetreuungszeiten { get; set; } + + public string BetreuungszeitenAmDatum { get; set; } } } diff --git a/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml b/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml index 2281d284f..0d18e8568 100644 --- a/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml +++ b/BeWo/SchulbegleitenderDienst/VertretungsMainViewV2.xaml @@ -337,7 +337,7 @@ - + @@ -425,7 +425,7 @@ - + diff --git a/BeWo/SchulbegleitenderDienst/VertretungsSearchView.xaml.cs b/BeWo/SchulbegleitenderDienst/VertretungsSearchView.xaml.cs index fe91aa0f4..55126fa07 100644 --- a/BeWo/SchulbegleitenderDienst/VertretungsSearchView.xaml.cs +++ b/BeWo/SchulbegleitenderDienst/VertretungsSearchView.xaml.cs @@ -206,8 +206,7 @@ namespace BeWo.SchulbegleitenderDienst { lblCustomerName.Content = string.Empty; lblSchoolName.Content = string.Empty; - lblBetreuungszeiten.Content = string.Empty; - + if (_Tagesansicht.Customer != null) { lblCustomerName.Content = String.Format("{0}\n{1}\n{2} {3}", _Tagesansicht.Customer.Name, @@ -223,11 +222,8 @@ namespace BeWo.SchulbegleitenderDienst // _Tagesansicht.Schule.Street, _Tagesansicht.Schule.PostalCode, _Tagesansicht.Schule.Town); } - if (_Tagesansicht.AssistanceTimeEntry != null) - { - lblBetreuungszeiten.Content = _Tagesansicht.AssistanceTimeEntry.ToString(); - } - + lblBetreuungszeiten.Content = _Tagesansicht.AlleBetreuungszeiten; + //"Montag 09:00 - 12:00\nDienstag 10:00 - 11:00\nMittwoch 08:00 - 12:00\nDonnerstag 08:00 - 12:00\nFreitag 08:00 - 12:00"; } diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs index ffbb0dd5a..2c4020854 100644 --- a/Data/Access/SearchDAO.cs +++ b/Data/Access/SearchDAO.cs @@ -583,12 +583,12 @@ namespace BeWo.Data.Access .List(); } - public IEnumerable FindLastLogins(string loginName) + public IEnumerable FindLastLogins(string loginName, int maxResults) { return CreateCriteria() .Add(Restrictions.Eq(Login.PropertyName_LoginName, loginName)) .AddOrder(Order.Desc("Oid")) - .SetMaxResults(10) + .SetMaxResults(maxResults) .List(); } diff --git a/Model/Changes_alle_fuer_neue_db.txt b/Model/Changes_alle_fuer_neue_db.txt index bdbd95cb6..aca6c6551 100644 --- a/Model/Changes_alle_fuer_neue_db.txt +++ b/Model/Changes_alle_fuer_neue_db.txt @@ -960,11 +960,13 @@ ALTER TABLE `Employee2Customer` ADD COLUMN `EndDate` datetime NULL; ALTER TABLE `Mandator` ADD COLUMN `LastModules` MEDIUMTEXT NULL; -ALTER TABLE `AbsenceReason` ADD COLUMN `Sichtbarkeit` int NULL; - ALTER TABLE `validationmessage` ADD COLUMN `ServiceCategory` VARCHAR(512) NULL DEFAULT NULL AFTER `SupportConceptOid`, ADD COLUMN `ServiceDescription` VARCHAR(512) NULL DEFAULT NULL AFTER `ServiceCategory`; + +ALTER TABLE `AbsenceReason` ADD COLUMN `Sichtbarkeit` int NULL; + + ALTER TABLE `feiertag` ADD COLUMN `OrganisationOid` BIGINT NULL DEFAULT NULL; diff --git a/ReportImp/SHKServiceSBD/SBDCharacteristicsReport.Designer.cs b/ReportImp/SHKServiceSBD/SBDCharacteristicsReport.Designer.cs index 6bb95f6bd..18b0b7bee 100644 --- a/ReportImp/SHKServiceSBD/SBDCharacteristicsReport.Designer.cs +++ b/ReportImp/SHKServiceSBD/SBDCharacteristicsReport.Designer.cs @@ -119,7 +119,6 @@ namespace SHKServiceSBD this.xrLabel12.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrLabel12.Font = new System.Drawing.Font("Arial", 10F); this.xrLabel12.LocationFloat = new DevExpress.Utils.PointFloat(139.5801F, 0F); this.xrLabel12.Multiline = true; this.xrLabel12.Name = "xrLabel12"; diff --git a/ReportImp/SHKServiceSBD/SBDEmployeeReport.Designer.cs b/ReportImp/SHKServiceSBD/SBDEmployeeReport.Designer.cs new file mode 100644 index 000000000..1aa80a937 --- /dev/null +++ b/ReportImp/SHKServiceSBD/SBDEmployeeReport.Designer.cs @@ -0,0 +1,536 @@ +using BeWo.Report.ReportObjects; +namespace SHKServiceSBD +{ + partial class SBDEmployeeReport + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.Detail = new DevExpress.XtraReports.UI.DetailBand(); + this.PageFooter = new DevExpress.XtraReports.UI.PageFooterBand(); + this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); + this.topMarginBand1 = new DevExpress.XtraReports.UI.TopMarginBand(); + this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand(); + this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); + this.xrLabel12 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel(); + this.lblAlter2 = new DevExpress.XtraReports.UI.XRLabel(); + this.lblAlter = new DevExpress.XtraReports.UI.XRLabel(); + this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); + this.tableBetreuungszeiten = new DevExpress.XtraReports.UI.XRTable(); + this.rowBetreuungszeiten = new DevExpress.XtraReports.UI.XRTableRow(); + this.cell1 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell7 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel6 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel7 = new DevExpress.XtraReports.UI.XRLabel(); + this.lblWohnort = new DevExpress.XtraReports.UI.XRLabel(); + this.GroupHeader3 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.GroupHeader4 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.GroupHeader5 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.GroupHeader6 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.chkPflege = new DevExpress.XtraReports.UI.XRCheckBox(); + this.chkKlo = new DevExpress.XtraReports.UI.XRCheckBox(); + this.chkAggro = new DevExpress.XtraReports.UI.XRCheckBox(); + this.xrLabel28 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); + this.xrTableRow3 = new DevExpress.XtraReports.UI.XRTableRow(); + this.cellAusschlussKrits = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrLabel21 = new DevExpress.XtraReports.UI.XRLabel(); + this.lblAllgBemerkungen = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel13 = new DevExpress.XtraReports.UI.XRLabel(); + this.lblQuali = new DevExpress.XtraReports.UI.XRLabel(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.tableBetreuungszeiten)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); + // + // Detail + // + this.Detail.Font = new System.Drawing.Font("Arial", 10F); + this.Detail.HeightF = 0F; + this.Detail.Name = "Detail"; + this.Detail.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); + this.Detail.StylePriority.UseFont = false; + this.Detail.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; + // + // PageFooter + // + this.PageFooter.HeightF = 0F; + this.PageFooter.Name = "PageFooter"; + this.PageFooter.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); + this.PageFooter.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; + // + // bindingSource1 + // + this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.SBDEmployeeRO); + // + // topMarginBand1 + // + this.topMarginBand1.HeightF = 75F; + this.topMarginBand1.Name = "topMarginBand1"; + // + // bottomMarginBand1 + // + this.bottomMarginBand1.HeightF = 75F; + this.bottomMarginBand1.Name = "bottomMarginBand1"; + // + // ReportHeader + // + this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel7, + this.lblWohnort, + this.xrLabel4, + this.xrLabel6, + this.xrLabel2, + this.xrLabel3, + this.xrLabel12, + this.xrLabel5, + this.lblAlter2, + this.lblAlter}); + this.ReportHeader.HeightF = 120F; + this.ReportHeader.Name = "ReportHeader"; + // + // xrLabel12 + // + this.xrLabel12.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrLabel12.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "FirstName")}); + this.xrLabel12.LocationFloat = new DevExpress.Utils.PointFloat(95.41341F, 0F); + this.xrLabel12.Multiline = true; + this.xrLabel12.Name = "xrLabel12"; + this.xrLabel12.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel12.SizeF = new System.Drawing.SizeF(179.1633F, 23.99999F); + this.xrLabel12.StylePriority.UseBorders = false; + this.xrLabel12.StylePriority.UseFont = false; + // + // xrLabel5 + // + this.xrLabel5.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); + this.xrLabel5.Name = "xrLabel5"; + this.xrLabel5.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel5.SizeF = new System.Drawing.SizeF(95.41341F, 24F); + this.xrLabel5.StylePriority.UseFont = false; + this.xrLabel5.Text = "Vorname"; + // + // lblAlter2 + // + this.lblAlter2.LocationFloat = new DevExpress.Utils.PointFloat(321.0004F, 0F); + this.lblAlter2.Name = "lblAlter2"; + this.lblAlter2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblAlter2.SizeF = new System.Drawing.SizeF(73.99963F, 24F); + this.lblAlter2.StylePriority.UseFont = false; + this.lblAlter2.Text = "Alter"; + // + // lblAlter + // + this.lblAlter.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.lblAlter.LocationFloat = new DevExpress.Utils.PointFloat(395F, 0F); + this.lblAlter.Multiline = true; + this.lblAlter.Name = "lblAlter"; + this.lblAlter.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblAlter.SizeF = new System.Drawing.SizeF(59.58008F, 24F); + this.lblAlter.StylePriority.UseBorders = false; + this.lblAlter.StylePriority.UseFont = false; + this.lblAlter.Text = "Alter"; + // + // GroupHeader1 + // + this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel1, + this.tableBetreuungszeiten}); + this.GroupHeader1.HeightF = 51.99997F; + this.GroupHeader1.Level = 4; + this.GroupHeader1.Name = "GroupHeader1"; + // + // xrLabel1 + // + this.xrLabel1.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; + this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 10F); + this.xrLabel1.Name = "xrLabel1"; + this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel1.SizeF = new System.Drawing.SizeF(642.0001F, 24F); + this.xrLabel1.StylePriority.UseBorders = false; + this.xrLabel1.StylePriority.UseFont = false; + this.xrLabel1.Text = "Arbeitszeiten"; + // + // tableBetreuungszeiten + // + this.tableBetreuungszeiten.LocationFloat = new DevExpress.Utils.PointFloat(0F, 33.99997F); + this.tableBetreuungszeiten.Name = "tableBetreuungszeiten"; + this.tableBetreuungszeiten.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { + this.rowBetreuungszeiten}); + this.tableBetreuungszeiten.SizeF = new System.Drawing.SizeF(642F, 18F); + this.tableBetreuungszeiten.StylePriority.UseFont = false; + // + // rowBetreuungszeiten + // + this.rowBetreuungszeiten.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { + this.cell1, + this.xrTableCell5, + this.xrTableCell6, + this.xrTableCell7}); + this.rowBetreuungszeiten.Name = "rowBetreuungszeiten"; + this.rowBetreuungszeiten.Weight = 1.125D; + // + // cell1 + // + this.cell1.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.cell1.Name = "cell1"; + this.cell1.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.cell1.StylePriority.UseBorders = false; + this.cell1.StylePriority.UseFont = false; + this.cell1.StylePriority.UsePadding = false; + this.cell1.Weight = 0.17912772585669781D; + // + // xrTableCell5 + // + this.xrTableCell5.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTableCell5.Name = "xrTableCell5"; + this.xrTableCell5.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.xrTableCell5.StylePriority.UseBorders = false; + this.xrTableCell5.StylePriority.UseFont = false; + this.xrTableCell5.StylePriority.UsePadding = false; + this.xrTableCell5.Weight = 0.21806848829037673D; + // + // xrTableCell6 + // + this.xrTableCell6.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTableCell6.Name = "xrTableCell6"; + this.xrTableCell6.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.xrTableCell6.StylePriority.UseBorders = false; + this.xrTableCell6.StylePriority.UsePadding = false; + this.xrTableCell6.Weight = 0.21806858336071358D; + // + // xrTableCell7 + // + this.xrTableCell7.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTableCell7.Name = "xrTableCell7"; + this.xrTableCell7.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.xrTableCell7.StylePriority.UseBorders = false; + this.xrTableCell7.StylePriority.UseFont = false; + this.xrTableCell7.StylePriority.UsePadding = false; + this.xrTableCell7.Weight = 0.38473520249221183D; + // + // xrLabel2 + // + this.xrLabel2.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrLabel2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "LastName")}); + this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(95.41341F, 30F); + this.xrLabel2.Multiline = true; + this.xrLabel2.Name = "xrLabel2"; + this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel2.SizeF = new System.Drawing.SizeF(179.1633F, 23.99999F); + this.xrLabel2.StylePriority.UseBorders = false; + this.xrLabel2.StylePriority.UseFont = false; + // + // xrLabel3 + // + this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(0F, 30F); + this.xrLabel3.Name = "xrLabel3"; + this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel3.SizeF = new System.Drawing.SizeF(95.41341F, 24F); + this.xrLabel3.StylePriority.UseFont = false; + this.xrLabel3.Text = "Nachname"; + // + // xrLabel4 + // + this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(0F, 60F); + this.xrLabel4.Name = "xrLabel4"; + this.xrLabel4.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel4.SizeF = new System.Drawing.SizeF(95.41341F, 24F); + this.xrLabel4.StylePriority.UseFont = false; + this.xrLabel4.Text = "Tel"; + // + // xrLabel6 + // + this.xrLabel6.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrLabel6.LocationFloat = new DevExpress.Utils.PointFloat(95.41341F, 60F); + this.xrLabel6.Multiline = true; + this.xrLabel6.Name = "xrLabel6"; + this.xrLabel6.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel6.SizeF = new System.Drawing.SizeF(179.16F, 50F); + this.xrLabel6.StylePriority.UseBorders = false; + this.xrLabel6.StylePriority.UseFont = false; + this.xrLabel6.Text = "[Mobile]\r\n[Phone]"; + // + // xrLabel7 + // + this.xrLabel7.LocationFloat = new DevExpress.Utils.PointFloat(321.0004F, 60F); + this.xrLabel7.Name = "xrLabel7"; + this.xrLabel7.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel7.SizeF = new System.Drawing.SizeF(73.99963F, 24F); + this.xrLabel7.StylePriority.UseFont = false; + this.xrLabel7.Text = "Wohnort"; + // + // lblWohnort + // + this.lblWohnort.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.lblWohnort.LocationFloat = new DevExpress.Utils.PointFloat(395F, 60F); + this.lblWohnort.Multiline = true; + this.lblWohnort.Name = "lblWohnort"; + this.lblWohnort.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblWohnort.SizeF = new System.Drawing.SizeF(247.0001F, 23.99999F); + this.lblWohnort.StylePriority.UseBorders = false; + this.lblWohnort.StylePriority.UseFont = false; + // + // GroupHeader3 + // + this.GroupHeader3.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel13, + this.lblQuali}); + this.GroupHeader3.HeightF = 77.99998F; + this.GroupHeader3.Name = "GroupHeader3"; + // + // GroupHeader4 + // + this.GroupHeader4.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel21, + this.lblAllgBemerkungen}); + this.GroupHeader4.HeightF = 77.99998F; + this.GroupHeader4.Level = 1; + this.GroupHeader4.Name = "GroupHeader4"; + // + // GroupHeader5 + // + this.GroupHeader5.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel28, + this.xrTable1}); + this.GroupHeader5.HeightF = 47.99999F; + this.GroupHeader5.Level = 2; + this.GroupHeader5.Name = "GroupHeader5"; + // + // GroupHeader6 + // + this.GroupHeader6.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.chkPflege, + this.chkKlo, + this.chkAggro}); + this.GroupHeader6.HeightF = 70F; + this.GroupHeader6.Level = 3; + this.GroupHeader6.Name = "GroupHeader6"; + // + // chkPflege + // + this.chkPflege.GlyphAlignment = DevExpress.Utils.HorzAlignment.Far; + this.chkPflege.LocationFloat = new DevExpress.Utils.PointFloat(0F, 10F); + this.chkPflege.Name = "chkPflege"; + this.chkPflege.SizeF = new System.Drawing.SizeF(139.58F, 24F); + this.chkPflege.StylePriority.UseFont = false; + this.chkPflege.Text = "Pflege"; + // + // chkKlo + // + this.chkKlo.GlyphAlignment = DevExpress.Utils.HorzAlignment.Far; + this.chkKlo.LocationFloat = new DevExpress.Utils.PointFloat(160.71F, 10F); + this.chkKlo.Name = "chkKlo"; + this.chkKlo.SizeF = new System.Drawing.SizeF(139.5801F, 23.99999F); + this.chkKlo.StylePriority.UseFont = false; + this.chkKlo.Text = "Toilettengang"; + // + // chkAggro + // + this.chkAggro.GlyphAlignment = DevExpress.Utils.HorzAlignment.Far; + this.chkAggro.LocationFloat = new DevExpress.Utils.PointFloat(321.0002F, 10F); + this.chkAggro.Name = "chkAggro"; + this.chkAggro.SizeF = new System.Drawing.SizeF(139.5801F, 23.99999F); + this.chkAggro.StylePriority.UseFont = false; + this.chkAggro.Text = "Aggressivität"; + // + // xrLabel28 + // + this.xrLabel28.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); + this.xrLabel28.Name = "xrLabel28"; + this.xrLabel28.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel28.SizeF = new System.Drawing.SizeF(227.0801F, 24F); + this.xrLabel28.StylePriority.UseFont = false; + this.xrLabel28.Text = "Ausschlusskriterien"; + // + // xrTable1 + // + this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 23.99999F); + this.xrTable1.Name = "xrTable1"; + this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { + this.xrTableRow3}); + this.xrTable1.SizeF = new System.Drawing.SizeF(641.9999F, 24F); + this.xrTable1.StylePriority.UseFont = false; + // + // xrTableRow3 + // + this.xrTableRow3.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { + this.cellAusschlussKrits}); + this.xrTableRow3.Name = "xrTableRow3"; + this.xrTableRow3.Weight = 1.4999998410542974D; + // + // cellAusschlussKrits + // + this.cellAusschlussKrits.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.cellAusschlussKrits.Multiline = true; + this.cellAusschlussKrits.Name = "cellAusschlussKrits"; + this.cellAusschlussKrits.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.cellAusschlussKrits.StylePriority.UseBorders = false; + this.cellAusschlussKrits.StylePriority.UseFont = false; + this.cellAusschlussKrits.StylePriority.UsePadding = false; + this.cellAusschlussKrits.Weight = 0.5D; + // + // xrLabel21 + // + this.xrLabel21.LocationFloat = new DevExpress.Utils.PointFloat(0F, 30F); + this.xrLabel21.Name = "xrLabel21"; + this.xrLabel21.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel21.SizeF = new System.Drawing.SizeF(227.0801F, 24F); + this.xrLabel21.StylePriority.UseFont = false; + this.xrLabel21.Text = "Allgemeine Bemerkungen"; + // + // lblAllgBemerkungen + // + this.lblAllgBemerkungen.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.lblAllgBemerkungen.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "Employee.BemerkungenSbd")}); + this.lblAllgBemerkungen.LocationFloat = new DevExpress.Utils.PointFloat(0F, 53.99999F); + this.lblAllgBemerkungen.Multiline = true; + this.lblAllgBemerkungen.Name = "lblAllgBemerkungen"; + this.lblAllgBemerkungen.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblAllgBemerkungen.SizeF = new System.Drawing.SizeF(642.0001F, 24F); + this.lblAllgBemerkungen.StylePriority.UseBorders = false; + this.lblAllgBemerkungen.StylePriority.UseFont = false; + // + // xrLabel13 + // + this.xrLabel13.LocationFloat = new DevExpress.Utils.PointFloat(0F, 30F); + this.xrLabel13.Name = "xrLabel13"; + this.xrLabel13.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel13.SizeF = new System.Drawing.SizeF(139.58F, 24F); + this.xrLabel13.StylePriority.UseFont = false; + this.xrLabel13.Text = "Qualifikation"; + // + // lblQuali + // + this.lblQuali.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.lblQuali.LocationFloat = new DevExpress.Utils.PointFloat(0F, 53.99999F); + this.lblQuali.Multiline = true; + this.lblQuali.Name = "lblQuali"; + this.lblQuali.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblQuali.SizeF = new System.Drawing.SizeF(642.0001F, 24F); + this.lblQuali.StylePriority.UseBorders = false; + this.lblQuali.StylePriority.UseFont = false; + // + // SBDEmployeeReport + // + this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { + this.Detail, + this.PageFooter, + this.topMarginBand1, + this.bottomMarginBand1, + this.ReportHeader, + this.GroupHeader1, + this.GroupHeader3, + this.GroupHeader4, + this.GroupHeader5, + this.GroupHeader6}); + this.DataSource = this.bindingSource1; + this.Font = new System.Drawing.Font("Calibri", 11F); + this.Margins = new System.Drawing.Printing.Margins(75, 75, 75, 75); + this.PageHeight = 1169; + this.PageWidth = 827; + this.PaperKind = System.Drawing.Printing.PaperKind.A4; + this.Version = "17.1"; + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.tableBetreuungszeiten)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); + + } + + #endregion + + private DevExpress.XtraReports.UI.DetailBand Detail; + private DevExpress.XtraReports.UI.PageFooterBand PageFooter; + private System.Windows.Forms.BindingSource bindingSource1; + private DevExpress.XtraReports.UI.TopMarginBand topMarginBand1; + private DevExpress.XtraReports.UI.BottomMarginBand bottomMarginBand1; + private DevExpress.XtraReports.UI.ReportHeaderBand ReportHeader; + private DevExpress.XtraReports.UI.XRLabel xrLabel12; + private DevExpress.XtraReports.UI.XRLabel xrLabel5; + private DevExpress.XtraReports.UI.XRLabel lblAlter2; + private DevExpress.XtraReports.UI.XRLabel lblAlter; + private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1; + private DevExpress.XtraReports.UI.XRLabel xrLabel1; + private DevExpress.XtraReports.UI.XRTable tableBetreuungszeiten; + private DevExpress.XtraReports.UI.XRTableRow rowBetreuungszeiten; + private DevExpress.XtraReports.UI.XRTableCell cell1; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell5; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell6; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell7; + private DevExpress.XtraReports.UI.XRLabel xrLabel2; + private DevExpress.XtraReports.UI.XRLabel xrLabel3; + private DevExpress.XtraReports.UI.XRLabel xrLabel7; + private DevExpress.XtraReports.UI.XRLabel lblWohnort; + private DevExpress.XtraReports.UI.XRLabel xrLabel4; + private DevExpress.XtraReports.UI.XRLabel xrLabel6; + private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader3; + private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader4; + private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader5; + private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader6; + private DevExpress.XtraReports.UI.XRCheckBox chkPflege; + private DevExpress.XtraReports.UI.XRCheckBox chkKlo; + private DevExpress.XtraReports.UI.XRCheckBox chkAggro; + private DevExpress.XtraReports.UI.XRLabel xrLabel28; + private DevExpress.XtraReports.UI.XRTable xrTable1; + private DevExpress.XtraReports.UI.XRTableRow xrTableRow3; + private DevExpress.XtraReports.UI.XRTableCell cellAusschlussKrits; + private DevExpress.XtraReports.UI.XRLabel xrLabel21; + private DevExpress.XtraReports.UI.XRLabel lblAllgBemerkungen; + private DevExpress.XtraReports.UI.XRLabel xrLabel13; + private DevExpress.XtraReports.UI.XRLabel lblQuali; + } +} diff --git a/ReportImp/SHKServiceSBD/SBDEmployeeReport.cs b/ReportImp/SHKServiceSBD/SBDEmployeeReport.cs new file mode 100644 index 000000000..0e97ffe66 --- /dev/null +++ b/ReportImp/SHKServiceSBD/SBDEmployeeReport.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.Text; +using BeWo.Data.Access; +using BeWo.Data.Entities; +using DevExpress.XtraReports.UI; +using BeWo.Report; +using BeWo.Report.ReportObjects; +using BS.Shared.DataContracts; + + +namespace SHKServiceSBD +{ + public partial class SBDEmployeeReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport + { + public SBDEmployeeReport() + { + InitializeComponent(); + } + + public void SetReportDataSource(SBDEmployeeRO pRO) + { + + CreateArbeitszeitenTable(pRO.Employee.Arbeitszeiten); + + //Alter ermitteln + int? alter = null; + if (pRO.Employee.DateOfBirth.HasValue) + { + alter = DateTime.Now.Year - pRO.Employee.DateOfBirth.Value.Year; + var birthday = pRO.Employee.DateOfBirth.Value.AddYears(alter.Value); + if (DateTime.Now.CompareTo(birthday) < 0) + { + alter--; + } + } + lblAlter.Text = String.Format("{0}", alter); + + String wohnort = String.Format("{0}\n{1} {2}", pRO.Street, pRO.PostCode, pRO.Town); + lblWohnort.Text = wohnort; + + chkAggro.Checked = pRO.Employee.Aggressiv; + chkKlo.Checked = pRO.Employee.Toilettengang; + chkPflege.Checked = pRO.Employee.Pflege; + + SetzeToken(pRO.Employee); + SetzeQualifikationen(pRO); + + this.bindingSource1.DataSource = pRO; + } + + private void SetzeQualifikationen(SBDEmployeeRO pRO) + { + String quali = ""; + + foreach (var item in pRO.Employee.Qualifications) + { + if (quali.Length > 0) + { + quali += ", "; + } + quali += item.DisplayName; + + } + lblQuali.Text = quali; + } + + private void CreateArbeitszeitenTable(List zeiten) + { + if (zeiten != null) + { + foreach (var az in zeiten) + { + if ((!az.GueltigVon.HasValue || az.GueltigVon <= DateTime.Now) && + (!az.GueltigBis.HasValue || az.GueltigBis >= DateTime.Now) && az.Eintraege != null) + { + foreach (var e in az.Eintraege) + { + AddArbeitszeit(e); + } + } + } + } + } + + private void AddArbeitszeit(ArbeitszeitEintragDC ae) + { + XRTableRow newRow = tableBetreuungszeiten.InsertRowBelow(tableBetreuungszeiten.Rows[tableBetreuungszeiten.Rows.Count - 1]); + newRow.Font = new System.Drawing.Font("Arial", 10F); + + newRow.Cells[0].Text = String.Format("{0}", ae.Tag); + newRow.Cells[1].Text = String.Format("{0} - {1}", ae.UhrzeitVon, ae.UhrzeitBis); + newRow.Cells[2].Text = ae.Notice; + } + + private void SetzeToken(EmployeeDC emp) + { + String ausschluss = ""; + + var c2tList = DAOFactory.SearchDAO.GeEmployee2TokensByEmployeeOid(emp.EmployeeOid.Value); + + foreach (var c2t in c2tList) + { + if (c2t.Token.TokenTyp == BS.Shared.TokenTyp.AusschlussKriterium) + { + if (ausschluss.Length > 0) + { + ausschluss += "\n"; + } + ausschluss += c2t.Token.Beschreibung; + } + } + + cellAusschlussKrits.Text = ausschluss; + } + } +} diff --git a/ReportImp/SHKServiceSBD/SBDEmployeeReport.resx b/ReportImp/SHKServiceSBD/SBDEmployeeReport.resx new file mode 100644 index 000000000..d25f3eba2 --- /dev/null +++ b/ReportImp/SHKServiceSBD/SBDEmployeeReport.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/ReportImp/SHKServiceSBD/SHKServiceSBD.csproj b/ReportImp/SHKServiceSBD/SHKServiceSBD.csproj index 9537d09f8..3928c3b6d 100644 --- a/ReportImp/SHKServiceSBD/SHKServiceSBD.csproj +++ b/ReportImp/SHKServiceSBD/SHKServiceSBD.csproj @@ -82,6 +82,12 @@ SBDCharacteristicsReport.cs + + Component + + + SBDEmployeeReport.cs + @@ -125,6 +131,10 @@ SBDCharacteristicsReport.cs Designer + + SBDEmployeeReport.cs + Designer + diff --git a/ReportImp/SHKServiceSBD/Service/CustomVertretungsManager.cs b/ReportImp/SHKServiceSBD/Service/CustomVertretungsManager.cs index 8909da648..95cf4b685 100644 --- a/ReportImp/SHKServiceSBD/Service/CustomVertretungsManager.cs +++ b/ReportImp/SHKServiceSBD/Service/CustomVertretungsManager.cs @@ -165,6 +165,7 @@ namespace SHKService.Service Datum = dt, Absencetime = atDC, AssistanceTime = new ArbeitszeitEintragDC(), + BetreuungszeitenAmDatum = "", Employee = empDC, }; diff --git a/Service/Plugins/EmployeeService.cs b/Service/Plugins/EmployeeService.cs index 2be496ff6..ca4eb74ea 100644 --- a/Service/Plugins/EmployeeService.cs +++ b/Service/Plugins/EmployeeService.cs @@ -24,13 +24,12 @@ namespace BeWo.Service.Plugins public virtual EmployeeDC LoadEmployee(long eOid) { var test = DAOFactory.GenericDAO.LoadByID(eOid); - if (test.Tid == TableID.Customer) - { - int test2 = 0; - } + SettingsLogic.AddToUsersHistory(eOid); var dc = MapperFactory.EmployeeDC_Employee.MapToNewDC(test); + + return dc; } diff --git a/Service/Plugins/UserService.cs b/Service/Plugins/UserService.cs index f664b99dc..beed5264b 100644 --- a/Service/Plugins/UserService.cs +++ b/Service/Plugins/UserService.cs @@ -129,10 +129,73 @@ namespace BeWo.Service.Plugins // } //} } + CheckRightVersion(userDC); } - + return userDC; } + private void CheckRightVersion(UserDC userDC) + { + var lastLogins = DAOFactory.SearchDAO.FindLastLogins(userDC.LoginName, 1).ToList(); + if (lastLogins != null && lastLogins.Count > 0) + { + var login = lastLogins[0]; + if (!String.IsNullOrEmpty(login.Referrer)) + { + //var test = "MobilClient, Version: Unbekannt"; + //var test2 = "BeWoClient, Version: Microsoft Windows NT 6.2.9200.0;CLRVersion=4.0.30319.42000;BeWoVersion=Version 3.16;IsNet45OrNewer=True"; + + var str = login.Referrer; + //str = test; + var start = str.IndexOf("BeWoVersion="); + if (start > 0) + { + var stop = str.IndexOf(";", start); + if (stop > start) + { + //BeWoClient, Version: Microsoft Windows NT 6.2.9200.0;CLRVersion=4.0.30319.42000;BeWoVersion=Version 3.17;IsNet45OrNewer=True + + + var version = str.Substring(start + 12, stop - start - 12); + version = version.Replace("Version", "").Trim(); + + foreach (var ug in userDC.UserGroups) + { + var allrights = ug.Rights; + ug.Rights = new List(); + foreach (var r in allrights) + { + if (IsCorrectVersion(r, version)) + { + ug.Rights.Add(r); + } + } + } + } + } + } + } + } + + private bool IsCorrectVersion(UserRightType r, string version) + { + var rightVersion = GetRightVersion(r); + + if (version.CompareTo(rightVersion) < 0) + { + return false; + } + return true; + } + + private object GetRightVersion(UserRightType r) + { + if (r == UserRightType.Customer_ViewBetreuung || r == UserRightType.Customer_ViewAbsenceTimes) + { + return "3.17"; + } + return "1.0"; + } } } diff --git a/Service/SBD/VertretungsManager.cs b/Service/SBD/VertretungsManager.cs index 28a6c5394..9e45cc586 100644 --- a/Service/SBD/VertretungsManager.cs +++ b/Service/SBD/VertretungsManager.cs @@ -181,6 +181,8 @@ namespace BeWo.Service.SBD Datum = dateTime, Absencetime = absenceTimeDC, AssistanceTime = assistanceTimeEntryDC, + BetreuungszeitenAmDatum = assistanceTimeEntryDC != null ? assistanceTimeEntryDC.ToString() : String.Empty, + AlleBetreuungszeiten = GetBetreuungszeitenString(assistanceTimeEntries), Employee = employeeDC, EmployeeAddressString = employeeAddressString, LastSubstitutions = lastSubstitutionDCs, @@ -328,7 +330,9 @@ namespace BeWo.Service.SBD Schools = schools, VertretungsStatus = VertretungsStatus.KlientKrank, Bemerkung = absenceTime.Notice, - AssistanceTime = assistanceTimeEntryDC + AssistanceTime = assistanceTimeEntryDC, + BetreuungszeitenAmDatum = assistanceTimeEntryDC != null ? assistanceTimeEntryDC.ToString() : String.Empty, + AlleBetreuungszeiten = GetBetreuungszeitenString(assistanceTimeEntries) }; AddKrankheitsZeitraumAndMeldungToItem(newVertretungsItem, newVertretungsItem.Absencetime); @@ -732,8 +736,18 @@ namespace BeWo.Service.SBD customerToolTip.AppendLine(String.Format(" ")); customerToolTip.AppendLine(String.Format("{0}", schoolString)); } - - + + String alleBetreuungszeiten = vertretungsItem.AlleBetreuungszeiten; + + if (!String.IsNullOrEmpty(alleBetreuungszeiten)) + { + alleBetreuungszeiten = alleBetreuungszeiten.Replace("\n", ""); + + customerToolTip.AppendLine(String.Format("")); + customerToolTip.AppendLine(String.Format(" ")); + customerToolTip.AppendLine(String.Format("{0}", alleBetreuungszeiten)); + } + var lastSubstitutions = string.Empty; if (vertretungsItem.LastSubstitutions != null) @@ -975,6 +989,40 @@ namespace BeWo.Service.SBD } + private string GetBetreuungszeitenString(List assistanceTimeEntries) + { + Dictionary tag2Eintrag = new Dictionary(); + foreach (var item in assistanceTimeEntries) + { + if (!tag2Eintrag.ContainsKey(item.Tag)) + { + tag2Eintrag.Add(item.Tag, String.Format("{0}: {1}-{2}", item.Tag.ToString().Substring(0, 2), item.UhrzeitVon, item.UhrzeitBis)); + } + else + { + tag2Eintrag[item.Tag] += String.Format(", {0}-{1}", item.UhrzeitVon, item.UhrzeitBis); + } + } + + String str = ""; + + foreach (var item in assistanceTimeEntries) + { + if (tag2Eintrag.ContainsKey(item.Tag)) + { + if (str.Length > 0) + { + str += "\n"; + } + str += tag2Eintrag[item.Tag]; + tag2Eintrag.Remove(item.Tag); + } + + } + return str; + } + + public virtual void SetMailInfos(VertretungsItemDC vertretungsItem, Customer customer, Employee employee, Employee vertretung, Organisation school) { if (customer != null) diff --git a/Service/ServiceImplementations/AnalysisServiceImp.cs b/Service/ServiceImplementations/AnalysisServiceImp.cs index 33a5e08da..3d89f2cff 100644 --- a/Service/ServiceImplementations/AnalysisServiceImp.cs +++ b/Service/ServiceImplementations/AnalysisServiceImp.cs @@ -305,7 +305,7 @@ namespace BeWo.Service.ServiceImplementations { try { - return MapperFactory.LoginDC_Login.MapToNewDCs(DAOFactory.SearchDAO.FindLastLogins(loginName)); + return MapperFactory.LoginDC_Login.MapToNewDCs(DAOFactory.SearchDAO.FindLastLogins(loginName, 10)); } catch (Exception e) { diff --git a/Shared/DataContracts/VertretungsItemDC.cs b/Shared/DataContracts/VertretungsItemDC.cs index 50293944b..6b5d35cbe 100644 --- a/Shared/DataContracts/VertretungsItemDC.cs +++ b/Shared/DataContracts/VertretungsItemDC.cs @@ -131,6 +131,12 @@ namespace BS.Shared.DataContracts [DataMember] public ArbeitszeitEintragDC AssistanceTime { get; set; } + [DataMember] + public string AlleBetreuungszeiten { get; set; } + + [DataMember] + public string BetreuungszeitenAmDatum { get; set; } + [DataMember] public string CustomerToolTip { get; set; }