using System;
using System.Collections;
using System.Text;
using Medivators.BusinessObjects;

namespace Medivators.Data.Queries
{
	public class SelectDistinctCycleReportAttribute : SynchronousExecute
	{
		public ArrayList Select (Enums.CycleReportAttributes Attribute, bool ConsumeErrors)
		{
			string sql = "select distinct ";
			switch (Attribute)
			{
				case Enums.CycleReportAttributes.Date:
					sql += "StartTimestamp";
					break;
				case Enums.CycleReportAttributes.MachineStation:
					sql += "MachineID, Station";
					break;
				case Enums.CycleReportAttributes.Operator:
					sql += "OperatorID";
					break;
				case Enums.CycleReportAttributes.Patient:
					sql += "PatientID";
					break;
				case Enums.CycleReportAttributes.Physician:
					sql += "PhysicianID";
					break;
				case Enums.CycleReportAttributes.Scope:
					sql += "ScopeID";
					break;
			}
			sql += " from CycleReports";
			return base.Select(sql, new UntypedDataMapper(ConsumeErrors));
		}
	}
}
