private async void RegistrarDocumento()
        {
            Documento documento = GenerarDocumento();

            if (documento != null)
            {
                btnGrabar.Visible = false;
                if (documento.Documento_Articulo.Count > 0)
                {
                    IServiceAlmacen service  = new ServiceAlmacen();
                    var             response = await service.DocumentoInsertAsync(documento);

                    if (response.IsValid)
                    {
                        MessageBox.Show("Proceso realizado satisfactoriamente", "Aviso");
                        documento = response.Value;
                        lblNumeroDocumento.Text = documento.TipoDocumento + "-" + documento.Sede.Codigo + "-" + documento.NroDocumento.ToString("0000000");
                        HideControls();
                    }
                    else
                    {
                        MessageBox.Show(response.ErrorMensaje);
                        btnGrabar.Visible = true;
                    }
                }
                else
                {
                    MessageBox.Show("Debe agregar al menos un articulo", "Aviso");
                    btnGrabar.Visible = true;
                }
            }
        }
        private async void RegistrarDocumento()
        {
            if (txtMontoDisponible.Text.Trim().Equals(string.Empty))
            {
                MessageBox.Show("Debe ingresar el monto disponible", "Aviso");
            }
            else
            {
                btnSalir.Enabled  = false;
                btnGrabar.Visible = false;
                docGenerado       = GenerarDocumento();

                if (docGenerado != null)
                {
                    if (docGenerado.Documento_Articulo.Count > 0)
                    {
                        IServiceAlmacen service  = new ServiceAlmacen();
                        var             response = await service.DocumentoInsertAsync(docGenerado);

                        if (response.IsValid)
                        {
                            MessageBox.Show("Proceso realizado satisfactoriamente", "Aviso");
                            docGenerado = response.Value;
                            DisableControls();
                            lblOrdenCompra.Text = docGenerado.TipoDocumento + "-" + docGenerado.TipoPresupuesto + "-" + docGenerado.NroDocumento.ToString("0000000");
                        }
                        else
                        {
                            btnGrabar.Visible          = true;
                            btnSalir.Enabled           = true;
                            txtMontoDisponible.Enabled = true;
                            MessageBox.Show(response.ErrorMensaje);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Debe agregar al menos un articulo", "Aviso");
                    }
                }
            }
        }