private void MycmdExecute_Click()
        {
            try
            {
                ItemsSource.Clear();

                if (string.IsNullOrEmpty(TxtElecNum))
                {
                    return;
                }



                using (SqlExcuteCommand get = new SqlExcuteCommand
                {
                    DBCeeMasterCnnStr = DBMasterCeeCnnStr,
                    DBCnnStr = DBEndososCnnStr
                })
                {
                    txtTotal = "0";
                    DataTable T = new DataTable();
                    T        = get.MyGetDuplicadoPorNumeroElectoral(TxtElecNum, WhatIsModo);
                    txtTotal = string.Format("{0:N0}", T.Rows.Count);

                    if (T.Rows.Count <= 0)
                    {
                        MessageBox.Show("No Hay Datos", TxtElecNum, MessageBoxButton.OK, MessageBoxImage.Exclamation);
                        return;
                    }

                    foreach (DataRow row in T.Rows)
                    {
                        LotsEndo datos = new LotsEndo();

                        //datos.GoodNumElec       = row["GoodNumElec"].ToString();
                        //datos.BadNumElec        = row["BadNumElec"].ToString();
                        //datos.GoodPartido       = row["GoodPartido"].ToString();
                        //datos.BadPartido        = row["BadPartido"].ToString();
                        //datos.GoodLot           = row["GoodLot"].ToString();
                        //datos.BadLot            = row["BadLot"].ToString();
                        //datos.GoodBatch         = row["GoodBatch"].ToString();
                        //datos.BadBatch          = row["BadBatch"].ToString();
                        //datos.GoodFormulario    = row["GoodFormulario"].ToString();
                        //datos.BadFormulario     = row["BadFormulario"].ToString();
                        //datos.GoodEndosoImage   = (byte[])row["GoodEndosoImage"];
                        //datos.BadEndosoImage    = (byte[])row["BadEndosoImage"];
                        //datos.GoodPathImage     = row["GoodPathImage"].ToString();
                        //datos.BadPathImage      = row["BadPathImage"].ToString();
                        //datos.GoodErrores       = row["GoodErrores"].ToString();
                        //datos.BadErrores        = row["BadErrores"].ToString();

                        datos.NumElec     = row["NumElec"].ToString();
                        datos.Partido     = row["Partido"].ToString();
                        datos.Lot         = row["Lot"].ToString();
                        datos.Batch       = row["Batch"].ToString();
                        datos.Formulario  = row["Formulario"].ToString();
                        datos.Image       = row["Image"].ToString();
                        datos.Errores     = row["Errores"].ToString();
                        datos.Status      = row["Status"].ToString();
                        datos.EndosoImage = get.MyGetImgInByte(datos.NumElec, datos.Partido, datos.Lot, datos.Batch, datos.Formulario, datos.Image, datos.Errores, datos.Status);
                        datos.Modo        = int.Parse(row["Modo"].ToString());

                        if (WhatIsModo == 1)
                        {
                            if (datos.Modo == 1)
                            {
                                ItemsSource.Add(datos);
                            }
                        }
                        else
                        {
                            if (datos.Modo == 2)
                            {
                                ItemsSource.Add(datos);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MethodBase site = ex.TargetSite;
                MessageBox.Show(ex.ToString(), site.Name, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }