Exemple #1
0
        private void addAddress_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (((Companies)companiesBindingSource.Current).Id > 0)
            {
                Addresses newAddress = new Addresses();

                ((Companies)companiesBindingSource.Current).Address = newAddress;
                companiesBindingSource.ResetBindings(false);

                addressGroupbox.Visible = !(addAddress.Visible = false);
            }
            else
            {
                MessageBox.Show("You must save the Company record first");
            }
        }
Exemple #2
0
        private void addAddress_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if ( ((Agencies)agenciesBindingSource.Current).Id > 0)
            {
                Addresses newAddress = new Addresses();
                //{
                //    Street1 = "535 Bourke Street",
                //    Suburb = "Melbourne",
                //    StateID = StateName.Victoria,
                //    Postcode = "3000"
                //};

                ((Agencies)agenciesBindingSource.Current).Address = newAddress;
                agenciesBindingSource.ResetBindings(false);

                addressGroupbox.Visible = !(addAddress.Visible = false);
            }
            else
            {
                MessageBox.Show("You must save the Agency record first");
            }
        }