public YellowstonePathology.Business.Search.PathologistSearchResult PathologistAliquotOrderIdSearch(string aliquotOrderId, int panelSetId)
        {
            SqlCommand cmd = new SqlCommand("pPathologistAliquotOrderIdSearch_4");
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@AliquotOrderId", SqlDbType.VarChar).Value = aliquotOrderId;
            cmd.Parameters.Add("@PanelSetId", SqlDbType.Int).Value = panelSetId;

            YellowstonePathology.Business.Search.PathologistSearchResult result = null;

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        result = new Search.PathologistSearchResult();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderProperyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr);
                        sqlDataReaderProperyWriter.WriteProperties();
                    }
                }
            }

            return result;
        }
Exemple #2
0
        public YellowstonePathology.Business.Search.PathologistSearchResult PathologistAliquotOrderIdSearch(string aliquotOrderId, int panelSetId)
        {
            SqlCommand cmd = new SqlCommand("pPathologistAliquotOrderIdSearch_4");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@AliquotOrderId", SqlDbType.VarChar).Value = aliquotOrderId;
            cmd.Parameters.Add("@PanelSetId", SqlDbType.Int).Value         = panelSetId;

            YellowstonePathology.Business.Search.PathologistSearchResult result = null;

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        result = new Search.PathologistSearchResult();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderProperyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr);
                        sqlDataReaderProperyWriter.WriteProperties();
                    }
                }
            }

            return(result);
        }
Exemple #3
0
        public YellowstonePathology.Business.Search.PathologistSearchResult PathologistAliquotOrderIdSearch(string aliquotOrderId, int panelSetIdHint)
        {
            SqlCommand cmd = new SqlCommand("pPathologistAliquotOrderIdSearch_5");
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@AliquotOrderId", SqlDbType.VarChar).Value = aliquotOrderId;

            List<YellowstonePathology.Business.Search.PathologistSearchResult> resultList = new List<Search.PathologistSearchResult>();

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.Search.PathologistSearchResult result = new Search.PathologistSearchResult();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderProperyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr);
                        sqlDataReaderProperyWriter.WriteProperties();
                        resultList.Add(result);
                    }
                }
            }

            if(resultList.Count == 0)
            {
                return null;
            }
            else if(resultList.Count == 1)
            {
                return resultList[0];
            }
            else
            {
                foreach (YellowstonePathology.Business.Search.PathologistSearchResult item in resultList)
                {
                    if (item.PanelSetId == panelSetIdHint) return item;
                }
                return resultList[0];
            }
        }
        private YellowstonePathology.Business.Search.PathologistSearchResultCollection BuildResultList(SqlCommand cmd)
        {
            YellowstonePathology.Business.Search.PathologistSearchResultCollection result = new Search.PathologistSearchResultCollection();

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.Search.PathologistSearchResult pathologistSearchResult = new Search.PathologistSearchResult();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderProperyWriter = new Persistence.SqlDataReaderPropertyWriter(pathologistSearchResult, dr);
                        sqlDataReaderProperyWriter.WriteProperties();
                        result.Add(pathologistSearchResult);
                    }
                }
            }
            return result;
        }
Exemple #5
0
        public YellowstonePathology.Business.Search.PathologistSearchResult PathologistAliquotOrderIdSearch(string aliquotOrderId, int panelSetIdHint)
        {
            MySqlCommand cmd = new MySqlCommand("pPathologistAliquotOrderIdSearch_5");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("AliquotOrderId", aliquotOrderId);

            List <YellowstonePathology.Business.Search.PathologistSearchResult> resultList = new List <Search.PathologistSearchResult>();

            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.Search.PathologistSearchResult          result = new Search.PathologistSearchResult();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderProperyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr);
                        sqlDataReaderProperyWriter.WriteProperties();
                        resultList.Add(result);
                    }
                }
            }

            if (resultList.Count == 0)
            {
                return(null);
            }
            else if (resultList.Count == 1)
            {
                return(resultList[0]);
            }
            else
            {
                foreach (YellowstonePathology.Business.Search.PathologistSearchResult item in resultList)
                {
                    if (item.PanelSetId == panelSetIdHint)
                    {
                        return(item);
                    }
                }
                return(resultList[0]);
            }
        }
Exemple #6
0
        private YellowstonePathology.Business.Search.PathologistSearchResultCollection BuildResultList(MySqlCommand cmd)
        {
            YellowstonePathology.Business.Search.PathologistSearchResultCollection result = new Search.PathologistSearchResultCollection();

            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.Search.PathologistSearchResult          pathologistSearchResult    = new Search.PathologistSearchResult();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderProperyWriter = new Persistence.SqlDataReaderPropertyWriter(pathologistSearchResult, dr);
                        sqlDataReaderProperyWriter.WriteProperties();
                        result.Add(pathologistSearchResult);
                    }
                }
            }
            return(result);
        }