private bool ValidarCampos() { if (CbuTextBox.Text.Trim() == string.Empty) { errorProvider1.SetError(CbuTextBox, "Ingrese un CBU"); CbuTextBox.Focus(); return(false); } errorProvider1.Clear(); if (!Int64.TryParse(CbuTextBox.Text.Trim(), out Int64 cod)) { errorProvider1.SetError(CbuTextBox, "Ingrese un CBU válido"); CbuTextBox.Focus(); return(false); } errorProvider1.Clear(); if (SaldoTextBox.Text.Trim() == string.Empty) { errorProvider1.SetError(DineroLabel, "Ingrese un saldo"); SaldoTextBox.Focus(); return(false); } errorProvider1.Clear(); if (!int.TryParse(SaldoTextBox.Text.Trim(), out int val)) { errorProvider1.SetError(DineroLabel, "Ingrese un valor numérico"); SaldoTextBox.Focus(); return(false); } errorProvider1.Clear(); return(true); }
private void HabilitarCampos() { CbuTextBox.ReadOnly = false; SaldoTextBox.ReadOnly = false; GuardarDatosButton.Enabled = true; CancelarButton.Enabled = true; SaldoBusquedaTextBox.ReadOnly = true; CodCuentaBusquedaTextBox.ReadOnly = true; CbuTextBox.Focus(); materialTabControl1.SelectedTab = TabNueva; }