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(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); }
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; }