public static Domain.OrderCommentLogCollection OrderCommentLogCollectionFromCaseNotesKeys(Domain.CaseNotesKeyCollection caseNotesKeyCollection) { Domain.OrderCommentLogCollection result = new Domain.OrderCommentLogCollection(); foreach (Domain.CaseNotesKey caseNotesKey in caseNotesKeyCollection) { SqlCommand cmd = new SqlCommand(); cmd.CommandType = System.Data.CommandType.Text; switch (caseNotesKey.CaseNotesKeyName) { case Domain.CaseNotesKeyNameEnum.MasterAccessionNo: cmd.CommandText = "SELECT * from tblOrderCommentLog where MasterAccessionNo = '" + caseNotesKey.Key + "' order by LogDate"; break; case Domain.CaseNotesKeyNameEnum.ClientOrderId: cmd.CommandText = "SELECT * from tblOrderCommentLog where ClientOrderId = '" + caseNotesKey.Key + "' order by LogDate"; break; case Domain.CaseNotesKeyNameEnum.ContainerId: cmd.CommandText = "SELECT * from tblOrderCommentLog where ContainerId = '" + caseNotesKey.Key + "' order by LogDate"; break; case Domain.CaseNotesKeyNameEnum.SpecimenLogId: cmd.CommandText = "SELECT * from tblOrderCommentLog where SpecimenLogId = " + caseNotesKey.Key + " order by LogDate"; break; } Domain.OrderCommentLogCollection midCollection1 = BuildOrderCommentLogCollection(cmd); foreach (Domain.OrderCommentLog orderCommentLog in midCollection1) { result.AddUnique(orderCommentLog); } } return result; }
public static Domain.OrderCommentLogCollection OrderCommentLogCollectionFromCaseNotesKeys(Domain.CaseNotesKeyCollection caseNotesKeyCollection) { Domain.OrderCommentLogCollection result = new Domain.OrderCommentLogCollection(); foreach (Domain.CaseNotesKey caseNotesKey in caseNotesKeyCollection) { SqlCommand cmd = new SqlCommand(); cmd.CommandType = System.Data.CommandType.Text; switch (caseNotesKey.CaseNotesKeyName) { case Domain.CaseNotesKeyNameEnum.MasterAccessionNo: cmd.CommandText = "SELECT * from tblOrderCommentLog where MasterAccessionNo = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')"; break; case Domain.CaseNotesKeyNameEnum.ClientOrderId: cmd.CommandText = "SELECT * from tblOrderCommentLog where ClientOrderId = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')"; break; case Domain.CaseNotesKeyNameEnum.ContainerId: cmd.CommandText = "SELECT * from tblOrderCommentLog where ContainerId = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')"; break; case Domain.CaseNotesKeyNameEnum.SpecimenLogId: cmd.CommandText = "SELECT * from tblOrderCommentLog where SpecimenLogId = " + caseNotesKey.Key + " order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')"; break; } XElement xelement = Domain.Persistence.SqlXmlPersistence.CrudOperations.ExecuteXmlReaderCommand(cmd, Domain.Persistence.DataLocationEnum.ProductionData); Domain.OrderCommentLogCollection midCollection = BuildOrderCommentLogCollection(xelement); foreach (Domain.OrderCommentLog orderCommentLog in midCollection) { result.AddUnique(orderCommentLog); } } return result; }
public static Domain.OrderCommentLogCollection OrderCommentLogCollectionFromCaseNotesKeys(Domain.CaseNotesKeyCollection caseNotesKeyCollection) { Domain.OrderCommentLogCollection result = new Domain.OrderCommentLogCollection(); foreach (Domain.CaseNotesKey caseNotesKey in caseNotesKeyCollection) { MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; switch (caseNotesKey.CaseNotesKeyName) { case Domain.CaseNotesKeyNameEnum.MasterAccessionNo: cmd.CommandText = "SELECT * from tblOrderCommentLog where MasterAccessionNo = '" + caseNotesKey.Key + "' order by LogDate;"; break; case Domain.CaseNotesKeyNameEnum.ClientOrderId: cmd.CommandText = "SELECT * from tblOrderCommentLog where ClientOrderId = '" + caseNotesKey.Key + "' order by LogDate;"; break; case Domain.CaseNotesKeyNameEnum.ContainerId: cmd.CommandText = "SELECT * from tblOrderCommentLog where ContainerId = '" + caseNotesKey.Key + "' order by LogDate;"; break; case Domain.CaseNotesKeyNameEnum.SpecimenLogId: cmd.CommandText = "SELECT * from tblOrderCommentLog where SpecimenLogId = " + caseNotesKey.Key + " order by LogDate;"; break; } Domain.OrderCommentLogCollection midCollection1 = BuildOrderCommentLogCollection(cmd); foreach (Domain.OrderCommentLog orderCommentLog in midCollection1) { result.AddUnique(orderCommentLog); } } return(result); }
public static Business.XPSDocument.Result.Data.AccessionOrderDataSheetDataV2 GetAccessionOrderDataSheetData(string masterAccessionNo) { Test.AccessionOrder accessionOrder = GetAccessionOrder(masterAccessionNo); ClientOrder.Model.ClientOrderCollection clientOrderCollection = YellowstonePathology.Business.Gateway.ClientOrderGateway.GetClientOrdersByMasterAccessionNo(masterAccessionNo); Domain.OrderCommentLogCollection orderCommentLogCollection = Gateway.OrderCommentGateway.GetOrderCommentLogCollectionByMasterAccessionNo(masterAccessionNo); Business.XPSDocument.Result.Data.AccessionOrderDataSheetDataV2 accessionOrderDataSheetData = new Business.XPSDocument.Result.Data.AccessionOrderDataSheetDataV2(accessionOrder, clientOrderCollection, orderCommentLogCollection); return(accessionOrderDataSheetData); }
public static Domain.OrderCommentLogCollection GetOrderCommentLogCollectionByClientOrderId(string clientOrderId) { MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "gwOrderCommentsByClientOrderId_1;"; cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("ClientOrderId", clientOrderId); Domain.OrderCommentLogCollection result = BuildOrderCommentLogCollection(cmd); return(result); }
public static Domain.OrderCommentLogCollection GetOrderCommentsForSpecimenLogId(int specimenLogId) { MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "SELECT * from tblOrderCommentLog where SpecimenLogId = @SpecimenLogId order by LogDate desc;"; cmd.CommandType = System.Data.CommandType.Text; cmd.Parameters.AddWithValue("@SpecimenLogId", specimenLogId); Domain.OrderCommentLogCollection result = BuildOrderCommentLogCollection(cmd); return(result); }
public static Domain.OrderCommentLogCollection GetOrderCommentLogCollectionByMasterAccessionNo(string masterAccessionNo) { MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "gwOrderCommentsByMasterAccessionNo_1"; cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("MasterAccessionNo", masterAccessionNo); Domain.OrderCommentLogCollection result = BuildOrderCommentLogCollection(cmd); return(result); }
private static YellowstonePathology.Business.Domain.OrderCommentLogCollection BuildOrderCommentLogCollection(XElement sourceElement) { Domain.OrderCommentLogCollection orderCommentLogCollection = new Domain.OrderCommentLogCollection(); if (sourceElement != null) { foreach (XElement orderCommentLogElement in sourceElement.Elements("OrderCommentLog")) { Domain.OrderCommentLog orderCommentLog = BuildOrderCommentLog(orderCommentLogElement); orderCommentLogCollection.Add(orderCommentLog); } } return(orderCommentLogCollection); }
private static YellowstonePathology.Business.Domain.OrderCommentLogCollection BuildOrderCommentLogCollection(SqlCommand cmd) { Domain.OrderCommentLogCollection result = new Domain.OrderCommentLogCollection(); using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { Domain.OrderCommentLog orderCommentLog = new Domain.OrderCommentLog(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(orderCommentLog, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(orderCommentLog); } } } return result; }
private static YellowstonePathology.Business.Domain.OrderCommentLogCollection BuildOrderCommentLogCollection(MySqlCommand cmd) { Domain.OrderCommentLogCollection result = new Domain.OrderCommentLogCollection(); using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { Domain.OrderCommentLog orderCommentLog = new Domain.OrderCommentLog(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(orderCommentLog, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(orderCommentLog); } } } return(result); }
public static Domain.OrderCommentLogCollection OrderCommentLogCollectionFromCaseNotesKeys(Domain.CaseNotesKeyCollection caseNotesKeyCollection) { Domain.OrderCommentLogCollection result = new Domain.OrderCommentLogCollection(); foreach (Domain.CaseNotesKey caseNotesKey in caseNotesKeyCollection) { SqlCommand cmd = new SqlCommand(); cmd.CommandType = System.Data.CommandType.Text; switch (caseNotesKey.CaseNotesKeyName) { case Domain.CaseNotesKeyNameEnum.MasterAccessionNo: cmd.CommandText = "SELECT * from tblOrderCommentLog where MasterAccessionNo = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')"; break; case Domain.CaseNotesKeyNameEnum.ClientOrderId: cmd.CommandText = "SELECT * from tblOrderCommentLog where ClientOrderId = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')"; break; case Domain.CaseNotesKeyNameEnum.ContainerId: cmd.CommandText = "SELECT * from tblOrderCommentLog where ContainerId = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')"; break; case Domain.CaseNotesKeyNameEnum.SpecimenLogId: cmd.CommandText = "SELECT * from tblOrderCommentLog where SpecimenLogId = " + caseNotesKey.Key + " order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')"; break; } XElement xelement = Domain.Persistence.SqlXmlPersistence.CrudOperations.ExecuteXmlReaderCommand(cmd, Domain.Persistence.DataLocationEnum.ProductionData); Domain.OrderCommentLogCollection midCollection = BuildOrderCommentLogCollection(xelement); foreach (Domain.OrderCommentLog orderCommentLog in midCollection) { result.AddUnique(orderCommentLog); } } return(result); }
public AccessionOrderDataSheetDataV2(Test.AccessionOrder accessionOrder, ClientOrder.Model.ClientOrderCollection clientOrderCollection, Domain.OrderCommentLogCollection orderCommentLogCollection) { this.m_AccessionOrderDataSheetDataAccessionOrder = new AccessionOrderDataSheetDataAccessionOrder(accessionOrder, clientOrderCollection); this.m_AccessionOrderDataSheetDataClientOrders = new List <AccessionOrderDataSheetDataClientOrder>(); this.m_AccessionOrderDataSheetDataSpecimenOrders = new List <AccessionOrderDataSheetDataSpecimenOrder>(); this.m_AccessionOrderDataSheetDataCommentLogs = new List <AccessionOrderDataSheetDataCommentLog>(); foreach (Business.ClientOrder.Model.ClientOrder clientOrder in clientOrderCollection) { AccessionOrderDataSheetDataClientOrder accessionOrderDataSheetDataClientOrder = new AccessionOrderDataSheetDataClientOrder(clientOrder); this.m_AccessionOrderDataSheetDataClientOrders.Add(accessionOrderDataSheetDataClientOrder); } foreach (Specimen.Model.SpecimenOrder specimenOrder in accessionOrder.SpecimenOrderCollection) { AccessionOrderDataSheetDataSpecimenOrder accessionOrderDataSheetDataSpecimenOrder = new AccessionOrderDataSheetDataSpecimenOrder(specimenOrder, clientOrderCollection); this.m_AccessionOrderDataSheetDataSpecimenOrders.Add(accessionOrderDataSheetDataSpecimenOrder); } foreach (Domain.OrderCommentLog orderCommentLog in orderCommentLogCollection) { AccessionOrderDataSheetDataCommentLog accessionOrderDataSheetDataCommentLog = new AccessionOrderDataSheetDataCommentLog(orderCommentLog); this.m_AccessionOrderDataSheetDataCommentLogs.Add(accessionOrderDataSheetDataCommentLog); } }
private static YellowstonePathology.Business.Domain.OrderCommentLogCollection BuildOrderCommentLogCollection(XElement sourceElement) { Domain.OrderCommentLogCollection orderCommentLogCollection = new Domain.OrderCommentLogCollection(); if (sourceElement != null) { foreach (XElement orderCommentLogElement in sourceElement.Elements("OrderCommentLog")) { Domain.OrderCommentLog orderCommentLog = BuildOrderCommentLog(orderCommentLogElement); orderCommentLogCollection.Add(orderCommentLog); } } return orderCommentLogCollection; }