Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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();
     }
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 private void Empleado_FormClosed(object sender, FormClosedEventArgs e)
 {
     Empleado = null;
 }