private bool Validar() { bool realizado = true; errorProvider.Clear(); if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text)) { errorProvider.SetError(IDnumericUpDown, "EL CAMPO ID NO PUEDE ESTAR VACIO"); IDnumericUpDown.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(CantidadtextBox.Text)) { errorProvider.SetError(IDnumericUpDown, "EL CAMPO CANTIDAD NO PUEDE ESTAR VACIO"); CantidadtextBox.Focus(); realizado = false; } if (this.DetalleEstudiantes.Count == 0) { errorProvider.SetError(dataGridView, "Debe agregar algun estudiante"); EstudiantecomboBox.Focus(); realizado = false; } return(realizado); }
private bool Validar() { bool paso = true; if (NombretextBox.Text == string.Empty) { MessageBox.Show("Este campo no puede quedar vacio"); ErroreserrorProvider.SetError(NombretextBox, "Este campo no puede quedar vacio"); NombretextBox.Focus(); paso = false; } if (CiudadBLL.ExisteCiudad(NombretextBox.Text)) { MessageBox.Show("Este nombre de ciudad ya existe en la base de datos"); ErroreserrorProvider.SetError(NombretextBox, "Este nombre de ciudad ya existe en la base de datos"); NombretextBox.Focus(); paso = false; } if (CiudadBLL.Existe((int)IDnumericUpDown.Value)) { MessageBox.Show("Este id de ciudad ya existe en la base de datos"); ErroreserrorProvider.SetError(IDnumericUpDown, "Este id de ciudad ya existe en la base de datos"); IDnumericUpDown.Focus(); paso = false; } return(paso); }
private void EliminarButton_Click(object sender, EventArgs e) { MyErrorProvider.Clear(); int id; int.TryParse(IDnumericUpDown.Text, out id); if (IDnumericUpDown.Value == 0) { MyErrorProvider.SetError(IDnumericUpDown, "El campo ID no puede estar vacio"); IDnumericUpDown.Focus(); } else { if (!ExisteEnLaBaseDeDatos()) { MessageBox.Show("No se puede Eliminar un Analisi que no existe", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (TiposAnalisisBLL.Eliminar(id)) { MessageBox.Show("Analisi Eliminada", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); Limpiar(); } else { MyErrorProvider.SetError(IDnumericUpDown, "Id no Existe"); } } }
private bool Validar() { bool validado = true; string obligatorio = "Campo obligatorio"; if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text)) { errorProvider.SetError(IDnumericUpDown, obligatorio); IDnumericUpDown.Focus(); validado = false; } if (string.IsNullOrWhiteSpace(CantidadtextBox.Text)) { errorProvider.SetError(CantidadtextBox, obligatorio); CantidadtextBox.Focus(); validado = false; } if (string.IsNullOrWhiteSpace(PreciotextBox.Text)) { errorProvider.SetError(PreciotextBox, "Seleccione un tipo de cacao"); TipoCacaocomboBox.Focus(); validado = false; } return(validado); }
private bool Validar() { bool realizado = true; string obligatorio = "Este campo es obligatorio"; errorProvider.Clear(); if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text)) { errorProvider.SetError(IDnumericUpDown, obligatorio); IDnumericUpDown.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(TipocomboBox.Text)) { errorProvider.SetError(TipocomboBox, obligatorio); TipocomboBox.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(PreciotextBox.Text)) { errorProvider.SetError(PreciotextBox, obligatorio); PreciotextBox.Focus(); realizado = false; } return(realizado); }
private void Eliminarbutton_Click(object sender, EventArgs e) { RepositorioBase <Pedidos> db = new RepositorioBase <Pedidos>(); if (!ValidarEliminar()) { return; } if (IDnumericUpDown.Value > 0) { if (PedidosBLL.Eliminar((int)IDnumericUpDown.Value)) { MessageBox.Show("Eliminado"); } else { MyErrorProvider.SetError(IDnumericUpDown, "No se puede elimina, porque no existe"); } } else { MyErrorProvider.SetError(IDnumericUpDown, "Selecione que pedido quiere eliminar"); IDnumericUpDown.Focus(); } Limpiar(); }
private bool Validar() { bool realizado = true; string obligatorio = "Este campo es obligatorio"; errorProvider.Clear(); if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text)) { errorProvider.SetError(IDnumericUpDown, obligatorio); IDnumericUpDown.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(NombreTextBox.Text)) { errorProvider.SetError(NombreTextBox, obligatorio); NombreTextBox.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(ContraseñaTextBox.Text)) { errorProvider.SetError(ContraseñaTextBox, obligatorio); ContraseñaTextBox.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(PreguntaSeguridadtextBox.Text)) { errorProvider.SetError(PreguntaSeguridadtextBox, obligatorio + "\n será necesario en caso de \n pérdida de la contraseña"); PreguntaSeguridadtextBox.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(RespuestaSeguridadtextBox.Text)) { errorProvider.SetError(RespuestaSeguridadtextBox, obligatorio + "\n será necesario en caso de \n pérdida de la contraseña"); RespuestaSeguridadtextBox.Focus(); realizado = false; } if (ContraseñaTextBox.Text == NombreTextBox.Text) { errorProvider.SetError(ContraseñaTextBox, "La contraseña no debe ser igual al nombre"); ContraseñaTextBox.Focus(); realizado = false; } if (ContraseñaTextBox.Text != ConfirmarContraseñatextBox.Text) { errorProvider.SetError(ContraseñaTextBox, "Las contraseñas no coinciden"); ContraseñaTextBox.Focus(); realizado = false; } if (AdministradorradioButton.Checked == false && EstandarradioButton.Checked == false) { errorProvider.SetError(EstandarradioButton, "Debe elegir una de las opciones"); EstandarradioButton.Focus(); realizado = false; } return(realizado); }
public bool ValidarEliminar() { bool paso = true; errorProvider.Clear(); if (IDnumericUpDown.Value == 0) { errorProvider.SetError(IDnumericUpDown, "Error al quere Eliminar registro"); IDnumericUpDown.Focus(); paso = false; } return(paso); }
private bool VEliminar() { bool paso = true; MyErrorProvider.Clear(); if (IDnumericUpDown.Value == 0) { MyErrorProvider.SetError(IDnumericUpDown, "Debe introducir un id para poder eliminar un producto"); IDnumericUpDown.Focus(); paso = false; } return(paso); }
private bool ValidarEliminar() { bool paso = true; MyErrorProvider.Clear(); if (IDnumericUpDown.Value == 0) { MyErrorProvider.SetError(IDnumericUpDown, "Busquelo y luego eliminelo."); IDnumericUpDown.Focus(); paso = false; } return(paso); }
public bool ValidarEliminar() { bool paso = true; errorProvider.Clear(); if (IDnumericUpDown.Value == 0) { errorProvider.SetError(IDnumericUpDown, "Busque otra ubicacion y luego eliminelo."); IDnumericUpDown.Focus(); paso = false; } return(paso); }
private bool Validar() { bool validado = true; string obligatorio = "Campo obligatorio"; if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text)) { errorProvider.SetError(IDnumericUpDown, obligatorio); IDnumericUpDown.Focus(); validado = false; } if (string.IsNullOrWhiteSpace(MontotextBox.Text)) { errorProvider.SetError(MontotextBox, obligatorio); MontotextBox.Focus(); validado = false; } if (ToDecimal(MontotextBox.Text) < 1) { errorProvider.SetError(MontotextBox, "El monto debe ser mayor a 0"); MontotextBox.Focus(); validado = false; } if (string.IsNullOrWhiteSpace(TiempotextBox.Text)) { errorProvider.SetError(TiempotextBox, obligatorio); TiempotextBox.Focus(); validado = false; } if (ToInt(TiempotextBox.Text) < 1) { errorProvider.SetError(TiempotextBox, "El tiempo debe ser mayor a un mes"); TiempotextBox.Focus(); validado = false; } if (string.IsNullOrWhiteSpace(FechadateTimePicker.Value.ToString())) { errorProvider.SetError(FechadateTimePicker, obligatorio); FechadateTimePicker.Focus(); validado = false; } return(validado); }
private bool Validar() { bool validado = true; string obligatorio = "Campo obligatorio"; if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text)) { errorProvider.SetError(IDnumericUpDown, obligatorio); IDnumericUpDown.Focus(); validado = false; } if (this.PagosDetalles.Count == 0) { errorProvider.SetError(dataGridView, obligatorio); CantidadtextBox.Focus(); validado = false; } return(validado); }
private void Eliminarbutton_Click(object sender, EventArgs e) { repos = new RepositorioBase <Lector>(new Contexto()); int.TryParse(IDnumericUpDown.Text, out int id); if (!ExisteEnLaBaseDeDatos()) { SuperErrorProvider.SetError(IDnumericUpDown, "Este Lector No Existe"); IDnumericUpDown.Focus(); return; } if (repos.Eliminar(id)) { MessageBox.Show("Lector Eliminado!!", "Exitoso!!!", MessageBoxButtons.OK); Limpiar(); } else { MessageBox.Show("No se pudo eliminar el Lector!!", "Fallo!!!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Eliminarbutton_Click(object sender, EventArgs e) { Estudent = new RepositorioBase <Estudiante>(new Contexto()); int.TryParse(IDnumericUpDown.Text, out int id); if (!ExisteEnLaBaseDeDatos()) { MyerrorProvider.SetError(IDnumericUpDown, "No Existe"); IDnumericUpDown.Focus(); return; } if (Estudent.Eliminar(id)) { MessageBox.Show("Eliminado Correctamente", "Exito", MessageBoxButtons.OK); Limpiar(); } else { MessageBox.Show("Error al eliminar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Eliminarbutton_Click(object sender, EventArgs e) { int id; repositorio = new RepositorioBase <Presupuesto>(); int.TryParse(IDnumericUpDown.Text, out id); if (!ExiteEnLaDb()) { errorProvider.SetError(IDnumericUpDown, "No Eliminado"); IDnumericUpDown.Focus(); return; } if (repositorio.Eliminar(id)) { MessageBox.Show("Eliminada "); } else { MessageBox.Show("No Elimino"); } }
private void button4_Click(object sender, EventArgs e) { int id; repositorio = new RepositorioBase <TiposCuentas>(); int.TryParse(IDnumericUpDown.Text, out id); if (!ExiteEnlaDB()) { errorProvider1.SetError(IDnumericUpDown, "No encontrado"); IDnumericUpDown.Focus(); return; } if (repositorio.Eliminar(id)) { MessageBox.Show("Elimino con Exito!!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); Limpiar(); } else { MessageBox.Show("No exite", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Eliminarbutton_Click(object sender, EventArgs e) { repository = new RepositoryBase <Articulos>(new DAL.Contexto()); int id; int.TryParse(IDnumericUpDown.Text, out id); if (!ExiteEnLaDb()) { errorProvider1.SetError(IDnumericUpDown, "Artuculo no Exite"); IDnumericUpDown.Focus(); return; } if (repository.Eliminar(id)) { MessageBox.Show("Eliminado con Exito", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); Limpiar(); } else { MessageBox.Show("No Exite No se puede Eliminar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void EliminarButton_Click(object sender, EventArgs e) { MyErrorProvider.Clear(); int id; int.TryParse(IDnumericUpDown.Text, out id); RepositorioBase <Estudiante> repositorio = new RepositorioBase <Estudiante>(); LimpiarEstudiante(); if (repositorio.Buscar(id) != null) { repositorio.Eliminar(id); } else { MyErrorProvider.SetError(IDnumericUpDown, "La asistencia que quiere eliminar, no esta registrada"); IDnumericUpDown.Focus(); } }
private void Eliminarbutton_Click(object sender, EventArgs e) { RepositoryBase <Usuario> repository = new RepositoryBase <Usuario>(); int id; int.TryParse(IDnumericUpDown.Text, out id); if (!ExiteEnLaDb()) { errorProvider1.SetError(IDnumericUpDown, "Este Usuario No Exite"); IDnumericUpDown.Focus(); return; } if (repository.Eliminar(id)) { MessageBox.Show("Usuario Eliminado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); Limpiar(); } else { MessageBox.Show("No se Pudo Eliminar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private bool Validar() { bool realizado = true; errorProvider.Clear(); if (string.IsNullOrWhiteSpace(tbMatricula.Text)) { errorProvider.SetError(tbMatricula, "EL CAMPO MATRICULA NO PUEDE ESTAR VACIO"); tbMatricula.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(tbNombre.Text)) { errorProvider.SetError(tbNombre, "EL CAMPO NOMBRE NO PUEDE ESTAR VACIO"); tbNombre.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text)) { errorProvider.SetError(IDnumericUpDown, "EL CAMPO ID NO PUEDE ESTAR VACIO"); IDnumericUpDown.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(tbCedula.Text.Replace("-", ""))) { errorProvider.SetError(tbCedula, "EL CAMPO CEDULA NO PUEDE ESTAR VACIO"); tbCedula.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(tbApellidos.Text)) { errorProvider.SetError(tbApellidos, "EL CAMPO TELEFONO NO PUEDE ESTAR VACIO"); tbApellidos.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(tbCelular.Text.Replace("-", ""))) { errorProvider.SetError(tbCelular, "EL CAMPO CELULAR NO PUEDE ESTAR VACIO"); tbCelular.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(tbTelefono.Text.Replace("-", ""))) { errorProvider.SetError(tbTelefono, "EL CAMPO TELEFONO NO PUEDE ESTAR VACIO"); tbTelefono.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(tbEmail.Text)) { errorProvider.SetError(tbEmail, "EL CAMPO EMAIL NO PUEDE ESTAR VACIO"); tbEmail.Focus(); realizado = false; } if (FechaNacimientoTimePicker.Value == DateTime.Now) { errorProvider.SetError(FechaNacimientoTimePicker, "EL CAMPO FECHA DE NACIMIENTO NO PUEDE SER IGUAL A LA FECHA ACTUAL"); FechaNacimientoTimePicker.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(cbSexo.Text)) { errorProvider.SetError(cbSexo, "EL CAMPO SEXO NO PUEDE ESTAR VACIO, POR FAVOR SELECCIONE UNA OPCION"); cbSexo.Focus(); realizado = false; } return(realizado); }
private bool Validar() { bool realizado = true; string obligatorio = "Este campo es obligatorio"; errorProvider.Clear(); if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text)) { errorProvider.SetError(IDnumericUpDown, obligatorio); IDnumericUpDown.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(NombretextBox.Text)) { errorProvider.SetError(NombretextBox, obligatorio); NombretextBox.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(ApellidostextBox.Text)) { errorProvider.SetError(ApellidostextBox, obligatorio); ApellidostextBox.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(DirecciontextBox.Text)) { errorProvider.SetError(DirecciontextBox, obligatorio); DirecciontextBox.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(EmailtextBox.Text)) { errorProvider.SetError(EmailtextBox, obligatorio); EmailtextBox.Focus(); realizado = false; } if (!EmailValido(EmailtextBox.Text)) { errorProvider.SetError(EmailtextBox, "Email no valido"); EmailtextBox.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(CedulamaskedTextBox.Text.Replace("-", "")) || (CedulamaskedTextBox.MaskFull == false)) { errorProvider.SetError(CedulamaskedTextBox, obligatorio); CedulamaskedTextBox.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(CelularmaskedTextBox.Text.Replace("-", "")) || (CelularmaskedTextBox.MaskFull == false)) { errorProvider.SetError(CelularmaskedTextBox, obligatorio); CelularmaskedTextBox.Focus(); realizado = false; } if (string.IsNullOrWhiteSpace(TelefonomaskedTextBox.Text.Replace("-", "")) || (TelefonomaskedTextBox.MaskFull == false)) { errorProvider.SetError(TelefonomaskedTextBox, obligatorio); TelefonomaskedTextBox.Focus(); realizado = false; } if (TelefonomaskedTextBox.Text == CelularmaskedTextBox.Text) { errorProvider.SetError(CelularmaskedTextBox, obligatorio); CelularmaskedTextBox.Focus(); realizado = false; } if (FijoradioButton.Checked == false && AmbulanteradioButton.Checked == false) { errorProvider.SetError(AmbulanteradioButton, obligatorio); FijoradioButton.Focus(); AmbulanteradioButton.Focus(); realizado = false; } if (ValidarNombre()) { errorProvider.SetError(NombretextBox, "Ya existe un productor con este nombre \n vaya a Consultas->Productores para \n mas detalles"); NombretextBox.Focus(); realizado = false; } if (ValidarCedula()) { errorProvider.SetError(CedulamaskedTextBox, "Ya existe un productor con esta cedula \n vaya a Consultas->Productores para \n mas detalles"); CedulamaskedTextBox.Focus(); realizado = false; } if (ValidarCelular()) { errorProvider.SetError(CedulamaskedTextBox, "Ya existe un productor con este celular \n vaya a Consultas->Productores para \n mas detalles"); CelularmaskedTextBox.Focus(); realizado = false; } if (ValidarTelefono()) { errorProvider.SetError(TelefonomaskedTextBox, "Ya existe un productor con este telefono \n vaya a Consultas->Productores para \n mas detalles"); TelefonomaskedTextBox.Focus(); realizado = false; } return(realizado); }
private bool validar() { bool paso = true; if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text)) { MyerrorProvider.SetError(IDnumericUpDown, "El campo no debe estar vacio"); IDnumericUpDown.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(NombretextBox.Text)) { MyerrorProvider.SetError(NombretextBox, "El campo no debe estar vacio"); NombretextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(MatriculatextBox.Text)) { MyerrorProvider.SetError(MatriculatextBox, "El campo no debe estar vacio"); MatriculatextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(EmailtextBox.Text)) { MyerrorProvider.SetError(EmailtextBox, "El campo no debe estar vacio"); EmailtextBox.Focus(); paso = false; } if (ValidaEmail()) { MyerrorProvider.SetError(EmailtextBox, "Ya existe un estudiante con este Email"); EmailtextBox.Focus(); paso = false; } if (!EmailValido(EmailtextBox.Text)) { MyerrorProvider.SetError(EmailtextBox, "Email no valido"); EmailtextBox.Focus(); paso = false; } if (ValidarMatricula()) { MyerrorProvider.SetError(MatriculatextBox, "Ya existe un estudiante con esta matricula"); MatriculatextBox.Focus(); paso = false; } if (ValidarCelular()) { MyerrorProvider.SetError(CelularMaskedTextBox, "Ya existe un estudiante con este celular"); CelularMaskedTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(ApellidotextBox.Text)) { MyerrorProvider.SetError(ApellidotextBox, "El campo no debe estar vacio"); ApellidotextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(DirecciontextBox.Text)) { MyerrorProvider.SetError(DirecciontextBox, "El Campo no debe estar vacio"); DirecciontextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(CelularMaskedTextBox.Text)) { MyerrorProvider.SetError(CelularMaskedTextBox, "El Campo no debe estar vacio"); CelularMaskedTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(UsuariocomboBox.Text)) { MyerrorProvider.SetError(UsuariocomboBox, "El Campo no debe estar vacio"); UsuariocomboBox.Focus(); paso = false; } if (FechadateTimePicker.Value > DateTime.Now) { MyerrorProvider.SetError(FechadateTimePicker, "La fecha no es correcta"); FechadateTimePicker.Focus(); paso = false; } return(paso); }