Ejemplo n.º 1
0
        private void BtnSubmit_Click(object sender, RoutedEventArgs e)
        {
            string name, address, zipcode;

            name    = txtName.Text;
            address = txtAddress.Text;
            zipcode = txtZipCode.Text;

            if (string.IsNullOrWhiteSpace(address) == true)
            {
                MessageBox.Show("Please enter an address");
            }
            int  Zip;
            bool isZipAnInt = int.TryParse(zipcode, out Zip);

            if (isZipAnInt == false)
            {
                MessageBox.Show("Please enter a valid address");
            }

            EntryForm ef = new EntryForm(name, address, Zip);

            ef.Address = address;
            ef.Name    = name;
            ef.ZipCode = Convert.ToInt32(zipcode);
            lbxListBox.Items.Add(ef);
        }
Ejemplo n.º 2
0
        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            EntryForm e1 = new EntryForm();

            e1.Name    = txtName.Text;
            e1.Address = txtAddress.Text;
            e1.ZipCode = Convert.ToInt32(txtZip.Text);


            LSB1.Items.Add(e1);
        }