예제 #1
0
        private bool TestForHHMember()
        {
            string[] splitName = tbHHName.Text.Split(',');
            panel1.Visible = false;
            lvwPeople.Items.Clear();
            HHMembers clsTmpHHM = new HHMembers(CCFBGlobal.connectionString);

            if (clsTmpHHM.openWhere("WHERE LastName = '" + splitName[0].Trim()
                                    + "' AND FirstName = '" + splitName[0].Trim() + "'", true) == true)
            {
                for (int i = 0; i < clsTmpHHM.RowCount; i++)
                {
                    clsTmpHHM.SetRecord(i);
                    ListViewItem lvItm = new ListViewItem(clsTmpHHM.LastName);
                    lvItm.SubItems.Add(clsTmpHHM.FirstName);
                    lvItm.SubItems.Add(clsTmpHHM.Birthdate.ToShortDateString());
                    lvItm.SubItems.Add(clsTmpHHM.Age.ToString());
                    lvItm.SubItems.Add(clsTmpHHM.HouseholdID.ToString());
                    if (i % 2 == 0)
                    {
                        lvItm.BackColor = Color.White;
                    }
                    else
                    {
                        lvItm.BackColor = Color.LightYellow;
                    }

                    lvwPeople.Items.Add(lvItm);
                    //TestForHousehold(clsTmpHHM.HouseholdID);
                }
                panel1.Visible = true;
                return(true);
            }
            return(TestForHousehold(0));
        }
        private bool TestForHHMember()
        {
            panel1.Visible = false;
            HHMembers clsTmpHHM = new HHMembers(CCFBGlobal.connectionString);

            lvwPeople.Items.Clear();
            lvwHouseholds.Items.Clear();
            if (clsTmpHHM.openWhere(" Where LastName = '" + tbLastName.Text + "' AND FirstName = '" + tbFirstName.Text + "'", true) == true)
            {
                for (int i = 0; i < clsTmpHHM.RowCount; i++)
                {
                    clsTmpHHM.SetRecord(i);
                    ListViewItem lvItm = new ListViewItem(clsTmpHHM.LastName);
                    lvItm.SubItems.Add(clsTmpHHM.FirstName);
                    lvItm.SubItems.Add(clsTmpHHM.Birthdate.ToShortDateString());
                    lvItm.SubItems.Add(clsTmpHHM.Age.ToString());
                    lvItm.SubItems.Add(clsTmpHHM.HouseholdID.ToString());
                    if (i % 2 == 0)
                    {
                        lvItm.BackColor = Color.White;
                    }
                    else
                    {
                        lvItm.BackColor = Color.LightYellow;
                    }

                    lvwPeople.Items.Add(lvItm);
                    TestForHousehold(clsTmpHHM.HouseholdID);
                }
                panel1.Visible = true;
                return(true);
            }
            if (addMember == false)
            {
                return(TestForHousehold(0));
            }
            else
            {
                return(false);
            }
        }