private bool Validar() { Boolean errorCampos = true; if (txtNombre.Text == string.Empty) { MensajeError.SetError(txtNombre, "debe ingresar el nombre del Producto"); txtNombre.Focus(); errorCampos = false; } else { MensajeError.SetError(txtNombre, ""); } if (txtPrecioCompra.Text == string.Empty) { MensajeError.SetError(txtPrecioCompra, "debe ingresar el precio de compra"); txtPrecioCompra.Focus(); errorCampos = false; } else { MensajeError.SetError(txtPrecioCompra, ""); } frmEmpleado empleado = new frmEmpleado(); if (!empleado.esNumerico(txtPrecioCompra.Text)) { MensajeError.SetError(txtPrecioCompra, "El precio debe ser numerico"); txtPrecioCompra.Focus(); errorCampos = false; } else { MensajeError.SetError(txtPrecioCompra, ""); } if (!empleado.esNumerico(txtPrecioVenta.Text)) { MensajeError.SetError(txtPrecioVenta, "El precio debe ser numerico"); txtPrecioVenta.Focus(); errorCampos = false; } else { MensajeError.SetError(txtPrecioVenta, ""); } return(errorCampos); }
private void adminEmpleadosToolStripMenuItem_Click(object sender, EventArgs e) { if (Empleado is null) { Empleado = new frmEmpleado { MdiParent = this }; Empleado.FormClosed += new FormClosedEventHandler(Empleado_FormClosed); Empleado.Show(); } else { Empleado.Activate(); } }
private Boolean Validar() { Boolean errorCampos = true; if (txtNombre.Text == string.Empty) { MensajeError.SetError(txtNombre, "debe ingresar el nombre del Cliente"); txtNombre.Focus(); errorCampos = false; } else { MensajeError.SetError(txtNombre, ""); } if (txtDocumento.Text == string.Empty) { MensajeError.SetError(txtDocumento, "debe ingresar el documento del Cliente"); txtDocumento.Focus(); errorCampos = false; } else { MensajeError.SetError(txtDocumento, ""); } frmEmpleado empleado = new frmEmpleado(); if (!empleado.esNumerico(txtDocumento.Text)) { MensajeError.SetError(txtNombre, "El documento debe ser numerico"); txtDocumento.Focus(); errorCampos = false; } else { MensajeError.SetError(txtDocumento, ""); } return(errorCampos); }
private void Empleado_FormClosed(object sender, FormClosedEventArgs e) { Empleado = null; }