private void AddStainResult(YellowstonePathology.Business.Test.Model.Test test) { YellowstonePathology.Business.Test.Model.StainTest stainTest = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetStainTestByTestId(test.TestId); if (stainTest != null && !string.IsNullOrEmpty(stainTest.CptCode)) { YellowstonePathology.Business.SpecialStain.StainResultItem stainResultItem = this.m_SurgicalSpecimen.StainResultItemCollection.GetNextItem(this.m_SurgicalSpecimen.SurgicalSpecimenId); stainResultItem.TestOrderId = this.m_TestOrder.TestOrderId; stainResultItem.ProcedureName = test.TestName; stainResultItem.CptCode = stainTest.CptCode; stainResultItem.CptCodeQuantity = stainTest.CptCodeQuantity; stainResultItem.ControlComment = stainTest.ControlComment; stainResultItem.StainType = stainTest.StainType; stainResultItem.Billable = true; stainResultItem.Reportable = true; if (stainTest.ImmunoCommentId > 0) { YellowstonePathology.Business.Domain.ImmunoComment immunoComment = Business.Gateway.AccessionOrderGateway.GetImmunoCommentByImmunocommentId(stainTest.ImmunoCommentId); stainResultItem.ImmunoComment = immunoComment.Comment; } this.m_SurgicalSpecimen.StainResultItemCollection.Add(stainResultItem); } }
public static YellowstonePathology.Business.Domain.ImmunoComment GetImmunoCommentByImmunocommentId(int immunoCommentId) { YellowstonePathology.Business.Domain.ImmunoComment result = null; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "SELECT * from tblImmunoComment where immunocommentid = @ImmunoCommentId"; cmd.CommandType = System.Data.CommandType.Text; cmd.Parameters.Add("@ImmunoCommentId", SqlDbType.Int).Value = immunoCommentId; 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.Domain.ImmunoComment(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } return result; }