/// <summary> /// Metodo privado que Invoca al hilo principal si fuese necesario y realiza la consulta para cambiar el estado en la base de datos /// Si no se puede, lanza exception /// </summary> private void Construir() { try { if (this.dGVPedidos.InvokeRequired) { this.dGVPedidos.BeginInvoke( (MethodInvoker) delegate() { if (!(this.dGVPedidos.CurrentRow.DataBoundItem is null)) { int auxId = Convert.ToInt32(this.dGVPedidos.CurrentRow.Cells[0].Value); domo.ActualizarEstado(auxId); this.ActualizarLista(); } } ); } } catch (Exception ex) { throw new DomoException("El domo seleccionado no se puede construir", "FormInforme.cs", "Construir()", ex); } }