private void button1_Click(object sender, EventArgs e) { CondoForm condoForm = new CondoForm(); this.Hide(); condoForm.ShowDialog(this); }
private void addCond_button_Click(object sender, EventArgs e) { CondominioModel cond = new CondominioModel(); try { cond.num_fiscal = Decimal.Parse(num_fical_TextBox.Text.ToString()); cond.gerente_nif = (gerentes_listBox.SelectedItem as GerenteView).value; cond.nome = nome_cond_textBox.Text.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } if (adding) { SaveCondominio(cond); } else { UpdateCondominio(cond); } CondoForm parent = (CondoForm)Owner; parent.FillCondominiosLisBox(); parent.Show(); this.Close(); }