private void btnSave_Click(object sender, EventArgs e) { bool saved = false; if (accountType == null) { account_types newAccountType = new account_types { description = txtDescription.Text, type = cbType.Text, state = rbActive.Checked }; saved = MnjTipoCuenta.getInstance().saveAccountType(newAccountType, true); } else { accountType.description = txtDescription.Text; accountType.type = cbType.Text; accountType.state = rbActive.Checked; saved = MnjTipoCuenta.getInstance().saveAccountType(accountType, false); } if (saved) { MessageBox.Show( "Datos almacenados con éxito", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information ); this.Close(); } }
private void btnAccountTypes_Click(object sender, EventArgs e) { MnjTipoCuenta mnjTipoCuenta = MnjTipoCuenta.getInstance(); mnjTipoCuenta.ShowDialog(this); mnjTipoCuenta.Focus(); }