using System;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using DevExpress.XtraReports.UI;
using System.Data;

namespace BeWo.BeWoNeuss
{
    public partial class OffeneAufgaben : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<QueryRO>
    {
		public OffeneAufgaben()
        {
            InitializeComponent();

        }

        public void SetReportDataSource(QueryRO pRO)
        {
            InitTable(pRO);
            this.bindingSource1.DataSource = pRO;
        }

        private void InitTable(QueryRO ro)
        {
	        if (ro.Rows != null)
	        {
		        foreach (var row in ro.Rows)
		        {
			        if (row.Field5 != null)
			        {
				        row.Field5 = row.Field5.ToString().Substring(0, 16);

				        if (row.Field5.ToString().EndsWith("00:00"))
				        {
							row.Field5 = row.Field5.ToString().Substring(0, 10);
				        }
			        }
		        }
	        }
            
        }

    }
}
