private static View.AccessionSlideOrderViewCollection BuildAccessionSlideOrderViewCollection(XElement sourceElement) { View.AccessionSlideOrderViewCollection accessionSlideOrderViewCollection = new View.AccessionSlideOrderViewCollection(); if (sourceElement != null) { foreach (XElement accessionSlideOrderViewElement in sourceElement.Elements("AccessionSlideOrderView")) { AccessionSlideOrderViewBuilder builder = new AccessionSlideOrderViewBuilder(); builder.Build(accessionSlideOrderViewElement); if (builder.AccessionSlideOrderView != null) { accessionSlideOrderViewCollection.Add(builder.AccessionSlideOrderView); } } } return(accessionSlideOrderViewCollection); }
public static View.AccessionSlideOrderView GetAccessionSlideOrderViewBySlideOrderId(string slideOrderId) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select ao.MasterAccessionNo, ao.PLastName, ao.PFirstName, ao.ClientId, ao.ClientName, ao.PhysicianId, ao.PhysicianName, pso.ReportNo, " + "(Select slo.* from tblSlideOrder slo where slo.SlideOrderId = asl.SlideOrderId for xml path('SlideOrder'), type) " + "from tblSlideOrder asl " + "join tblTestOrder t on asl.TestOrderId = t.TestOrderId " + "join tblPanelOrder po on t.PanelOrderId = po.PanelOrderId " + "join tblPanelSetOrder pso on po.ReportNo = pso.ReportNo " + "join tblAccessionOrder ao on pso.MasterAccessionNo = ao.MasterAccessionNo " + "join tblAliquotOrder a on asl.AliquotOrderId = a.AliquotOrderId " + "join tblSpecimenOrder so on a.SpecimenOrderId = so.SpecimenOrderId " + "where asl.SlideOrderId = @slideOrderId " + "for xml path('AccessionSlideOrderView'), type"; cmd.CommandType = System.Data.CommandType.Text; cmd.Parameters.Add("@SlideOrderId", System.Data.SqlDbType.VarChar).Value = slideOrderId; AccessionSlideOrderViewBuilder accessionSlideOrderViewBuilder = new AccessionSlideOrderViewBuilder(); Domain.Persistence.SqlXmlPersistence.CrudOperations.ExecuteXmlReaderCommand(cmd, Domain.Persistence.DataLocationEnum.ProductionData, accessionSlideOrderViewBuilder); return accessionSlideOrderViewBuilder.AccessionSlideOrderView; }
public static View.AccessionSlideOrderView GetAccessionSlideOrderViewBySlideOrderId(string slideOrderId) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select ao.MasterAccessionNo, ao.PLastName, ao.PFirstName, ao.ClientId, ao.ClientName, ao.PhysicianId, ao.PhysicianName, pso.ReportNo, " + "(Select slo.* from tblSlideOrder slo where slo.SlideOrderId = asl.SlideOrderId for xml path('SlideOrder'), type) " + "from tblSlideOrder asl " + "join tblTestOrder t on asl.TestOrderId = t.TestOrderId " + "join tblPanelOrder po on t.PanelOrderId = po.PanelOrderId " + "join tblPanelSetOrder pso on po.ReportNo = pso.ReportNo " + "join tblAccessionOrder ao on pso.MasterAccessionNo = ao.MasterAccessionNo " + "join tblAliquotOrder a on asl.AliquotOrderId = a.AliquotOrderId " + "join tblSpecimenOrder so on a.SpecimenOrderId = so.SpecimenOrderId " + "where asl.SlideOrderId = @slideOrderId " + "for xml path('AccessionSlideOrderView'), type"; cmd.CommandType = System.Data.CommandType.Text; cmd.Parameters.Add("@SlideOrderId", System.Data.SqlDbType.VarChar).Value = slideOrderId; AccessionSlideOrderViewBuilder accessionSlideOrderViewBuilder = new AccessionSlideOrderViewBuilder(); Domain.Persistence.SqlXmlPersistence.CrudOperations.ExecuteXmlReaderCommand(cmd, Domain.Persistence.DataLocationEnum.ProductionData, accessionSlideOrderViewBuilder); return(accessionSlideOrderViewBuilder.AccessionSlideOrderView); }
private static View.AccessionSlideOrderViewCollection BuildAccessionSlideOrderViewCollection(XElement sourceElement) { View.AccessionSlideOrderViewCollection accessionSlideOrderViewCollection = new View.AccessionSlideOrderViewCollection(); if (sourceElement != null) { foreach (XElement accessionSlideOrderViewElement in sourceElement.Elements("AccessionSlideOrderView")) { AccessionSlideOrderViewBuilder builder = new AccessionSlideOrderViewBuilder(); builder.Build(accessionSlideOrderViewElement); if (builder.AccessionSlideOrderView != null) { accessionSlideOrderViewCollection.Add(builder.AccessionSlideOrderView); } } } return accessionSlideOrderViewCollection; }