Exemplo n.º 1
0
        private void SearchMember()
        {
            //Call the getMemberForename method from the Bookings Class and pass across the data.
            List <string> fnames = Bookings.getMemberForename(txtMemberID.Text);
            {
                //If the amount of names is greater than 0...
                if (fnames.Count > 0)
                {
                    //Create an instance of the stringbuilder class.
                    StringBuilder stringb = new StringBuilder();

                    foreach (string fname in fnames)
                    {
                        stringb.AppendLine(fname);
                        //Display the name in lblDisplayForename.
                        lblDisplayForename.Text = fname;
                    }
                }
            }

            //Call the getBookingSurname method from the Bookings Class and pass across the data.
            List <string> snames = Bookings.getMemberSurname(txtMemberID.Text);
            {
                //If the amount of names is greater than 0...
                if (snames.Count > 0)
                {
                    //Create an instance of the stringbuilder class.
                    StringBuilder string_b = new StringBuilder();

                    foreach (string sname in snames)
                    {
                        string_b.AppendLine(sname);
                        //Display the forname and surname in lblDisplaySurname.
                        lblDisplaySurname.Text = sname;
                    }
                }
            }

            //Call the getMemberStreet method from the Bookings Class and pass across the data.
            List <string> streets = Bookings.getMemberStreet(txtMemberID.Text);
            {
                //If the amount of streets is greater than 0...
                if (streets.Count > 0)
                {
                    //Create an instance of the stringbuilder class.
                    StringBuilder s_b = new StringBuilder();

                    foreach (string street in streets)
                    {
                        s_b.AppendLine(street);
                        //Display the postcode in lblDisplayStreet.
                        lblDisplayStreet.Text = street;
                    }
                }
            }

            //Call the getMemberTown method from the Bookings Class and pass across the data.
            List <string> towns = Bookings.getMemberTown(txtMemberID.Text);
            {
                //If the amount of towns is greater than 0...
                if (towns.Count > 0)
                {
                    //Create an instance of the stringbuilder class.
                    StringBuilder stringbuild = new StringBuilder();

                    foreach (string town in towns)
                    {
                        stringbuild.AppendLine(town);
                        //Display the postcode in lblDisplayTown.
                        lblDisplayTown.Text = town;
                    }
                }
            }

            //Call the getMemberCounty method from the Bookings Class and pass across the data.
            List <string> counties = Bookings.getMemberCounty(txtMemberID.Text);
            {
                //If the amount of counties is greater than 0...
                if (counties.Count > 0)
                {
                    //Create an instance of the stringbuilder class.
                    StringBuilder sbuild = new StringBuilder();

                    foreach (string county in counties)
                    {
                        sbuild.AppendLine(county);
                        //Display the postcode in lblDisplayCounty.
                        lblDisplayCounty.Text = county;
                    }
                }
            }

            //Call the getMemberPostCode method from the Bookings Class and pass across the data.
            List <string> pcs = Bookings.getMemberPostCode(txtMemberID.Text);
            {
                //If the amount of postcodes is greater than 0...
                if (pcs.Count > 0)
                {
                    //Create an instance of the stringbuilder class.
                    StringBuilder stbuilder = new StringBuilder();

                    foreach (string pc in pcs)
                    {
                        stbuilder.AppendLine(pc);
                        //Display the postcode in lblDisplayPostCode.
                        lblDisplayPostCode.Text = pc;
                    }
                }
            }
        }