예제 #1
0
        private void FillData()
        {
            using (SqlConnection cn = new SqlConnection(BaseData.SqlConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;

                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    //int currentPhysicianClientId = 0;
                    string currentPhysicianClientId          = "0";
                    CytologyUnsatLetterItem       item       = new CytologyUnsatLetterItem();
                    CytologyUnsatLetterDetailItem detailItem = new CytologyUnsatLetterDetailItem();

                    while (dr.Read())
                    {
                        //int thisPhysicianClientId = BaseData.GetIntValue("PhysicianClientId", dr);
                        string thisPhysicianClientId = BaseData.GetStringValue("PhysicianClientId", dr);
                        if (thisPhysicianClientId != currentPhysicianClientId)
                        {
                            item = new CytologyUnsatLetterItem();
                            item.Fill(dr);
                            this.Add(item);

                            detailItem = new CytologyUnsatLetterDetailItem();
                            detailItem.Fill(dr);
                            item.DetailItems.Add(detailItem);
                        }
                        else
                        {
                            detailItem = new CytologyUnsatLetterDetailItem();
                            detailItem.Fill(dr);
                            item.DetailItems.Add(detailItem);
                        }
                        currentPhysicianClientId = thisPhysicianClientId;
                    }
                }
            }
        }
예제 #2
0
        private void FillData()
        {
            using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;

                using (MySqlDataReader dr = cmd.ExecuteReader())
                {
                    string currentPhysicianClientId          = "0";
                    CytologyUnsatLetterItem       item       = new CytologyUnsatLetterItem();
                    CytologyUnsatLetterDetailItem detailItem = new CytologyUnsatLetterDetailItem();

                    while (dr.Read())
                    {
                        string thisPhysicianClientId = BaseData.GetStringValue("PhysicianClientId", dr);
                        if (thisPhysicianClientId != currentPhysicianClientId)
                        {
                            item = new CytologyUnsatLetterItem();
                            item.Fill(dr);
                            this.Add(item);

                            detailItem = new CytologyUnsatLetterDetailItem();
                            detailItem.Fill(dr);
                            item.DetailItems.Add(detailItem);
                        }
                        else
                        {
                            detailItem = new CytologyUnsatLetterDetailItem();
                            detailItem.Fill(dr);
                            item.DetailItems.Add(detailItem);
                        }
                        currentPhysicianClientId = thisPhysicianClientId;
                    }
                }
            }
        }