Example #1
0
        private static YellowstonePathology.Business.ClientOrder.Model.OrderTypeCollection BuildOrderTypeCollection(MySqlCommand cmd)
        {
            YellowstonePathology.Business.ClientOrder.Model.OrderTypeCollection orderTypeCollection = new YellowstonePathology.Business.ClientOrder.Model.OrderTypeCollection();
            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.ClientOrder.Model.OrderType             orderType      = new YellowstonePathology.Business.ClientOrder.Model.OrderType();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(orderType, dr);
                        propertyWriter.WriteProperties();
                        orderTypeCollection.Add(orderType);
                    }
                }
            }

            return(orderTypeCollection);
        }
Example #2
0
        private static YellowstonePathology.Business.ClientOrder.Model.OrderTypeCollection BuildOrderTypeCollection(SqlCommand cmd)
        {
            YellowstonePathology.Business.ClientOrder.Model.OrderTypeCollection orderTypeCollection = new YellowstonePathology.Business.ClientOrder.Model.OrderTypeCollection();
            using (SqlConnection cn = new SqlConnection(ServerSqlConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.ClientOrder.Model.OrderType orderType = new YellowstonePathology.Business.ClientOrder.Model.OrderType();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(orderType, dr);
                        propertyWriter.WriteProperties();
                        orderTypeCollection.Add(orderType);
                    }
                }
            }

            return orderTypeCollection;
        }