private void BuildPanelSetOrderCPTCodeBill(Test.PanelSetOrder panelSetOrder, XElement panelSetOrderElement) { List <XElement> panelSetOrderCPTCodeBillElements = (from item in panelSetOrderElement.Elements("PanelSetOrderCPTCodeBillCollection") select item).ToList <XElement>(); foreach (XElement panelSetOrderCPTCodeBillElement in panelSetOrderCPTCodeBillElements.Elements("PanelSetOrderCPTCodeBill")) { YellowstonePathology.Business.Test.PanelSetOrderCPTCodeBill panelSetOrderCPTCodeBill = new Test.PanelSetOrderCPTCodeBill(); YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(panelSetOrderCPTCodeBillElement, panelSetOrderCPTCodeBill); xmlPropertyWriter.Write(); panelSetOrder.PanelSetOrderCPTCodeBillCollection.Add(panelSetOrderCPTCodeBill); } }
private void BuildPanelSetOrderCPTCodeBill(Test.PanelSetOrder panelSetOrder, XElement panelSetOrderElement) { List<XElement> panelSetOrderCPTCodeBillElements = (from item in panelSetOrderElement.Elements("PanelSetOrderCPTCodeBillCollection") select item).ToList<XElement>(); foreach (XElement panelSetOrderCPTCodeBillElement in panelSetOrderCPTCodeBillElements.Elements("PanelSetOrderCPTCodeBill")) { YellowstonePathology.Business.Test.PanelSetOrderCPTCodeBill panelSetOrderCPTCodeBill = new Test.PanelSetOrderCPTCodeBill(); YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(panelSetOrderCPTCodeBillElement, panelSetOrderCPTCodeBill); xmlPropertyWriter.Write(); panelSetOrder.PanelSetOrderCPTCodeBillCollection.Add(panelSetOrderCPTCodeBill); } }
/*public static XElement GetClientBillingDetailReport(DateTime postDateStart, DateTime postDateEnd, Nullable<int> clientGroupId) { XElement result = new XElement("Document"); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "prcGetClientBillingDetailReport"; cmd.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = postDateStart; cmd.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = postDateEnd; cmd.Parameters.Add("@ClientGroupId", SqlDbType.Int).Value = clientGroupId; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (XmlReader xmlReader = cmd.ExecuteXmlReader()) { if (xmlReader.Read() == true) { result = XElement.Load(xmlReader); } } } return result; }*/ public static XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportData GetClientBillingDetailReport(DateTime postDateStart, DateTime postDateEnd, Nullable<int> clientGroupId) { XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportData result = new XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportData(); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "prcGetClientBillingDetailReport_1"; cmd.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = postDateStart; cmd.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = postDateEnd; cmd.Parameters.Add("@ClientGroupId", SqlDbType.Int).Value = clientGroupId; using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder = new XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientBillingDetailReportDataAccessionOrder, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(clientBillingDetailReportDataAccessionOrder); } dr.NextResult(); while (dr.Read()) { XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport = new XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientBillingDetailReportDataReport, dr); sqlDataReaderPropertyWriter.WriteProperties(); foreach(XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder in result) { if (clientBillingDetailReportDataReport.MasterAccessionNo == clientBillingDetailReportDataAccessionOrder.MasterAccessionNo) { clientBillingDetailReportDataAccessionOrder.ClientBillingDetailReportDataReports.Add(clientBillingDetailReportDataReport); break; } } } dr.NextResult(); while (dr.Read()) { Test.PanelSetOrderCPTCode panelSetOrderCPTCode = new Test.PanelSetOrderCPTCode(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(panelSetOrderCPTCode, dr); sqlDataReaderPropertyWriter.WriteProperties(); foreach (XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder in result) { bool added = false; foreach(XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport in clientBillingDetailReportDataAccessionOrder.ClientBillingDetailReportDataReports) if (panelSetOrderCPTCode.ReportNo == clientBillingDetailReportDataReport.ReportNo) { clientBillingDetailReportDataReport.PanelSetOrderCPTCodes.Add(panelSetOrderCPTCode); added = true; break; } if (added) break; } } dr.NextResult(); while (dr.Read()) { Test.PanelSetOrderCPTCodeBill panelSetOrderCPTCodeBill = new Test.PanelSetOrderCPTCodeBill(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(panelSetOrderCPTCodeBill, dr); sqlDataReaderPropertyWriter.WriteProperties(); foreach (XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder in result) { bool added = false; foreach (XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport in clientBillingDetailReportDataAccessionOrder.ClientBillingDetailReportDataReports) if (panelSetOrderCPTCodeBill.ReportNo == clientBillingDetailReportDataReport.ReportNo) { clientBillingDetailReportDataReport.PanelSetOrderCPTCodeBills.Add(panelSetOrderCPTCodeBill); added = true; break; } if (added) break; } } } } return result; }
public static XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportData GetClientBillingDetailReport(DateTime postDateStart, DateTime postDateEnd, string clientGroupId) { XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportData result = new XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportData(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "prcGetClientBillingDetailReport_2"; cmd.Parameters.AddWithValue("StartDate", postDateStart); cmd.Parameters.AddWithValue("EndDate", postDateEnd); cmd.Parameters.AddWithValue("ClientGroupId", clientGroupId); using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder = new XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientBillingDetailReportDataAccessionOrder, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(clientBillingDetailReportDataAccessionOrder); } dr.NextResult(); while (dr.Read()) { XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport = new XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientBillingDetailReportDataReport, dr); sqlDataReaderPropertyWriter.WriteProperties(); foreach (XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder in result) { if (clientBillingDetailReportDataReport.MasterAccessionNo == clientBillingDetailReportDataAccessionOrder.MasterAccessionNo) { clientBillingDetailReportDataAccessionOrder.ClientBillingDetailReportDataReports.Add(clientBillingDetailReportDataReport); break; } } } dr.NextResult(); while (dr.Read()) { Test.PanelSetOrderCPTCode panelSetOrderCPTCode = new Test.PanelSetOrderCPTCode(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(panelSetOrderCPTCode, dr); sqlDataReaderPropertyWriter.WriteProperties(); foreach (XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder in result) { bool added = false; foreach (XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport in clientBillingDetailReportDataAccessionOrder.ClientBillingDetailReportDataReports) { if (panelSetOrderCPTCode.ReportNo == clientBillingDetailReportDataReport.ReportNo) { clientBillingDetailReportDataReport.PanelSetOrderCPTCodes.Add(panelSetOrderCPTCode); added = true; break; } } if (added) { break; } } } dr.NextResult(); while (dr.Read()) { Test.PanelSetOrderCPTCodeBill panelSetOrderCPTCodeBill = new Test.PanelSetOrderCPTCodeBill(); Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(panelSetOrderCPTCodeBill, dr); sqlDataReaderPropertyWriter.WriteProperties(); foreach (XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder in result) { bool added = false; foreach (XPSDocument.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport in clientBillingDetailReportDataAccessionOrder.ClientBillingDetailReportDataReports) { if (panelSetOrderCPTCodeBill.ReportNo == clientBillingDetailReportDataReport.ReportNo) { clientBillingDetailReportDataReport.PanelSetOrderCPTCodeBills.Add(panelSetOrderCPTCodeBill); added = true; break; } } if (added) { break; } } } } } return(result); }
private void BuildPanelSetOrderCPTCodeBill(Test.PanelSetOrder panelSetOrder, XElement panelSetOrderElement) { List<XElement> panelSetOrderCPTCodeBillElements = (from item in panelSetOrderElement.Elements("PanelSetOrderCPTCodeBillCollection") select item).ToList<XElement>(); panelSetOrder.PanelSetOrderCPTCodeBillCollection.RemoveDeleted(panelSetOrderCPTCodeBillElements.Elements("PanelSetOrderCPTCodeBill")); foreach (XElement panelSetOrderCPTCodeBillElement in panelSetOrderCPTCodeBillElements.Elements("PanelSetOrderCPTCodeBill")) { string panelSetOrderCPTCodeBillId = panelSetOrderCPTCodeBillElement.Element("PanelSetOrderCPTCodeBillId").Value; YellowstonePathology.Business.Test.PanelSetOrderCPTCodeBill panelSetOrderCPTCodeBill = null; if (panelSetOrder.PanelSetOrderCPTCodeBillCollection.Exists(panelSetOrderCPTCodeBillId) == true) { panelSetOrderCPTCodeBill = panelSetOrder.PanelSetOrderCPTCodeBillCollection.Get(panelSetOrderCPTCodeBillId); } else { panelSetOrderCPTCodeBill = new Test.PanelSetOrderCPTCodeBill(); panelSetOrder.PanelSetOrderCPTCodeBillCollection.Add(panelSetOrderCPTCodeBill); } YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(panelSetOrderCPTCodeBillElement, panelSetOrderCPTCodeBill); xmlPropertyWriter.Write(); } }