private void LoadData() { YellowstonePathology.Business.Monitor.Model.MissingInformationCollection missingInformationCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetMissingInformationCollection(); missingInformationCollection.SetState(); this.m_MissingInformationCollection = missingInformationCollection; this.NotifyPropertyChanged(""); }
public static YellowstonePathology.Business.Monitor.Model.MissingInformationCollection GetMissingInformationCollection() { YellowstonePathology.Business.Monitor.Model.MissingInformationCollection result = new YellowstonePathology.Business.Monitor.Model.MissingInformationCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select pso.MasterAccessionNo, pso.ReportNo, pso.PanelSetName [TestName], pso.ExpectedFinalTime, pso.OrderTime, mit.FirstCallComment, mit.SecondCallComment, ao.PhysicianName [ProviderName] " + "from tblPanelSetOrder pso " + "join tblAccessionOrder ao on pso.MasterAccessionNo = ao.MasterAccessionNo " + "join tblMissingInformationTestOrder mit on pso.ReportNo = mit.ReportNo " + "join tblSystemUser su on pso.AssignedToId = su.UserId " + "where pso.PanelSetId = 212 and pso.Final = 0" + "order by ExpectedFinalTime"; 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.MissingInformation missingInformation = new YellowstonePathology.Business.Monitor.Model.MissingInformation(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(missingInformation, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(missingInformation); } } } return result; }