using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using BeWo.Report.ReportObjects; using BeWo.Report; namespace BeWo.Club74 { public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport { public Stundenzettel() { InitializeComponent(); } public void SetReportDataSource(ServicesOverviewRO pRO) { if (String.IsNullOrEmpty(pRO.ApprovedStartDate)) { lblZeitraum.Text = "Nicht bewilligt"; if (!String.IsNullOrEmpty(pRO.RequestedStartDate)) { lblZeitraum.Text = String.Format("{0:dd.MM.yyyy} - {1:dd.MM.yyyy}, nicht bewilligt", pRO.RequestedStartDate, pRO.RequestedEndDate); } } if (pRO.Services != null) { var servicesBillable = new List(); pRO.TotalFLMBillable = 0; foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services) { if (s.IsBillable) { servicesBillable.Add(s); s.Minutes = Math.Round(s.Minutes, 0, MidpointRounding.AwayFromZero); pRO.TotalFLMBillable += s.Minutes; } } pRO.Services = servicesBillable; } bindingSource1.DataSource = pRO; } } }