Esempio n. 1
0
        private bool validationSave()
        {
            if (string.IsNullOrWhiteSpace(cboTipo.Text) == true)
            {
                MessageBox.Show("Seleccionar Tipo de Usuario", "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }

            if (txtpass.Text != txtConfPass.Text)
            {
                MessageBox.Show("Las contraseñas no Coinciden", "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtpass.Focus();
                return(false);
            }

            if (string.IsNullOrWhiteSpace(txttrabajador.Text) == true || string.IsNullOrWhiteSpace(txtpass.Text) == true || string.IsNullOrWhiteSpace(txtusuario.Text) == true)
            {
                MessageBox.Show("Verificar el Ingreso de Datos.", "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }

            if (update == false)
            {
                if (fn.Existencia("*", "Usuario", "Usuario='" + txtusuario.Text + "'") == true)
                {
                    MessageBox.Show("Nombre de Usuario ya Registrado", "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 2
0
        private bool validacionGuardar()
        {
            if (fn.Existencia("*", "Insumo", "Insumo='" + cbxInsumo.Text + "'") == false)
            {
                MessageBox.Show("El Insumo No Existe", "Alerta", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                return(false);
            }

            if (QuiereGuardar == true)
            {
                if (fn.Existencia("*", "StockAlmacen", "IDAlmacen='" + cbxAlmacen.SelectedValue + "' and IDInsumo='" + cbxInsumo.SelectedValue + "'") == true)
                {
                    MessageBox.Show("El Insumo que deseas registrar en el Almacen ya existe", "San Agustin", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return(false);
                }
            }


            if (txtStockTotal.Text == "")
            {
                error.SetError(txtStockTotal, "Debe ingresar stock del producto");
                txtStockTotal.Focus(); return(false);
            }



            return(true);
        }
 private void EGuardar()
 {
     try
     {
         if (fn.Existencia("*", "Condimento", "Condimento='" + txtCategoria.Text.TrimEnd() + "'") == true)
         {
             MessageBox.Show("EL Condimento ya se encuentra Registrada", "San Agustin", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
         }
         if (txtCategoria.Text == "")
         {
             MessageBox.Show("Ingrese el Insumo", "San Agustin", MessageBoxButtons.OK, MessageBoxIcon.Information);
             txtCategoria.Focus(); return;
         }
         if (QuiereGuardar == true)
         {
             fn.Registrar("Condimento", "'" + txtCategoria.Text.TrimEnd() + "','" + cbxCategoria.SelectedValue + "'");
         }
         else
         {
             fn.Modificar("CondimEnto", "Condimento='" + txtCategoria.Text.TrimEnd() + "',IDCategoria='" + cbxCategoria.SelectedValue + "'", "IDCondimento='" + IDCategoria + "'");
         }
         Bloquear(true);
         txtCategoria.Clear();
         MostrarDatosGrid();
         QuiereGuardar = true;
     }
     catch
     {
     }
 }
Esempio n. 4
0
        private bool validationSave()
        {
            if (cboTipoDocumento.SelectedValue == null)
            {
                MessageBox.Show("Seleccione Tipo de Documento", "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }

            if (Guardar == true)
            {
                if (fn.Existencia("*", "Proveedor", "Numero='" + txtidentificacion.Text + "'") == true)
                {
                    MessageBox.Show("El Proveedor con el numero de identificación '" + txtidentificacion.Text + "' YA SE ENCUENTRA REGISTRADO", "San Agustin", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return(false);
                }
            }

            return(true);
        }