Exemplo n.º 1
0
        private void FillSameHouseNbrGrid()
        {
            Household clsTmpHH = new Household(CCFBGlobal.connectionString);
            TrxLog    clsTmpTL = new TrxLog(CCFBGlobal.connectionString, true, true, true, true);

            string[] tmp = tbeAddress.Text.Split(' ');
            //tpgSameHouseNbr.Text = "Loading ...";
            lvwSameHouseNbr.Items.Clear();
            Application.DoEvents();
            if (tmp.Length > 0)
            {
                clsTmpHH.openWhere("Left(Address," + tmp[0].Length.ToString() + ") = '" + tmp[0] + "'", "Address, Name");
                for (int i = 0; i < clsTmpHH.RowCount; i++)
                {
                    clsTmpHH.SetRecord(i);
                    ListViewItem lvi = new ListViewItem(clsTmpHH.Name);
                    lvi.SubItems.Add(clsTmpHH.Inactive.ToString());
                    lvi.SubItems.Add(clsTmpHH.Address);
                    lvi.SubItems.Add(clsTmpHH.AptNbr);
                    lvi.SubItems.Add(clsTmpHH.City + ", " + clsTmpHH.State + " " + clsTmpHH.Zipcode);
                    lvi.SubItems.Add(clsTmpTL.GetNBrTrxByHH(clsTmpHH.ID).ToString());
                    lvi.SubItems.Add(clsTmpHH.ID.ToString());
                    lvwSameHouseNbr.Items.Add(lvi);
                }
                //tpgSameHouseNbr.Text = "[" + lvwSameHouseNbr.Items.Count.ToString() + "] " + tpgSameHouseNbr.Tag.ToString();
                lvwSameHouseNbr.Visible = true;
                //tabControl1.SelectedIndex = 1;
            }
            else
            {
                //tpgSameHouseNbr.Text = "";
                lvwSameHouseNbr.Visible = false;
            }
        }
Exemplo n.º 2
0
        private bool TestForHousehold(int TestHHId)
        {
            Household clsTmpHH = new Household(CCFBGlobal.connectionString);
            string    sqlWhere = "Name = '" + tbHHName.Text + "'";

            if (TestHHId > 0)
            {
                sqlWhere += " OR ID = " + TestHHId.ToString();
            }
            clsTmpHH.openWhere(sqlWhere);
            if (clsTmpHH.RowCount > 0)
            {
                lvwHouseholds.Items.Clear();
                for (int i = 0; i < clsTmpHH.RowCount; i++)
                {
                    clsTmpHH.SetRecord(i);
                    ListViewItem lvItm = new ListViewItem(clsTmpHH.Name);
                    lvItm.SubItems.Add(clsTmpHH.Inactive.ToString());
                    lvItm.SubItems.Add(clsTmpHH.Address.ToString());
                    lvItm.SubItems.Add(clsTmpHH.City.ToString() + ", " + clsTmpHH.State.ToString() + " " + clsTmpHH.Zipcode.ToString());
                    lvItm.SubItems.Add(clsTmpHH.HHMembersCount(clsTmpHH.ID).ToString());
                    lvItm.SubItems.Add(clsTmpHH.ID.ToString());
                    if (i % 2 == 0)
                    {
                        lvItm.BackColor = Color.White;
                    }
                    else
                    {
                        lvItm.BackColor = Color.LightYellow;
                    }


                    lvwHouseholds.Items.Add(lvItm);
                }
                panel1.Visible = true;
                return(true);
            }
            return(false);
        }