diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs index f30dd7ddb..e20cddc89 100644 --- a/Data/Access/SearchDAO.cs +++ b/Data/Access/SearchDAO.cs @@ -5474,5 +5474,16 @@ namespace BeWo.Data.Access return string.Empty; } + + public List GetValidationMessagesForMonth(DateTime startDate, DateTime endDate) + { + var criteria = CreateCriteria() + .Add(Restrictions.Gt(ValidationMessage.PropertyName_InsTs, startDate)) + .Add(Restrictions.Lt(ValidationMessage.PropertyName_InsTs, endDate)); + + var list = criteria.List(); + + return list.ToList(); + } } } diff --git a/Host/ReportView.aspx.cs b/Host/ReportView.aspx.cs index 84915ac33..e1ba9552f 100644 --- a/Host/ReportView.aspx.cs +++ b/Host/ReportView.aspx.cs @@ -180,6 +180,9 @@ namespace Host case ReportTypes.VertretungsPlanung: report = CreateVertretungsPlanungReport(); break; + case ReportTypes.ValidationMessageReport: + report = CreateValidationMessageListReport(); + break; default: report = CreateQueryReport(); break; @@ -915,8 +918,14 @@ namespace Host return reportCreator.CreateVertretungsPlanungReport(start, ansicht); } + private XtraReport CreateValidationMessageListReport() + { + DateTime start = DateTime.Now.Date; + DateTime end = start.AddMonths(1).AddTicks(-1); + + return reportCreator.CreateValidationMessageListReport(start, end); + } - private AbstractReportCreator GetReportCreator() { diff --git a/Report/AbstractReportCreator.cs b/Report/AbstractReportCreator.cs index 197eb1b45..e3aa0abf5 100644 --- a/Report/AbstractReportCreator.cs +++ b/Report/AbstractReportCreator.cs @@ -102,5 +102,7 @@ namespace BeWo.Report public abstract XtraReport CreateRatingReport(long ratingOid, long supportConceptOid); public abstract XtraReport CreateVertretungsPlanungReport(DateTime start, int ansicht); + + public abstract XtraReport CreateValidationMessageListReport(DateTime startDate, DateTime endDate); } } \ No newline at end of file diff --git a/Report/DefaultReportCreator.cs b/Report/DefaultReportCreator.cs index 1637b7a02..b8c982bef 100644 --- a/Report/DefaultReportCreator.cs +++ b/Report/DefaultReportCreator.cs @@ -1186,5 +1186,14 @@ namespace BeWo.Report return null; } } + + public override XtraReport CreateValidationMessageListReport(DateTime startDate, DateTime endDate) + { + IBeWoReport report = FindReportImp(); + + report.SetReportDataSource(ValidationMessageListRO.Create(startDate, endDate, DAOFactory.SearchDAO.GetValidationMessagesForMonth(startDate, endDate).ToList())); + + return report as XtraReport; + } } } \ No newline at end of file diff --git a/Report/DefaultReports/ValidationMessagesReport.Designer.cs b/Report/DefaultReports/ValidationMessagesReport.Designer.cs new file mode 100644 index 000000000..433f58b32 --- /dev/null +++ b/Report/DefaultReports/ValidationMessagesReport.Designer.cs @@ -0,0 +1,333 @@ +namespace BeWo.Report.DefaultReports +{ + partial class ValidationMessagesReport + { + /// + /// 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 + + #endregion + /// + /// 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.topMarginBand1 = new DevExpress.XtraReports.UI.TopMarginBand(); + this.detailBand1 = new DevExpress.XtraReports.UI.DetailBand(); + this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand(); + this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); + this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel(); + this.DetailReport = new DevExpress.XtraReports.UI.DetailReportBand(); + this.Detail = new DevExpress.XtraReports.UI.DetailBand(); + this.objectDataSource1 = new DevExpress.DataAccess.ObjectBinding.ObjectDataSource(this.components); + this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); + this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow(); + this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell4 = 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.xrTableCell8 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTable2 = new DevExpress.XtraReports.UI.XRTable(); + this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow(); + this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell10 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell12 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell13 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell14 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell15 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell16 = new DevExpress.XtraReports.UI.XRTableCell(); + ((System.ComponentModel.ISupportInitialize)(this.objectDataSource1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); + // + // topMarginBand1 + // + this.topMarginBand1.HeightF = 10F; + this.topMarginBand1.Name = "topMarginBand1"; + // + // detailBand1 + // + this.detailBand1.Expanded = false; + this.detailBand1.HeightF = 0F; + this.detailBand1.Name = "detailBand1"; + // + // bottomMarginBand1 + // + this.bottomMarginBand1.HeightF = 10F; + this.bottomMarginBand1.Name = "bottomMarginBand1"; + // + // ReportHeader + // + this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel2, + this.xrLabel1, + this.xrTable1}); + this.ReportHeader.HeightF = 131.0834F; + this.ReportHeader.Name = "ReportHeader"; + // + // xrLabel1 + // + this.xrLabel1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ReportStartDate")}); + this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(206.6667F, 38.49999F); + this.xrLabel1.Name = "xrLabel1"; + this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel1.SizeF = new System.Drawing.SizeF(100F, 23F); + this.xrLabel1.Text = "xrLabel1"; + // + // xrLabel2 + // + this.xrLabel2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ReportEndDate")}); + this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(497.2917F, 38.49999F); + this.xrLabel2.Name = "xrLabel2"; + this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel2.SizeF = new System.Drawing.SizeF(100F, 23F); + this.xrLabel2.Text = "xrLabel2"; + // + // DetailReport + // + this.DetailReport.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { + this.Detail}); + this.DetailReport.DataMember = "ValidationMessagesForMonth"; + this.DetailReport.DataSource = this.objectDataSource1; + this.DetailReport.Level = 0; + this.DetailReport.Name = "DetailReport"; + // + // Detail + // + this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrTable2}); + this.Detail.HeightF = 100F; + this.Detail.Name = "Detail"; + // + // objectDataSource1 + // + this.objectDataSource1.DataSource = typeof(BeWo.Report.ReportObjects.ValidationMessageListRO); + this.objectDataSource1.Name = "objectDataSource1"; + // + // xrTable1 + // + this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 106.0834F); + this.xrTable1.Name = "xrTable1"; + this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { + this.xrTableRow1}); + this.xrTable1.SizeF = new System.Drawing.SizeF(1149F, 25.00001F); + // + // xrTableRow1 + // + this.xrTableRow1.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { + this.xrTableCell1, + this.xrTableCell2, + this.xrTableCell3, + this.xrTableCell4, + this.xrTableCell5, + this.xrTableCell6, + this.xrTableCell7, + this.xrTableCell8}); + this.xrTableRow1.Name = "xrTableRow1"; + this.xrTableRow1.Weight = 1D; + // + // xrTableCell1 + // + this.xrTableCell1.Name = "xrTableCell1"; + this.xrTableCell1.Text = "Klient*in"; + this.xrTableCell1.Weight = 1D; + // + // xrTableCell2 + // + this.xrTableCell2.Name = "xrTableCell2"; + this.xrTableCell2.Text = "Startzeit"; + this.xrTableCell2.Weight = 1D; + // + // xrTableCell3 + // + this.xrTableCell3.Name = "xrTableCell3"; + this.xrTableCell3.Text = "Endzeit"; + this.xrTableCell3.Weight = 1D; + // + // xrTableCell4 + // + this.xrTableCell4.Name = "xrTableCell4"; + this.xrTableCell4.Text = "Zeitstempel"; + this.xrTableCell4.Weight = 1D; + // + // xrTableCell5 + // + this.xrTableCell5.Name = "xrTableCell5"; + this.xrTableCell5.Text = "Angelegt von"; + this.xrTableCell5.Weight = 1D; + // + // xrTableCell6 + // + this.xrTableCell6.Name = "xrTableCell6"; + this.xrTableCell6.Text = "Angelegt für"; + this.xrTableCell6.Weight = 1D; + // + // xrTableCell7 + // + this.xrTableCell7.Name = "xrTableCell7"; + this.xrTableCell7.Text = "Logkategorie"; + this.xrTableCell7.Weight = 2.231176238212619D; + // + // xrTableCell8 + // + this.xrTableCell8.Name = "xrTableCell8"; + this.xrTableCell8.Text = "Lognachricht"; + this.xrTableCell8.Weight = 4.2278599898788247D; + // + // xrTable2 + // + this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); + this.xrTable2.Name = "xrTable2"; + this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { + this.xrTableRow2}); + this.xrTable2.SizeF = new System.Drawing.SizeF(1149F, 25.00001F); + // + // xrTableRow2 + // + this.xrTableRow2.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { + this.xrTableCell9, + this.xrTableCell10, + this.xrTableCell11, + this.xrTableCell12, + this.xrTableCell13, + this.xrTableCell14, + this.xrTableCell15, + this.xrTableCell16}); + this.xrTableRow2.Name = "xrTableRow2"; + this.xrTableRow2.Weight = 1D; + // + // xrTableCell9 + // + this.xrTableCell9.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ValidationMessagesForMonth.Customer")}); + this.xrTableCell9.Name = "xrTableCell9"; + this.xrTableCell9.Weight = 1D; + // + // xrTableCell10 + // + this.xrTableCell10.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ValidationMessagesForMonth.ServiceRecordStart", "{0:dd.MM.yyyy}")}); + this.xrTableCell10.Name = "xrTableCell10"; + this.xrTableCell10.Weight = 1D; + // + // xrTableCell11 + // + this.xrTableCell11.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ValidationMessagesForMonth.ServiceRecordEnd", "{0:dd.MM.yyyy}")}); + this.xrTableCell11.Name = "xrTableCell11"; + this.xrTableCell11.Weight = 1D; + // + // xrTableCell12 + // + this.xrTableCell12.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ValidationMessagesForMonth.TimeStamp", "{0:dd.MM.yyyy}")}); + this.xrTableCell12.Name = "xrTableCell12"; + this.xrTableCell12.Weight = 1D; + // + // xrTableCell13 + // + this.xrTableCell13.Name = "xrTableCell13"; + this.xrTableCell13.Text = "[User.Employee.LastName], [User.Employee.FirstName]"; + this.xrTableCell13.Weight = 1D; + // + // xrTableCell14 + // + this.xrTableCell14.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ValidationMessagesForMonth.Employee.LastNameFirstName")}); + this.xrTableCell14.Name = "xrTableCell14"; + this.xrTableCell14.Weight = 1D; + // + // xrTableCell15 + // + this.xrTableCell15.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ValidationMessagesForMonth.ValidationResult")}); + this.xrTableCell15.Name = "xrTableCell15"; + this.xrTableCell15.Weight = 2.231176238212619D; + // + // xrTableCell16 + // + this.xrTableCell16.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ValidationMessagesForMonth.Message")}); + this.xrTableCell16.Name = "xrTableCell16"; + this.xrTableCell16.Weight = 4.2278599898788247D; + // + // ValidationMessagesReport + // + this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { + this.topMarginBand1, + this.detailBand1, + this.bottomMarginBand1, + this.ReportHeader, + this.DetailReport}); + this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] { + this.objectDataSource1}); + this.DataSource = this.objectDataSource1; + this.Margins = new System.Drawing.Printing.Margins(10, 10, 10, 10); + this.PageHeight = 827; + this.PageWidth = 1169; + this.PaperKind = System.Drawing.Printing.PaperKind.A4Rotated; + this.Version = "17.1"; + ((System.ComponentModel.ISupportInitialize)(this.objectDataSource1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); + + } + + private DevExpress.XtraReports.UI.TopMarginBand topMarginBand1; + private DevExpress.XtraReports.UI.DetailBand detailBand1; + private DevExpress.XtraReports.UI.BottomMarginBand bottomMarginBand1; + private DevExpress.XtraReports.UI.ReportHeaderBand ReportHeader; + private DevExpress.DataAccess.ObjectBinding.ObjectDataSource objectDataSource1; + private DevExpress.XtraReports.UI.XRLabel xrLabel2; + private DevExpress.XtraReports.UI.XRLabel xrLabel1; + private DevExpress.XtraReports.UI.DetailReportBand DetailReport; + private DevExpress.XtraReports.UI.DetailBand Detail; + private DevExpress.XtraReports.UI.XRTable xrTable1; + private DevExpress.XtraReports.UI.XRTableRow xrTableRow1; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell1; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell2; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell3; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell4; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell5; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell6; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell7; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell8; + private DevExpress.XtraReports.UI.XRTable xrTable2; + private DevExpress.XtraReports.UI.XRTableRow xrTableRow2; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell9; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell10; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell11; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell12; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell13; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell14; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell15; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell16; + } +} diff --git a/Report/DefaultReports/ValidationMessagesReport.cs b/Report/DefaultReports/ValidationMessagesReport.cs new file mode 100644 index 000000000..5be5c9d1b --- /dev/null +++ b/Report/DefaultReports/ValidationMessagesReport.cs @@ -0,0 +1,18 @@ +using System.Linq; +using BeWo.Report.ReportObjects; + +namespace BeWo.Report.DefaultReports +{ + public partial class ValidationMessagesReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport + { + public ValidationMessagesReport() + { + InitializeComponent(); + } + + public void SetReportDataSource(ValidationMessageListRO pRO) + { + objectDataSource1.DataSource = pRO; + } + } +} diff --git a/Report/DefaultReports/ValidationMessagesReport.resx b/Report/DefaultReports/ValidationMessagesReport.resx new file mode 100644 index 000000000..ed290a7e7 --- /dev/null +++ b/Report/DefaultReports/ValidationMessagesReport.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/Report/Report.csproj b/Report/Report.csproj index f703ef946..30a1e71b3 100644 --- a/Report/Report.csproj +++ b/Report/Report.csproj @@ -154,6 +154,12 @@ RosterIstReport.cs + + Component + + + ValidationMessagesReport.cs + Component @@ -468,6 +474,7 @@ + @@ -493,6 +500,10 @@ RosterIstReport.cs + + ValidationMessagesReport.cs + Designer + VorlageReport.cs Designer diff --git a/Report/ReportObjects/ValidationMessageListRO.cs b/Report/ReportObjects/ValidationMessageListRO.cs new file mode 100644 index 000000000..abed70ec2 --- /dev/null +++ b/Report/ReportObjects/ValidationMessageListRO.cs @@ -0,0 +1,85 @@ +using BeWo.Data.Access; +using BeWo.Data.Entities; +using BeWo.Service.DCEntityMapper; +using BS.Shared.DataContracts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Report.ReportObjects +{ + public class ValidationMessageListRO : AbstractBeWoReportObject + { + public List ValidationMessagesForMonth { get; set; } + public DateTime ReportStartDate { get; set; } + public DateTime ReportEndDate { get; set; } + + + + + public static ValidationMessageListRO Create(DateTime reportStart, DateTime reportEnd, List validationMessagesForMonth) + { + var ro = new ValidationMessageListRO(); + ro.ValidationMessagesForMonth = new List(); + ro.ReportStartDate = reportStart; + ro.ReportEndDate = reportEnd; + + foreach (var msg in validationMessagesForMonth) + ro.ValidationMessagesForMonth.Add(CreateMessageRO(msg)); + + return ro; + } + + public static ValidationMessageRO CreateMessageRO(ValidationMessage message) + { + var ro = new ValidationMessageRO(); + + ro.TimeStamp = message.InsTs; + ro.Message = message.Message; + ro.Customer = message.CustomerName; + ro.ServiceRecordStart = message.ServiceRecordStart; + ro.ServiceRecordEnd = message.ServiceRecordEnd; + + if (message.UserOid.HasValue) + ro.User = MapperFactory.UserDC_User.MapToNewDC(DAOFactory.GenericDAO.GetByID(message.UserOid.Value)); + if (message.EmployeeOid.HasValue) + ro.Employee = MapperFactory.EmployeeDC_Employee.MapToNewDC(DAOFactory.GenericDAO.GetByID(message.EmployeeOid.Value)); + if (message.SupportConceptOid.HasValue) + ro.SupportConcept = MapperFactory.SupportConceptDC_SupportConcept.MapToNewDC(DAOFactory.GenericDAO.GetByID(message.SupportConceptOid.Value)); + + switch (message.ServiceRecordValidationResult) + { + case 0: ro.ValidationResult = "Überschneidung zweier Leistungsempfangenden"; break; + case 1: ro.ValidationResult = "Terminüberschneidung zweier Mitarbeitenden"; break; + case 2: ro.ValidationResult = "Termin außerhalb des Hilfeplanzeitraums"; break; + case 3: ro.ValidationResult = "Überschreitung von bewilligten Stunden"; break; + case 4: ro.ValidationResult = "Überschreitung des zugelassenen Bearbeitungszeitraums"; break; + case 5: ro.ValidationResult = "Fehler beim Speichern"; break; + case 6: ro.ValidationResult = "Dokumentieren nach Erstellung der Spitzabrechnung"; break; + case 7: ro.ValidationResult = "Dokumentieren nach ablauf der Frist"; break; + case 8: ro.ValidationResult = ""; break; + case 9: ro.ValidationResult = "Unterschrift existiert bereits"; break; + } + + return ro; + } + + + public class ValidationMessageRO + { + public DateTime? TimeStamp { get; set; } + public string Message { get; set; } + public UserDC User { get; set; } + public EmployeeDC Employee { get; set; } + public string Customer { get; set; } + public SupportConceptDC SupportConcept { get; set; } + public DateTime? ServiceRecordStart { get; set; } + public DateTime? ServiceRecordEnd { get; set; } + public string ValidationResult { get; set; } + } + } + +} + diff --git a/ReportImp/AWOMuensterlandRecklinghausen/AWOMuensterlandRecklinghausen.csproj b/ReportImp/AWOMuensterlandRecklinghausen/AWOMuensterlandRecklinghausen.csproj index babd58d50..23132741c 100644 --- a/ReportImp/AWOMuensterlandRecklinghausen/AWOMuensterlandRecklinghausen.csproj +++ b/ReportImp/AWOMuensterlandRecklinghausen/AWOMuensterlandRecklinghausen.csproj @@ -32,8 +32,10 @@ + + diff --git a/ReportImp/AWOMuensterlandRecklinghausen/CustomReportCreator.cs b/ReportImp/AWOMuensterlandRecklinghausen/CustomReportCreator.cs index 3704702aa..073d0d6b1 100644 --- a/ReportImp/AWOMuensterlandRecklinghausen/CustomReportCreator.cs +++ b/ReportImp/AWOMuensterlandRecklinghausen/CustomReportCreator.cs @@ -1,11 +1,16 @@ using System; using System.Collections.Generic; +using System.Data; +using System.IO; +using System.Linq; using BeWo.Data.Access; using BeWo.Data.Entities; using BeWo.Report; +using BeWo.Report.DefaultReports; using BeWo.Report.ReportObjects; using BeWo.Service.DCEntityMapper; using BeWo.Service.ServiceImplementations; +using BS.Shared.Core; using BS.Shared.DataContracts; using DevExpress.XtraReports.UI; @@ -160,6 +165,41 @@ namespace AWOMuensterlandRecklinghausen return allReports as XtraReport; } + + public override XtraReport CreateQueryReport(long queryOid, string queryReportId) + { + if (queryOid == 1001) + return CreateValidationMessageReport(queryOid, queryReportId); + + return base.CreateQueryReport(queryOid, queryReportId); + } + + private XtraReport CreateValidationMessageReport(long queryOid, string queryReportId) + { + var query = DAOFactory.GenericDAO.LoadByID(queryOid); + + if (query == null) + return new XtraReport(); + + var path = Path.Combine(TempPath, queryReportId + ".xml"); + var table = Utils.XMLDeserialize(path); + var qro = QueryRO.Create(query, table); + + if (qro.Rows.Count > 0) + { + DateTime start = DateTime.Parse(qro.Rows[0].Field1.ToString()); + DateTime end = DateTime.Parse(qro.Rows[0].Field2.ToString()); ; + + var ro = ValidationMessageListRO.Create(start, end, DAOFactory.SearchDAO.GetValidationMessagesForMonth(start, end).ToList()); + var druck = new ValidationMessagesReport(); + druck.SetReportDataSource(ro); + return druck; + } + return new XtraReport(); + } + + + //public override XtraReport CreateServiceOverviewReportForCustomers(IList customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay, bool nurFehlende) //{ // var roList = new List(); diff --git a/Shared/DataContracts/ReportTypes.cs b/Shared/DataContracts/ReportTypes.cs index 6fb005571..2be2a9475 100644 --- a/Shared/DataContracts/ReportTypes.cs +++ b/Shared/DataContracts/ReportTypes.cs @@ -38,7 +38,7 @@ HilfeplanStatistik, RatingReport, KilometerAuswertung, - VertretungsPlanung - + VertretungsPlanung, + ValidationMessageReport } } \ No newline at end of file