public YellowstonePathology.Business.Search.PathologistSearchResult PathologistAliquotOrderIdSearch(string aliquotOrderId, int panelSetId) { SqlCommand cmd = new SqlCommand("pPathologistAliquotOrderIdSearch_4"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@AliquotOrderId", SqlDbType.VarChar).Value = aliquotOrderId; cmd.Parameters.Add("@PanelSetId", SqlDbType.Int).Value = panelSetId; YellowstonePathology.Business.Search.PathologistSearchResult result = null; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { result = new Search.PathologistSearchResult(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderProperyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); sqlDataReaderProperyWriter.WriteProperties(); } } } return result; }
private void Build(YellowstonePathology.Business.Task.Model.TaskOrder taskOrder) { using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); this.m_SQLCommand.Connection = cn; using (MySqlDataReader dr = this.m_SQLCommand.ExecuteReader(CommandBehavior.KeyInfo)) { while (dr.Read()) { Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(taskOrder, dr); sqlDataReaderPropertyWriter.WriteProperties(); } dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.Task.Model.TaskOrderDetail taskOrderDetail = new Task.Model.TaskOrderDetail(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(taskOrderDetail, dr); sqlDataReaderPropertyWriter.WriteProperties(); taskOrder.TaskOrderDetailCollection.Add(taskOrderDetail); } } } }
private static YellowstonePathology.Business.Test.AbsoluteCD4Count.AbsoluteCD4CountTestOrder BuildReportOrderAbsoluteCD4Count(string reportNo) { YellowstonePathology.Business.Test.AbsoluteCD4Count.AbsoluteCD4CountTestOrder reportAbsoluteCD4Count = null; using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * " + "from tblAbsoluteCD4CountTestOrder ro " + "join tblPanelSetOrder pso on ro.ReportNo = pso.ReportNo " + "where ro.ReportNo = @ReportNo"; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@ReportNo", SqlDbType.VarChar).Value = reportNo; cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { reportAbsoluteCD4Count = new YellowstonePathology.Business.Test.AbsoluteCD4Count.AbsoluteCD4CountTestOrder(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(reportAbsoluteCD4Count, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } return(reportAbsoluteCD4Count); }
public static YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistributionCollection GetReportDistributionCollectionByDateRangeTumorRegistry(DateTime startDate, DateTime endDate, string distributionType) { YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistributionCollection result = new YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistributionCollection(); string sql = "Select * from tblTestOrderReportDistribution where TimeOfLastDistribution between @StartDate and @EndDate and DistributionType = @DistributionType"; SqlCommand cmd = new SqlCommand(); cmd.CommandText = sql; cmd.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = startDate; cmd.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = endDate; cmd.Parameters.Add("@DistributionType", SqlDbType.VarChar).Value = distributionType; cmd.CommandType = CommandType.Text; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistribution testOrderReportDistribution = new YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistribution(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(testOrderReportDistribution, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(testOrderReportDistribution); } } } return result; }
public static Flow.FlowMarkerCollection GetFlowMarkerCollectionByPanelId(string reportNo, int panelId) { Flow.FlowMarkerCollection result = new Flow.FlowMarkerCollection(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "Select @ReportNo as ReportNo, mp.MarkerName as Name, mp.Intensity, mp.Interpretation, 'true' as MarkerUsed " + "from tblFlowMarkerPanel mp left outer join tblMarkers m on mp.MarkerName = m.MarkerName where PanelId = @PanelId " + "order by m.OrderFlag, m.MarkerName;"; cmd.Parameters.AddWithValue("@ReportNo", reportNo); cmd.Parameters.AddWithValue("@PanelId", panelId); using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { Flow.FlowMarkerItem flowMarkerItem = new Flow.FlowMarkerItem(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(flowMarkerItem, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(flowMarkerItem); } } } return(result); }
public static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView GetMaterialTrackingLogView(string slideOrderId, string materialTrackingBatchId) { YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView result = null; MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "Select * from tblMaterialTrackingLog where tblMaterialTrackingLog.MaterialId = @MaterialId and " + "tblMaterialTrackingLog.MaterialTrackingBatchId = @MaterialTrackingBatchId;"; cmd.CommandType = System.Data.CommandType.Text; cmd.Parameters.AddWithValue("@MaterialId", slideOrderId); cmd.Parameters.AddWithValue("@MaterialTrackingBatchId", materialTrackingBatchId); using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { result = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); propertyWriter.WriteProperties(); } } } return(result); }
public static Domain.MaterialLocationCollection GetMaterialLocationCollection() { YellowstonePathology.Business.Domain.MaterialLocationCollection result = new Domain.MaterialLocationCollection(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "Select * from tblMaterialLocation order by Name;"; cmd.CommandType = System.Data.CommandType.Text; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Domain.MaterialLocation materialLocation = new YellowstonePathology.Business.Domain.MaterialLocation(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(materialLocation, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(materialLocation); } } } return(result); }
public static Test.ThinPrepPap.AcidWashList GetAcidWashList(DateTime startDate) { Test.ThinPrepPap.AcidWashList result = new Test.ThinPrepPap.AcidWashList(); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "Select pso.MasterAccessionNo, po.ReportNo, po.OrderDate, po.Accepted, a.PLastName, a.PFirstName, a.PMiddleInitial from tblPanelOrder po join tblPanelSetOrder pso on po.ReportNo = pso.ReportNo " + " join tblAccessionOrder a on pso.MasterAccessionNo = a.MasterAccessionNo where po.PanelId = 39 and po.OrderDate >= @StartDate order by po.OrderDate Desc"; cmd.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = startDate; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { Test.ThinPrepPap.AcidWashListItem acidWashLIstItem = new Test.ThinPrepPap.AcidWashListItem(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(acidWashLIstItem, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(acidWashLIstItem); } } } return result; }
private static YellowstonePathology.Business.Test.AbsoluteCD4Count.AbsoluteCD4CountTestOrder BuildReportOrderAbsoluteCD4Count(string reportNo) { YellowstonePathology.Business.Test.AbsoluteCD4Count.AbsoluteCD4CountTestOrder reportAbsoluteCD4Count = null; using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * " + "from tblAbsoluteCD4CountTestOrder ro " + "join tblPanelSetOrder pso on ro.ReportNo = pso.ReportNo " + "where ro.ReportNo = @ReportNo"; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@ReportNo", SqlDbType.VarChar).Value = reportNo; cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { reportAbsoluteCD4Count = new YellowstonePathology.Business.Test.AbsoluteCD4Count.AbsoluteCD4CountTestOrder(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(reportAbsoluteCD4Count, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } return reportAbsoluteCD4Count; }
private void BuildWebServiceAccount(YellowstonePathology.Business.WebService.WebServiceAccount webServiceAccount) { using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); this.m_SQLCommand.Connection = cn; using (MySqlDataReader dr = this.m_SQLCommand.ExecuteReader(CommandBehavior.KeyInfo)) { while (dr.Read()) { Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(webServiceAccount, dr); sqlDataReaderPropertyWriter.WriteProperties(); } if (dr.IsClosed == false) { dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.WebService.WebServiceAccountClient webServiceAccountClient = new YellowstonePathology.Business.WebService.WebServiceAccountClient(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(webServiceAccountClient, dr); sqlDataReaderPropertyWriter.WriteProperties(); webServiceAccountClient.ClientName = dr["ClientName"].ToString(); webServiceAccount.WebServiceAccountClientCollection.Add(webServiceAccountClient); } } } } }
public YellowstonePathology.Business.PreviousResultCollection GetPreviousResultsByTestFinal(int panelSetId, DateTime startDate, DateTime endDate, string tableName) { PreviousResultCollection result = new PreviousResultCollection(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = this.m_TableDictionary[tableName]; cmd.CommandText = cmd.CommandText.Replace("table_name", tableName); cmd.Parameters.AddWithValue("@PanelSetId", panelSetId); cmd.Parameters.AddWithValue("@StartDate", startDate); cmd.Parameters.AddWithValue("@EndDate", endDate); using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { PreviousResult previousResult = new PreviousResult(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(previousResult, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(previousResult); } } } return(result); }
public static List <WebService.WebServiceAccountView> GetWebServiceAccountViewList() { List <WebService.WebServiceAccountView> result = new List <WebService.WebServiceAccountView>(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "Select c.ClientName, w.WebServiceAccountId, w.PrimaryClientId, w.DisplayName, w.InitialPage from tblClient c join tblWebServiceAccount w on c.ClientId = w.PrimaryClientId order by w.DisplayName;"; cmd.CommandType = CommandType.Text; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { WebService.WebServiceAccountView webServiceAccountView = new WebService.WebServiceAccountView(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlServerDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(webServiceAccountView, dr); sqlServerDataReaderPropertyWriter.WriteProperties(); result.Add(webServiceAccountView); } } } return(result); }
public YellowstonePathology.Business.Search.PathologistSearchResult PathologistAliquotOrderIdSearch(string aliquotOrderId, int panelSetId) { SqlCommand cmd = new SqlCommand("pPathologistAliquotOrderIdSearch_4"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@AliquotOrderId", SqlDbType.VarChar).Value = aliquotOrderId; cmd.Parameters.Add("@PanelSetId", SqlDbType.Int).Value = panelSetId; YellowstonePathology.Business.Search.PathologistSearchResult result = null; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { result = new Search.PathologistSearchResult(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderProperyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); sqlDataReaderProperyWriter.WriteProperties(); } } } return(result); }
public static YellowstonePathology.Business.ClientOrder.Model.ClientOrder BuildClientOrder(SqlDataReader dr) { YellowstonePathology.Business.ClientOrder.Model.ClientOrder clientOrder = null; Nullable<int> panelSetId = null; while (dr.Read()) { if (dr["PanelSetId"] != DBNull.Value) { panelSetId = Convert.ToInt32(dr["PanelSetId"].ToString()); } } clientOrder = YellowstonePathology.Business.ClientOrder.Model.ClientOrderFactory.GetClientOrder(panelSetId); dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientOrder, dr); propertyWriter.WriteProperties(); } dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(clientLocation, dr); propertyWriter.WriteProperties(); clientOrder.ClientLocation = clientLocation; } return clientOrder; }
public static YellowstonePathology.Business.View.StVClientDOHReportViewCollection GetReportDistributionCollectionByDateTumorRegistryStVClients(DateTime startDate, DateTime endDate) { YellowstonePathology.Business.View.StVClientDOHReportViewCollection result = new YellowstonePathology.Business.View.StVClientDOHReportViewCollection(); string sql = "select tord.ReportNo, ao.ClientName, tord.ClientName ReportedTo, tord.TimeOfLastDistribution from tblTestOrderReportDistribution tord " + "join tblPanelSetOrder pso on tord.ReportNo = pso.ReportNo " + "join tblAccessionOrder ao on ao.MasterAccessionNo = pso.MasterAccessionNo " + "join tblClientGroupClient cgc on ao.ClientId = cgc.ClientId " + "where tord.DateAdded between @StartDate and @EndDate and tord.DistributionType in('MTDOH', 'WYDOH') and cgc.ClientGroupId = 1;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = sql; cmd.Parameters.AddWithValue("@StartDate", startDate); cmd.Parameters.AddWithValue("@EndDate", endDate); cmd.CommandType = CommandType.Text; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.View.StVClientDOHReportView view = new YellowstonePathology.Business.View.StVClientDOHReportView(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(view, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(view); } } } return(result); }
public static void BuildClientOrderDetailCollection(YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetailCollection clientOrderDetailCollection, MySqlDataReader dr) { int clientOrderDetailCount = 0; while (dr.Read()) { clientOrderDetailCount = Convert.ToInt32(dr["ClientOrderDetailCount"].ToString()); } if (clientOrderDetailCount > 0) { for (int i = 0; i < clientOrderDetailCount; i++) { dr.NextResult(); string orderTypeCode = null; while (dr.Read()) { orderTypeCode = dr["OrderTypeCode"].ToString(); } dr.NextResult(); YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail clientOrderDetail = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetailFactory.GetClientOrderDetail(orderTypeCode, Persistence.PersistenceModeEnum.UpdateChangedProperties); while (dr.Read()) { YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientOrderDetail, dr); propertyWriter.WriteProperties(); clientOrderDetailCollection.Add(clientOrderDetail); } } } }
public static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection GetMaterialTrackingLogViewCollectionByBatchIdMasterAccessionNo(string materialTrackingBatchId, string masterAccessionNo) { YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection result = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from ViewMaterialTrackingLog where MaterialTrackingBatchId = @MaterialTrackingBatchId and MasterAccessionNo = @MasterAccessionNo"; cmd.CommandType = System.Data.CommandType.Text; cmd.Parameters.Add("@MaterialTrackingBatchId", System.Data.SqlDbType.VarChar).Value = materialTrackingBatchId; cmd.Parameters.Add("@MasterAccessionNo", System.Data.SqlDbType.VarChar).Value = masterAccessionNo; using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView materialTrackingLogView = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(materialTrackingLogView, dr); propertyWriter.WriteProperties(); result.Add(materialTrackingLogView); } } } return(result); }
public static YellowstonePathology.Business.Slide.Model.SlideOrderCollection_Base GetSlideOrdersWithPrintRequest() { YellowstonePathology.Business.Slide.Model.SlideOrderCollection_Base result = new Slide.Model.SlideOrderCollection_Base(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from tblSlideOrder where [Status] = 'PrintRequested'"; cmd.CommandType = System.Data.CommandType.Text; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Slide.Model.SlideOrder_Base slideOrder = new Slide.Model.SlideOrder_Base(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(slideOrder, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(slideOrder); } } } return(result); }
public static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch GetOpenBatchForFacilityLocation(string facilityId, string locationId) { YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch result = null; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * from tblMaterialTrackingBatch where IsOpen = 1 and FromFacilityId = @FacilityId and FromLocationId = @LocationId"; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@FacilityId", SqlDbType.VarChar).Value = facilityId; cmd.Parameters.Add("@LocationId", SqlDbType.VarChar).Value = locationId; using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { result = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } return(result); }
public static YellowstonePathology.Business.Slide.Model.SlideOrder GetSlideOrder(string slideOrderId) { YellowstonePathology.Business.Slide.Model.SlideOrder result = null; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from tblSlideOrder where SlideOrderid = @SlideOrderId"; cmd.CommandType = System.Data.CommandType.Text; cmd.Parameters.Add("@SlideOrderId", System.Data.SqlDbType.VarChar).Value = slideOrderId; using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { result = new YellowstonePathology.Business.Slide.Model.SlideOrder(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); propertyWriter.WriteProperties(); } } } return(result); }
public static Test.ThinPrepPap.AcidWashList GetAcidWashList(DateTime startDate) { Test.ThinPrepPap.AcidWashList result = new Test.ThinPrepPap.AcidWashList(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "Select pso.MasterAccessionNo, po.ReportNo, po.OrderTime, po.Accepted, a.PLastName, a.PFirstName, a.PMiddleInitial, po.Comment, su.UserName " + "from tblPanelOrder po " + "join tblSystemUser su on po.OrderedById = su.UserId " + "join tblPanelSetOrder pso on po.ReportNo = pso.ReportNo " + "join tblAccessionOrder a on pso.MasterAccessionNo = a.MasterAccessionNo where po.PanelId = 39 and po.OrderTime >= @StartDate " + "order by po.OrderTime Desc;"; cmd.Parameters.AddWithValue("@StartDate", startDate); using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { Test.ThinPrepPap.AcidWashListItem acidWashLIstItem = new Test.ThinPrepPap.AcidWashListItem(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(acidWashLIstItem, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(acidWashLIstItem); } } } result.SetState(); return(result); }
public static YellowstonePathology.UI.RetrospectiveReviewList GetRetrospectiveReviewKillList() { MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "SELECT a.MasterAccessionNo, pso.ReportNo, pso.PanelSetId, pso.FinalDate, pso.PanelSetName, psos.ReportNo as SurgicalReportNo, " + "sus.DisplayName as SurgicalFinaledBy, psos.FinalDate as SurgicalFinalDate " + "FROM tblAccessionOrder a " + "JOIN tblPanelSetOrder pso ON a.MasterAccessionNo = pso.MasterAccessionNo " + "join tblPanelSetOrder psos on a.MasterAccessionNo = psos.MasterAccessionNo " + "Left Outer Join tblSystemUser su on pso.OrderedById = su.UserId " + "join tblSystemUser sus on psos.FinaledById = sus.UserId " + "WHERE pso.PanelSetId = 262 and psos.PanelSetId = 13 " + "and pso.Final = 0 and pso.ExpectedFinalTime <= curdate() " + "ORDER BY AccessionTime desc; "; UI.RetrospectiveReviewList result = new UI.RetrospectiveReviewList(); using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { UI.RetrospectiveReviewListItem item = new UI.RetrospectiveReviewListItem(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(item, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(item); } } } return(result); }
private void BuildClientSupplyOrder(YellowstonePathology.Business.Client.Model.ClientSupplyOrder clientSupplyOrder) { using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); this.m_SQLCommand.Connection = cn; using (SqlDataReader dr = this.m_SQLCommand.ExecuteReader(CommandBehavior.KeyInfo)) { while (dr.Read()) { Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientSupplyOrder, dr); sqlDataReaderPropertyWriter.WriteProperties(); } dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.Client.Model.ClientSupplyOrderDetail clientSupplyOrderDetail = new YellowstonePathology.Business.Client.Model.ClientSupplyOrderDetail(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientSupplyOrderDetail, dr); sqlDataReaderPropertyWriter.WriteProperties(); clientSupplyOrder.ClientSupplyOrderDetailCollection.Add(clientSupplyOrderDetail); } } } }
public static MaterialTracking.Model.BlockSentNotReturnedCollection GetBlocksSentNotReturned() { MaterialTracking.Model.BlockSentNotReturnedCollection result = new MaterialTracking.Model.BlockSentNotReturnedCollection(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "pBlocksSentNotReturned"; cmd.CommandType = CommandType.StoredProcedure; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { MaterialTracking.Model.BlockSentNotReturned blockSentNotReturned = new MaterialTracking.Model.BlockSentNotReturned(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(blockSentNotReturned, dr); propertyWriter.WriteProperties(); result.Add(blockSentNotReturned); } } } return(result); }
public static YellowstonePathology.Business.Test.AccessionOrderView GetAccessionOrderView(string masterAccessionNo) { #if MONGO return AccessionOrderGatewayMongo.GetAccessionOrderView(masterAccessionNo); #else YellowstonePathology.Business.Test.AccessionOrderView result = null; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from tblAccessionOrder where MasterAccessionNo = @MasterAccessionNo"; cmd.Parameters.Add("@MasterAccessionNo", SqlDbType.VarChar).Value = masterAccessionNo; 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()) { result = new Test.AccessionOrderView(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } return result; #endif }
public static YellowstonePathology.Business.Client.Model.PhysicianClientDistributionListItem GetPhysicianClientDistributionCollection(string physicianClientId) { YellowstonePathology.Business.Client.Model.PhysicianClientDistributionListItem result = null; string sql = "Select c.ClientId, c.ClientName, ph.PhysicianId, ph.DisplayName PhysicianName, c.DistributionType, c.Fax FaxNumber " + "from tblPhysicianClient pc " + "join tblPhysicianClientDistribution pcd on pc.PhysicianClientId = pcd.PhysicianClientId " + "join tblPhysicianClient pc2 on pcd.DistributionId = pc2.PhysicianClientId " + "join tblClient c on pc2.ClientId = c.ClientId " + "join tblPhysician ph on pc2.Physicianid = ph.PhysicianId " + "where pc.PhysicianClientId = @PhysicianClientId;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = sql; cmd.Parameters.AddWithValue("@PhysicianClientId", physicianClientId); cmd.CommandType = CommandType.Text; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { string distributionType = dr["DistributionType"].ToString(); result = YellowstonePathology.Business.Client.Model.PhysicianClientDistributionFactory.GetPhysicianClientDistribution(distributionType); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } return(result); }
private static YellowstonePathology.Business.Test.FishAnalysis.FishAnalysisTestOrder BuildReportOrderFishAnalysis(string reportNo) { YellowstonePathology.Business.Test.FishAnalysis.FishAnalysisTestOrder reportFishAnalysis = null; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "Select * " + "from tblFishAnalysisTestOrder ro " + "join tblPanelSetOrder pso on ro.ReportNo = pso.ReportNo " + "where ro.ReportNo = @ReportNo;"; cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue("@ReportNo", reportNo); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { reportFishAnalysis = new YellowstonePathology.Business.Test.FishAnalysis.FishAnalysisTestOrder(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(reportFishAnalysis, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } return(reportFishAnalysis); }
public static YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistributionCollection GetReportDistributionCollectionByDateRangeTumorRegistry(DateTime startDate, DateTime endDate, string distributionType) { YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistributionCollection result = new YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistributionCollection(); string sql = "Select * from tblTestOrderReportDistribution where TimeOfLastDistribution between @StartDate and @EndDate and " + "DistributionType = @DistributionType;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = sql; cmd.Parameters.AddWithValue("@StartDate", startDate); cmd.Parameters.AddWithValue("@EndDate", endDate); cmd.Parameters.AddWithValue("@DistributionType", distributionType); cmd.CommandType = CommandType.Text; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistribution testOrderReportDistribution = new YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistribution(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(testOrderReportDistribution, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(testOrderReportDistribution); } } } return(result); }
private void Build(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch) { using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); m_SQLCommand.Connection = cn; using (MySqlDataReader dr = m_SQLCommand.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(materialTrackingBatch, dr); sqlDataReaderPropertyWriter.WriteProperties(); } dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog = new MaterialTracking.Model.MaterialTrackingLog(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(materialTrackingLog, dr); sqlDataReaderPropertyWriter.WriteProperties(); materialTrackingBatch.MaterialTrackingLogCollection.Add(materialTrackingLog); } } } }
private void BuildClient(YellowstonePathology.Business.Client.Model.Client client) { using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); this.m_SQLCommand.Connection = cn; using (SqlDataReader dr = this.m_SQLCommand.ExecuteReader(CommandBehavior.KeyInfo)) { while (dr.Read()) { Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(client, dr); sqlDataReaderPropertyWriter.WriteProperties(); } if (dr.IsClosed == false) { dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientLocation, dr); sqlDataReaderPropertyWriter.WriteProperties(); client.ClientLocationCollection.Add(clientLocation); } } } } }
public static YellowstonePathology.Business.Client.PhysicianClientDistributionCollection GetPhysicianClientDistributionCollection(int physicianId, int clientId) { YellowstonePathology.Business.Client.PhysicianClientDistributionCollection result = new Client.PhysicianClientDistributionCollection(); string sql = "Select c.ClientId, c.ClientName, ph.PhysicianId, ph.DisplayName [PhysicianName], c.DistributionType, c.Fax [FaxNumber], c.LongDistance " + "from tblPhysicianClient pc " + "join tblPhysicianClientDistribution pcd on pc.PhysicianClientId = pcd.PhysicianClientId " + "join tblPhysicianClient pc2 on pcd.DistributionId = pc2.PhysicianClientId " + "join tblClient c on pc2.ClientId = c.ClientId " + "join tblPhysician ph on pc2.Physicianid = ph.PhysicianId " + "where pc.ClientId = @ClientId and pc.PhysicianId = @PhysicianId"; SqlCommand cmd = new SqlCommand(); cmd.CommandText = sql; cmd.Parameters.Add("@PhysicianId", SqlDbType.Int).Value = physicianId; cmd.Parameters.Add("@ClientId", SqlDbType.Int).Value = clientId; cmd.CommandType = CommandType.Text; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { string distributionType = dr["DistributionType"].ToString(); YellowstonePathology.Business.Client.PhysicianClientDistribution physicianClientDistribution = YellowstonePathology.Business.Client.PhysicianClientDistributionFactory.GetPhysicianClientDistribution(distributionType); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(physicianClientDistribution, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(physicianClientDistribution); } } } return result; }
public static XElement GetSpecimenOrder(string masterAccessionNo) { XElement result = new XElement("SpecimenOrders"); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from tblSpecimenOrder where MasterAccessionno = '" + masterAccessionNo + "' order by SpecimenNumber"; cmd.CommandType = CommandType.Text; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder = new Specimen.Model.SpecimenOrder(); XElement specimenOrderElement = new XElement("SpecimenOrder"); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(specimenOrder, dr); sqlDataReaderPropertyWriter.WriteProperties(); YellowstonePathology.Business.Persistence.XmlPropertyReader xmlPropertyReader = new Persistence.XmlPropertyReader(specimenOrder, specimenOrderElement); xmlPropertyReader.Write(); result.Add(specimenOrderElement); } } } return result; }
private void BuildClient(YellowstonePathology.Business.Client.Model.Client client) { using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); this.m_SQLCommand.Connection = cn; using (MySqlDataReader dr = this.m_SQLCommand.ExecuteReader(CommandBehavior.KeyInfo)) { while (dr.Read()) { Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(client, dr); sqlDataReaderPropertyWriter.WriteProperties(); } if (dr.IsClosed == false) { dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientLocation, dr); sqlDataReaderPropertyWriter.WriteProperties(); client.ClientLocationCollection.Add(clientLocation); } } } } }
public static YellowstonePathology.Business.Client.Model.PhysicianCollection GetPhysiciansByClientId(int clientId) { YellowstonePathology.Business.Client.Model.PhysicianCollection physicianCollection = new Client.Model.PhysicianCollection(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "Select ph.* " + "from tblPhysician ph " + "join tblPhysicianClient pc on ph.PhysicianId = pc.PhysicianId " + "join tblClient c on pc.ClientId = c.ClientId " + "where c.ClientId = @ClientId"; cmd.Parameters.AddWithValue("@ClientId", clientId); cmd.CommandType = System.Data.CommandType.Text; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { Client.Model.Physician physician = new Client.Model.Physician(); Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(physician, dr); sqlDataReaderPropertyWriter.WriteProperties(); physicianCollection.Add(physician); } } } return(physicianCollection); }
public static YellowstonePathology.Business.ClientOrder.Model.ClientOrder BuildClientOrder(MySqlDataReader dr) { YellowstonePathology.Business.ClientOrder.Model.ClientOrder clientOrder = null; Nullable <int> panelSetId = null; while (dr.Read()) { if (dr["PanelSetId"] != DBNull.Value) { panelSetId = Convert.ToInt32(dr["PanelSetId"].ToString()); } } clientOrder = YellowstonePathology.Business.ClientOrder.Model.ClientOrderFactory.GetClientOrder(panelSetId); dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientOrder, dr); propertyWriter.WriteProperties(); } dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(clientLocation, dr); propertyWriter.WriteProperties(); clientOrder.ClientLocation = clientLocation; } return(clientOrder); }
public static WebService.WebServiceAccountCollection GetWebServiceAccounts() { WebService.WebServiceAccountCollection result = new WebService.WebServiceAccountCollection(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "Select * from tblWebServiceAccount;"; cmd.CommandType = CommandType.Text; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { WebService.WebServiceAccount webServiceAccount = new WebService.WebServiceAccount(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlServerDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(webServiceAccount, dr); sqlServerDataReaderPropertyWriter.WriteProperties(); result.Add(webServiceAccount); } } } return(result); }
public static YellowstonePathology.Business.Billing.Model.EODProcessStatusCollection GetBillingEODProcessStatusHistory() { YellowstonePathology.Business.Billing.Model.EODProcessStatusCollection result = new Billing.Model.EODProcessStatusCollection(); MySqlCommand cmd = new MySqlCommand("Select * from tblBillingEODProcess where ProcessDate >= @ProcessDate order by ProcessDate desc;"); cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue("@ProcessDate", DateTime.Today.AddDays(-30)); using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Billing.Model.EODProcessStatus status = new Billing.Model.EODProcessStatus(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(status, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(status); } } } return(result); }
public static YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection GetMaterialTrackingLogViewCollectionByBatchId(string materialTrackingBatchId) { YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection result = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection(); string sql = "SELECT " + "mtb.MaterialTrackingBatchId AS MaterialTrackingBatchId, " + "mtl.MaterialTrackingLogId AS MaterialTrackingLogId, " + "ao.MasterAccessionNo AS MasterAccessionNo, " + "ao.ClientAccessionNo AS ClientAccessionNo, " + "ao.PLastName AS PLastName, " + "ao.PFirstName AS PFirstName, " + "mtl.MaterialType AS MaterialType, " + " mtl.MaterialId AS MaterialId, " + "mtl.LogDate AS LogDate, " + "(CASE " + "WHEN " + "(mtl.MaterialType = 'Slide') " + "THEN " + "(SELECT " + "tblSlideOrder.Label " + "FROM " + "tblSlideOrder " + "WHERE " + "(tblSlideOrder.SlideOrderId = mtl.MaterialId)) " + "ELSE 'None' " + "END) AS `MaterialLabel`, " + "mtl.LoggedBy AS `LoggedBy` " + "FROM " + "tblMaterialTrackingBatch mtb " + "JOIN tblMaterialTrackingLog mtl ON mtb.MaterialTrackingBatchId = mtl.MaterialTrackingBatchId " + "Left JOIN tblAccessionOrder ao ON mtl.MasterAccessionNo = ao.MasterAccessionNo " + "where mtb.MaterialTrackingBatchId = @MaterialTrackingBatchId order by mtl.LogDate desc"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = sql; cmd.CommandType = System.Data.CommandType.Text; cmd.Parameters.AddWithValue("@MaterialTrackingBatchId", materialTrackingBatchId); using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView materialTrackingLogView = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(materialTrackingLogView, dr); propertyWriter.WriteProperties(); result.Add(materialTrackingLogView); } } } return(result); }
public static View.AccessionSlideOrderViewCollection GetAccessionSlideOrderViewCollectionByBatchId(string batchId) { View.AccessionSlideOrderViewCollection result = new View.AccessionSlideOrderViewCollection(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "Select slo.* from tblSlideOrder slo join tblMaterialTrackingLog mtl on slo.SlideOrderId = mtl.MaterialId " + "join tblTestOrder t on slo.TestOrderId = t.TestOrderId " + "join tblPanelOrder po on t.PanelOrderId = po.PanelOrderId " + "where mtl.MaterialTrackingBatchId = @BatchId order by slo.SlideOrderId; " + "Select ao.MasterAccessionNo, ao.PLastName, ao.PFirstName, ao.ClientId, ao.ClientName, ao.PhysicianId, " + "ao.PhysicianName, po.ReportNo, asl.SlideOrderId " + "from tblAccessionOrder ao " + "join tblSpecimenOrder so on ao.MasterAccessionNo = so.MasterAccessionNo " + "join tblAliquotOrder a on so.specimenOrderId = a.SpecimenOrderId " + "join tblSlideOrder asl on a.AliquotOrderId = asl.AliquotOrderId " + "join tblMaterialTrackingLog astl on asl.SlideOrderId = astl.MaterialId " + "join tblTestOrder t on asl.TestOrderId = t.TestOrderId " + "join tblPanelOrder po on t.PanelOrderId = po.PanelOrderId " + "where astl.MaterialTrackingBatchId = @BatchId;"; cmd.CommandType = System.Data.CommandType.Text; cmd.Parameters.AddWithValue("@BatchId", batchId); using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { View.AccessionSlideOrderView accessionSlideOrderView = new View.AccessionSlideOrderView(); Slide.Model.SlideOrder slideOrder = new Slide.Model.SlideOrder(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(slideOrder, dr); sqlDataReaderPropertyWriter.WriteProperties(); accessionSlideOrderView.SlideOrder = slideOrder; result.Add(accessionSlideOrderView); } dr.NextResult(); while (dr.Read()) { string slideOrderId = dr["SlideOrderId"].ToString(); foreach (View.AccessionSlideOrderView accessionSlideOrderView in result) { if (accessionSlideOrderView.SlideOrder.SlideOrderId == slideOrderId) { YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(accessionSlideOrderView, dr); sqlDataReaderPropertyWriter.WriteProperties(); break; } } } } } return(result); }
public static YellowstonePathology.Business.User.SystemUserCollection GetSystemUserCollection() { /*SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select su.UserId, su.Active, su.UserName, su.FirstName, su.LastName, su.Initials, su.Signature, su.DisplayName, su.EmailAddress, su.NationalProviderId, (select sr.* from tblSystemUserRole sr where sr.UserId = su.UserId " + "for xml Path('SystemUserRole'), type) [SystemUserRoleCollection] from tblSystemUser su order by su.UserName for xml Path('SystemUser'), root('SystemUserCollection')"; cmd.CommandType = System.Data.CommandType.Text; YellowstonePathology.Business.User.SystemUserCollection systemUserCollection = Persistence.SqlCommandHelper.ExecuteCollectionCommand<YellowstonePathology.Business.User.SystemUserCollection>(cmd); return systemUserCollection;*/ Type t = typeof(YellowstonePathology.Business.User.SystemUserCollection); ConstructorInfo ci = t.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[0], null); YellowstonePathology.Business.User.SystemUserCollection systemUserCollection = (YellowstonePathology.Business.User.SystemUserCollection)ci.Invoke(null); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select UserId, Active, UserName, FirstName, LastName, Initials, Signature, DisplayName, " + "EmailAddress, NationalProviderId from tblSystemUser order by UserName " + "select * from tblSystemUserRole"; cmd.CommandType = System.Data.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.User.SystemUser systemUser = new SystemUser(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(systemUser, dr); sqlDataReaderPropertyWriter.WriteProperties(); systemUserCollection.Add(systemUser); } dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.User.SystemUserRole systemUserRole = new SystemUserRole(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(systemUserRole, dr); sqlDataReaderPropertyWriter.WriteProperties(); foreach (SystemUser systemUser in systemUserCollection) { if (systemUser.UserId == systemUserRole.UserID) { systemUser.SystemUserRoleCollection.Add(systemUserRole); break; } } } } } return systemUserCollection; }
private void Build(YellowstonePathology.Business.Test.AliquotOrder aliquotOrder) { using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); this.m_SQLCommand.Connection = cn; using (SqlDataReader dr = this.m_SQLCommand.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(aliquotOrder, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } }
public void BuildClientOrder() { while (this.m_DataReader.Read()) { YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(this.m_ClientOrder, this.m_DataReader); propertyWriter.WriteProperties(); } this.m_DataReader.NextResult(); while (this.m_DataReader.Read()) { YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(clientLocation, this.m_DataReader); propertyWriter.WriteProperties(); this.m_ClientOrder.ClientLocation = clientLocation; } }
private void Build(object o) { using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString)) { cn.Open(); m_SQLCommand.Connection = cn; using (SqlDataReader dr = m_SQLCommand.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(o, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } }
public YellowstonePathology.Business.Search.PathologistSearchResult PathologistAliquotOrderIdSearch(string aliquotOrderId, int panelSetIdHint) { SqlCommand cmd = new SqlCommand("pPathologistAliquotOrderIdSearch_5"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@AliquotOrderId", SqlDbType.VarChar).Value = aliquotOrderId; List<YellowstonePathology.Business.Search.PathologistSearchResult> resultList = new List<Search.PathologistSearchResult>(); 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.Search.PathologistSearchResult result = new Search.PathologistSearchResult(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderProperyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); sqlDataReaderProperyWriter.WriteProperties(); resultList.Add(result); } } } if(resultList.Count == 0) { return null; } else if(resultList.Count == 1) { return resultList[0]; } else { foreach (YellowstonePathology.Business.Search.PathologistSearchResult item in resultList) { if (item.PanelSetId == panelSetIdHint) return item; } return resultList[0]; } }
private object ExcuteCommandAndBuild(SqlCommand cmd, Type topLevelType) { object result = null; using (SqlConnection cn = new SqlConnection("Data Source=TestSQL;Initial Catalog=YPIData;Integrated Security=True")) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { result = Activator.CreateInstance(topLevelType); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } return result; }
public static Reports.POCRetensionReportData GetPOCRetensionReport(DateTime startDate, DateTime endDate) { Reports.POCRetensionReportData result = new Reports.POCRetensionReportData(); SqlCommand cmd = new SqlCommand("prcPOCRetensionReport_1"); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.Add("@StartDate", System.Data.SqlDbType.DateTime).Value = startDate; cmd.Parameters.Add("@EndDate", System.Data.SqlDbType.DateTime).Value = endDate; using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { result.StartDate = (DateTime)dr[0]; } dr.NextResult(); while (dr.Read()) { Reports.POCRetensionReportDataItem pocRetensionReportDataItem = new Reports.POCRetensionReportDataItem(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(pocRetensionReportDataItem, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.POCRetensionReportDataItems.Add(pocRetensionReportDataItem); } } } if (result.POCRetensionReportDataItems.Count == 0) { Reports.POCRetensionReportDataItem pocRetensionReportDataItem = new Reports.POCRetensionReportDataItem(); pocRetensionReportDataItem.Status = "No Cases Found."; result.POCRetensionReportDataItems.Add(pocRetensionReportDataItem); } return result; }
public static YellowstonePathology.Business.Client.Model.PhysicianClientDistributionCollection GetPhysicianClientDistributionByPhysicianClientId(string physicianClientId) { YellowstonePathology.Business.Client.Model.PhysicianClientDistributionCollection result = new Client.Model.PhysicianClientDistributionCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from tblPhysicianClientDistribution where PhysicianClientId = @PhysicianClientId"; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@PhysicianClientId", SqlDbType.VarChar).Value = physicianClientId; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Client.Model.PhysicianClientDistribution physicianClientDistribution = new Client.Model.PhysicianClientDistribution(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(physicianClientDistribution, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(physicianClientDistribution); } } } return result; }
public static List<YellowstonePathology.Business.Client.Model.PhysicianClientDistributionView> GetPhysicianClientDistributionsV2(string physicianClientId) { List<YellowstonePathology.Business.Client.Model.PhysicianClientDistributionView> result = new List<YellowstonePathology.Business.Client.Model.PhysicianClientDistributionView>(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select pcd.*, c.ClientId, c.ClientName, ph.PhysicianId, ph.ObjectId as ProviderId, ph.DisplayName [PhysicianName], c.DistributionType " + "from tblPhysicianClient pc " + "join tblPhysicianClientDistribution pcd on pc.PhysicianClientId = pcd.PhysicianClientId " + "join tblPhysicianClient pc2 on pcd.DistributionId = pc2.PhysicianClientId " + "join tblClient c on pc2.ClientId = c.ClientId " + "join tblPhysician ph on pc2.ProviderId = ph.ObjectId " + "where pc.PhysicianClientId = @PhysicianClientId "; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@PhysicianClientId", SqlDbType.VarChar).Value = physicianClientId; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.BaseData.SqlConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Client.Model.PhysicianClientDistribution physicianClientDistribution = new YellowstonePathology.Business.Client.Model.PhysicianClientDistribution(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(physicianClientDistribution, dr); sqlDataReaderPropertyWriter.WriteProperties(); YellowstonePathology.Business.Client.Model.PhysicianClientDistributionView physicianClientDistributionView = new YellowstonePathology.Business.Client.Model.PhysicianClientDistributionView(physicianClientDistribution); sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(physicianClientDistributionView, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(physicianClientDistributionView); } } } return result; }
public static YellowstonePathology.Business.Client.Model.ClientCollection GetClientCollectionByClientGroupId(int clientGroupId) { YellowstonePathology.Business.Client.Model.ClientCollection result = new Client.Model.ClientCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select c.* " + "from tblClientGroup cg " + "join tblClientGroupClient cgc on cg.ClientGroupId = cgc.ClientGroupId " + "join tblclient c on cgc.ClientId = c.ClientId " + "where cgc.ClientGroupId = @ClientGroupId order by c.ClientName"; cmd.Parameters.Add("@ClientGroupId", SqlDbType.Int).Value = clientGroupId; cmd.CommandType = CommandType.Text; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.BaseData.SqlConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Client.Model.Client client = new YellowstonePathology.Business.Client.Model.Client(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(client, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(client); } } } return result; }
public static YellowstonePathology.Business.Client.Model.ClientSupplyCollection GetClientSupplyCollection(string supplyCategory) { YellowstonePathology.Business.Client.Model.ClientSupplyCollection result = new Client.Model.ClientSupplyCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from tblClientSupply where supplycategory = @SupplyCategory order by supplyname"; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@SupplyCategory", SqlDbType.VarChar).Value = supplyCategory; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Client.Model.ClientSupply clientSupply = new Client.Model.ClientSupply(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientSupply, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(clientSupply); } } } return result; }
public static Domain.ClientCollection GetClientsByProviderId(string objectId) { Domain.ClientCollection result = new Domain.ClientCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select c.* " + "from tblClient c " + "join tblPhysicianClient pc on c.ClientId = pc.ClientId " + "where pc.ProviderId = @ObjectId order by ClientName "; cmd.Parameters.Add("@ObjectId", SqlDbType.VarChar).Value = objectId; cmd.CommandType = CommandType.Text; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.BaseData.SqlConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Client.Model.Client client = new YellowstonePathology.Business.Client.Model.Client(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(client, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(client); } } } return result; }
public static YellowstonePathology.Business.Client.Model.PhysicianClientNameCollection GetPhysicianClientNameCollectionV2(string physicianClientId) { YellowstonePathology.Business.Client.Model.PhysicianClientNameCollection result = new YellowstonePathology.Business.Client.Model.PhysicianClientNameCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select pc.PhysicianClientId, pc.ClientId, pc.PhysicianId, pc.ProviderId, c.ClientName, p.FirstName, p.LastName, c.Telephone, c.Fax " + "from tblPhysicianClient pc join tblClient c on pc.ClientId = c.ClientId " + "join tblPhysician p on pc.ProviderId = p.ObjectId " + "where p.ObjectId = (select ProviderId from tblPhysicianClient where PhysicianClientId = @PhysicianClientId) order by c.ClientName"; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@PhysicianClientId", SqlDbType.VarChar).Value = physicianClientId; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.BaseData.SqlConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Client.Model.PhysicianClientName physicianClientName = new YellowstonePathology.Business.Client.Model.PhysicianClientName(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(physicianClientName, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(physicianClientName); } } } return result; }
public static YellowstonePathology.Business.Client.Model.ClientGroupClientCollection GetClientGroupClientCollectionByClientGroupId(int clientGroupId) { YellowstonePathology.Business.Client.Model.ClientGroupClientCollection result = new Client.Model.ClientGroupClientCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from tblClientGroupClient where ClientGroupId = @ClientGroupId"; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@ClientGroupId", SqlDbType.Int).Value = clientGroupId; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Client.Model.ClientGroupClient clientGroupClient = new Client.Model.ClientGroupClient(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientGroupClient, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(clientGroupClient); } } } return result; }
private static Domain.Physician GetPhysicianFromCommand(SqlCommand cmd) { Domain.Physician result = null; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { result = new Domain.Physician(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } return result; }
/* public static Domain.PhysicianCollection GetPhysiciansByClientId(int clientId) { #if MONGO return PhysicianClientGatewayMongo.GetPhysiciansByClientId(clientId); #else Domain.PhysicianCollection result = new Domain.PhysicianCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select ph.* " + "from tblPhysician ph " + "join tblPhysicianClient pc on ph.PhysicianId = pc.PhysicianId " + "where pc.ClientId = @ClientId order by ph.LastName"; cmd.Parameters.Add("@ClientId", SqlDbType.Int).Value = clientId; cmd.CommandType = CommandType.Text; result = PhysicianClientGateway.GetPhysicianCollectionFromCommand(cmd); return result; #endif }*/ private static Domain.PhysicianCollection GetPhysicianCollectionFromCommand(SqlCommand cmd) { Domain.PhysicianCollection result = new Domain.PhysicianCollection(); using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.BaseData.SqlConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Domain.Physician physician = new Domain.Physician(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(physician, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(physician); } } } return result; }
private static View.PhysicianClientView BuildPhysicianClientView(SqlCommand cmd) { View.PhysicianClientView result = new View.PhysicianClientView(); using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); sqlDataReaderPropertyWriter.WriteProperties(); } dr.NextResult(); while (dr.Read()) { YellowstonePathology.Business.Client.Model.Client client = new YellowstonePathology.Business.Client.Model.Client(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(client, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Clients.Add(client); } } } return result; }
public static YellowstonePathology.Business.Client.Model.ClientGroupClientCollection GetClientGroupClientCollectionByClientGroupId(List<int> clientGroupIds) { string inClause = YellowstonePathology.Business.Helper.IdListHelper.ToIdString(clientGroupIds); YellowstonePathology.Business.Client.Model.ClientGroupClientCollection result = new Client.Model.ClientGroupClientCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from tblClientGroupClient where ClientGroupId in (" + inClause + ")"; cmd.CommandType = CommandType.Text; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Client.Model.ClientGroupClient clientGroupClient = new Client.Model.ClientGroupClient(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientGroupClient, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(clientGroupClient); } } } return result; }
public static YellowstonePathology.Business.Client.Model.PhysicianNameViewCollection GetPhysicianNameViewCollectionByPhysicianLastNameV2(string physicianLastName) { YellowstonePathology.Business.Client.Model.PhysicianNameViewCollection result = new YellowstonePathology.Business.Client.Model.PhysicianNameViewCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select ph.PhysicianId, ph.ObjectId as ProviderId, ph.FirstName, ph.LastName, c.Telephone [HomeBasePhone], c.Fax [HomeBaseFax] " + "from tblPhysician ph " + "left outer join tblClient c on ph.HomeBaseClientId = c.ClientId " + "where ph.LastName like @LastName + '%' order by ph.FirstName "; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@LastName", SqlDbType.VarChar).Value = physicianLastName; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.BaseData.SqlConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Client.Model.PhysicianNameView physicianNameView = new YellowstonePathology.Business.Client.Model.PhysicianNameView(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(physicianNameView, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(physicianNameView); } } } return result; }
public static YellowstonePathology.Business.Client.Model.ClientGroupCollection GetClientGroupCollection() { #if MONGO return PhysicianClientGatewayMongo.GetClientGroupCollection(); #else YellowstonePathology.Business.Client.Model.ClientGroupCollection result = new Client.Model.ClientGroupCollection(); SqlCommand cmd = new SqlCommand("select * from tblClientGroup order by GroupName"); cmd.CommandType = CommandType.Text; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Client.Model.ClientGroup clientGroup = new Client.Model.ClientGroup(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientGroup, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(clientGroup); } } } return result; #endif }
public static YellowstonePathology.Business.Client.PhysicianClientCollection GetPhysicianClientListByPhysicianLastNameV2(string physicianLastName) { YellowstonePathology.Business.Client.PhysicianClientCollection result = new Client.PhysicianClientCollection(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select pp.PhysicianClientId, c.ClientId, c.ClientName, ph.PhysicianId, ph.ObjectId [ProviderId], ph.DisplayName [PhysicianName], c.DistributionType, c.Fax [FaxNumber], c.Telephone, c.LongDistance, c.FacilityType, ph.NPI " + "from tblClient c " + "join tblPhysicianClient pp on c.clientid = pp.clientid " + "Join tblPhysician ph on pp.ProviderId = ph.ObjectId " + "where ph.LastName like @LastName + '%' order by ph.LastName, ph.FirstName, c.ClientName"; cmd.CommandType = CommandType.Text; cmd.Parameters.Add(@"LastName", SqlDbType.VarChar, 50).Value = physicianLastName; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Client.PhysicianClient physicianClient = new Client.PhysicianClient(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(physicianClient, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(physicianClient); } } } return result; }