public static YellowstonePathology.Business.Monitor.Model.DistributionCollection GetPendingDistributions()
        {
            YellowstonePathology.Business.Monitor.Model.DistributionCollection result = new YellowstonePathology.Business.Monitor.Model.DistributionCollection();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "Select ao.AccessionTime, pso.ReportNo, pso.PanelSetName, pso.FinalTime, ao.PhysicianName, ao.ClientName, datediff(mi, trd.ScheduledDistributionTime, getdate())	[MinutesSinceScheduled], trd.[Distributed] " +
                "from tblAccessionOrder ao " +
                "join tblPanelSetOrder pso on ao.MasterAccessionNo = pso.MasterAccessionNo " +
                "join tblTestOrderReportDistribution trd on pso.ReportNo = trd.ReportNo " +
                "where pso.Distribute = 1 and pso.Final = 1 and pso.finalTime < dateAdd(mi, -15, getdate()) and trd.[Distributed] = 0 and trd.ScheduledDistributionTime is not null " +
                "Order By trd.ScheduledDistributionTime";

            cmd.CommandType = CommandType.Text;

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.Monitor.Model.Distribution distribution = new YellowstonePathology.Business.Monitor.Model.Distribution();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(distribution, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                        result.Add(distribution);
                    }
                }
            }

            return result;
        }
 private void LoadData()
 {
     this.m_DistributionCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetPendingDistributions();
     this.m_DistributionCollection.SetState();
     this.NotifyPropertyChanged("");
 }
 private void LoadData()
 {
     this.m_DistributionCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetPendingDistributions();
     this.m_DistributionCollection.SetState();
     this.NotifyPropertyChanged("");
 }