Пример #1
0
        private void clickAdd(object sender, EventArgs e)
        {
            try
            {
                string   nombre     = name_text.Text;
                string   adress     = adresa_text.Text;
                string   IBAN       = iban_text.Text;
                int      ZipCode    = Int32.Parse(zipCode_text.Text);
                string   DNI        = DNI_text.Text;
                bool     Jubilado   = retired_check.Checked;
                DateTime nacimiento = birthDate.Value;

                service.AddNewUser(adress, IBAN, DNI, nombre, ZipCode, nacimiento, Jubilado);
            }
            catch (ServiceException sE) {
                var result = MessageBox.Show(sE.Message, "Error al afegir usuari", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (System.FormatException Fe)
            {
                var result = MessageBox.Show(Fe.Message, "Error de format", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            this.Hide();
            GestDepApp menu = new GestDepApp(service);

            menu.Show();
        }