private void MyCmdProcess_Click() { try { MiCursor = Cursors.Wait; CanCmdSalir = false; CanCmdProcess = false; CanView = false; _RunProcess = true; CanCmdRefresh = false; MySendTab(); using (SqlExcuteCommand exe = new SqlExcuteCommand() { DBCnnStr = DBEndososCnnStr, DBCeeMasterCnnStr = DBCeeMasterCnnStr, DBImagenesCnnStr = DBImagenesCnnStr, DBRadicacionesCEECnnStr = DBRadicacionesCEECnnStr }) { exe.DoEvents(); exe.MyProcessLot(cbLots_Item, SysUser, CollCriterios, lblNReasons, ProgressBar_Value, ProgressBar_Maximum, Resultados, WhatIsModo); } if (int.Parse(Resultados[4]) > 0) //lblRechazadas 4) { CanView = true; } else { CanView = false; } cbLots.Remove(cbLots_Item); } catch (Exception ex) { MethodBase site = ex.TargetSite; MessageBox.Show(ex.ToString(), site.Name, MessageBoxButton.OK, MessageBoxImage.Error); } finally { MiCursor = Cursors.Arrow; cbLots_Item_Id = -1; CanCmdSalir = true; _RunProcess = false; CanCmdRefresh = true; } }