private void DoSearchAllIndividualsinSEC()
        {
            var dal  = new IndividualManager();
            var dalL = new LinkManager();
            var dalI = new InvestigationManager();
            var aux  = new Batch2WebAux(Response, BatchManager.BatchNamesEnum.SECLookupIndividuals);

            aux.AddHead();
            var table           = dalI.GetInvestigatedIndividuals();
            var c               = 0D;
            var alreadySearched = new List <string>();

            foreach (var ii in table)
            {
                if (alreadySearched.Contains(ii.individual_name.ToLower()))
                {
                    c++;
                    continue;
                }
                var names = new List <string> {
                    ii.individual_name
                };
                var aliases = dalL.GetIILByName(ii.individual_name);
                foreach (var alias in aliases)
                {
                    if (alias.link_type == "alias" & !names.Contains(alias.individual_alias))
                    {
                        names.Add(alias.individual_alias);
                    }
                }
                NameAnalyzer.AutoAliases(ii.individual_name, names);
                foreach (var name in names)
                {
                    if (alreadySearched.Contains(name.ToLower()))
                    {
                        continue;
                    }
                    try
                    {
                        if (ii.individual_name != name)
                        {
                            aux.WriteLine("Searcing ALL SEC filings for: " + ii.individual_name + " under alias: " + name);
                        }
                        else
                        {
                            aux.WriteLine("Searcing ALL SEC filings for: " + ii.individual_name);
                        }
                        dal.ImportIndividualFromSrc10(ii.individual_name, name);
                    }catch (Exception ex2)
                    { aux.WriteLine(string.Format("<hr /><b>Exception:<br />\r\n</b>{0}<hr/>", ex2)); }
                    alreadySearched.Add(name.ToLower());
                }
                c++;
                aux.SetProgress(c / table.Rows.Count);
            }
            aux.AddFoot();
            aux.Save();
        }
        protected void ButtonSerachMentions_Click(object sender, EventArgs e)
        {
            if (TextBoxPrimaryName.Text.Trim() == string.Empty)
            {
                LabelAlarm.Text = "Please specify at least the primary name";
                return;
            }
            TextBoxPrimaryName.Text = NameAnalyzer.NameCapitalizer(TextBoxPrimaryName.Text);
            if (TextBoxAliases.Text.Trim() == string.Empty)
            {
                TextBoxAliases.Text = TextBoxPrimaryName.Text;
            }
            var aliases     = TextBoxAliases.Text.Replace("\r\n", "\n").Split('\n');
            var aliasesList = new List <string> ();

            foreach (var s in aliases)
            {
                if (!aliasesList.Contains(s))
                {
                    aliasesList.Add(s);
                }
            }
            foreach (var s in aliasesList)
            {
                try
                {
                    var dal = new IndividualManager();
                    dal.ImportIndividualFromSrc10(TextBoxPrimaryName.Text, s);
                }
                catch (Exception ex)
                {
                    LabelAlarm.Text += ex.Message + "<br />";
                    return;
                }
            }
            if (CheckUseInvestigation.Checked)
            {
                var dali  = new InvestigationManager();
                var invID = int.Parse(DropInvestigations.SelectedValue);
                var table = dali.GetInvestigatedIndividuals(invID);
                var row   = table.FindByindividual_nameinvestigation_id(TextBoxPrimaryName.Text, invID);
                if (row == null)
                {
                    table.Addinvestigated_individualRow(TextBoxPrimaryName.Text, invID);
                }
                dali.Save(table);
            }
            LabelAlarm.Text = "processed with no errors";
        }