protected void Page_Load(object sender, EventArgs e)
    {
        string[] tmpArray = new string[10];
        string   strTmp;

        List <BIRegistration> BIR = BIRegistration.GetAll();

        VisitorsPlaceholder.Text += "<table border=1>";
        VisitorsPlaceholder.Text += "<tr>";
        VisitorsPlaceholder.Text += "<td> <strong>First name</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Last name</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Job title</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Company</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Visitor's address</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>City</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>State/Province</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Country</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Postal code</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Email</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Web site</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Phone</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Fax</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Product Interest</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Visitor Status</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Purpose of Visit</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td> <strong>Crop Interest</strong>";
        VisitorsPlaceholder.Text += "</td>";

        VisitorsPlaceholder.Text += "</tr>";


        foreach (BIRegistration B in BIR)
        {
            if (Request.QueryString["translator"] == "0")
            {
                VisitorsPlaceholder.Text += "<tr>";
                VisitorsPlaceholder.Text += "<td>" + B.FirstName + "</a> ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td>" + B.LastName + "</a> ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td> " + B.JobTitle + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td> " + B.Company + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td>" + B.UserAddress + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td>" + B.City + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td>" + B.StateProvince + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td>" + B.Country + " ";
                VisitorsPlaceholder.Text += "</td>";
            }
            else if (Request.QueryString["translator"] == "1")
            {
                VisitorsPlaceholder.Text += "<tr>";
                VisitorsPlaceholder.Text += "<td>" + Translator.DirectTranslation(B.FirstName) + "</a> ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td>" + Translator.DirectTranslation(B.LastName) + "</a> ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td> " + Translator.DictionaryTranslation(B.JobTitle) + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td> " + Translator.DictionaryTranslation(B.Company) + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td>" + Translator.DictionaryTranslation(B.UserAddress) + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td>" + Translator.DictionaryTranslation(B.City) + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td>" + Translator.DictionaryTranslation(B.StateProvince) + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td>" + Translator.DictionaryTranslation(B.Country) + " ";
                VisitorsPlaceholder.Text += "</td>";
            }


            VisitorsPlaceholder.Text += "<td>" + B.PostalCode + " ";
            VisitorsPlaceholder.Text += "</td>";
            VisitorsPlaceholder.Text += "<td>" + B.Email + " ";
            VisitorsPlaceholder.Text += "</td>";
            VisitorsPlaceholder.Text += "<td>" + B.Website + " ";
            VisitorsPlaceholder.Text += "</td>";
            VisitorsPlaceholder.Text += "<td>" + B.Phone + " ";
            VisitorsPlaceholder.Text += "</td>";
            VisitorsPlaceholder.Text += "<td>" + B.Fax + " ";
            VisitorsPlaceholder.Text += "</td>";

            //Display product interest
            VisitorsPlaceholder.Text += "<td> ";
            strTmp   = B.ProductInterest;
            tmpArray = strTmp.Split(';');
            getProductInterest(tmpArray);
            if (B.OtherProductInterest != "")
            {
                VisitorsPlaceholder.Text += B.OtherProductInterest;
            }
            VisitorsPlaceholder.Text += "</td>";

            //Display visitor's status
            VisitorsPlaceholder.Text += "<td> ";
            strTmp   = B.VisitorStatus;
            tmpArray = strTmp.Split(';');
            getVisitorStatus(tmpArray);
            if (B.OtherVisitorStatus != "")
            {
                VisitorsPlaceholder.Text += B.OtherVisitorStatus;
            }
            VisitorsPlaceholder.Text += "</td>";

            //Display purpose of visit
            VisitorsPlaceholder.Text += "<td> ";
            strTmp   = B.PurposeVisit;
            tmpArray = strTmp.Split(';');
            getPurposeOfVisit(tmpArray);
            if (B.OtherPurposeVisit != "")
            {
                VisitorsPlaceholder.Text += B.OtherPurposeVisit;
            }
            VisitorsPlaceholder.Text += "</td>";

            //Display crop interest
            VisitorsPlaceholder.Text += "<td> ";
            strTmp   = B.CropInterest;
            tmpArray = strTmp.Split(';');
            getCropInterest(tmpArray);
            if (B.OtherCropInterest != "")
            {
                VisitorsPlaceholder.Text += B.OtherCropInterest;
            }
            VisitorsPlaceholder.Text += "</td>";

            VisitorsPlaceholder.Text += "</tr>";
        }

        VisitorsPlaceholder.Text += "</table>";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["expid"] != "0")
        {
            List <CompanyProducts> CP  = CompanyProducts.GetProductsByCompanyID(Convert.ToInt32(Request.QueryString["expid"]));
            List <BIRegistration>  BIU = BIRegistration.GetAll();

            string[] arrProdInterest = new string[10];
            string   strTemp = "";
            int      i, j, k, l;
            int      counter        = 0;
            bool     check          = false;
            bool     newLine        = false;
            string[] arrPhraseWords = new string[2];


            if (CP.Count > 0)
            {
                VisitorsPlaceHolder.Text += "<center><b style='font-size: 16pt'><u>" + CP[0].CompanyName + "</u></b></center><br />";
                VisitorsPlaceHolder.Text += "<br />";

                for (i = 0; i < BIU.Count; i++)
                {
                    strTemp         = BIU[i].ProductInterest;
                    arrProdInterest = strTemp.Split(';');
                    for (l = 0; l < arrProdInterest.Length; l++)
                    {
                        if (arrProdInterest[l] != null)
                        {
                            counter++;
                        }
                    }

                    for (j = 0; j < counter; j++)
                    {
                        for (k = 0; k < CP.Count; k++)
                        {
                            if (arrProdInterest[j] == Convert.ToString(CP[k].ParentID))
                            {
                                if (check == false)
                                {
                                    VisitorsPlaceHolder.Text += "<strong><u>" + Translator.DirectTranslation(BIU[i].FirstName) + " " + Translator.DirectTranslation(BIU[i].LastName) + "</u></strong><br />";
                                    VisitorsPlaceHolder.Text += "Job Title " + Translator.DictionaryTranslation(BIU[i].JobTitle) + " Company " + Translator.DictionaryTranslation(BIU[i].Company) + "<br />";
                                    VisitorsPlaceHolder.Text += "Country " + Translator.DictionaryTranslation(BIU[i].Country) + " City " + Translator.DictionaryTranslation(BIU[i].City) + "<br />";
                                    VisitorsPlaceHolder.Text += "Email " + BIU[i].Email + " Web Site " + BIU[i].Website + "<br />";
                                    VisitorsPlaceHolder.Text += "Phone: " + BIU[i].Phone + " Fax: " + BIU[i].Fax + "<br /><br />";
                                    VisitorsPlaceHolder.Text += "<strong>Interested Products:</strong><br/>";
                                    check   = true;
                                    newLine = true;
                                }

                                strTemp                   = CP[k].ProductName;
                                arrPhraseWords            = strTemp.Split('(');
                                VisitorsPlaceHolder.Text += " * " + arrPhraseWords[0] + "<br />";
                            }
                        }
                    }
                    check   = false;
                    counter = 0;
                    if (newLine == true)
                    {
                        VisitorsPlaceHolder.Text += "<br />";
                        newLine = false;
                    }
                }
            }
            else
            {
                VisitorsPlaceHolder.Text += "<b>Equipment was not chosen for the company</b>";
            }
        }
        else
        {
            VisitorsPlaceHolder.Text += "<b>The company was not chosen</b>";
        }
    }
    private void PopulateVisitors()
    {
        if ((Request.QueryString["id"] != null) && (Request.QueryString["status"] == "1"))
        {
            BIRegistration.Delete(Convert.ToInt32(Request.QueryString["id"]));
            Response.Redirect("~/adminbiregistration.aspx");
        }


        List <BIRegistration> BIR = BIRegistration.GetAll();

        VisitorsPlaceholder.Text += "<table border=1 width=95%>";
        VisitorsPlaceholder.Text += "<tr>";
        VisitorsPlaceholder.Text += "<td>Num</td>";
        VisitorsPlaceholder.Text += "<td width=22%> <strong>Visitor's name</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td width=22%> <strong>Job position</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td width=22%> <strong>Company</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td width=12%> <strong>Remove visitor</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "<td width=12%> <strong>Report</strong>";
        VisitorsPlaceholder.Text += "</td>";
        VisitorsPlaceholder.Text += "</tr>";
        int num = 1;

        if (Convert.ToInt32(Request.Form["ctl00$ContentPlaceHolder1$rblLanguage"]) == 0)
        {
            linkPlaceHolder.Text = "<a href=exportbiusers.aspx?translator=0 target='_blank'>Generate report to export Big Iron visitors from the database into another appliaction</a>";
            foreach (BIRegistration B in BIR)
            {
                VisitorsPlaceholder.Text += "<tr>";
                VisitorsPlaceholder.Text += "<td>" + num + "</td>";
                VisitorsPlaceholder.Text += "<td width=22%><a href=\"englprintform.aspx?id=" + B.ID + "\" \" target=\"_blank\">" + B.FirstName + " " + B.LastName + "</a> ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td width=22%> " + B.JobTitle + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td width=22%> " + B.Company + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td><input id=\"btnDelete\" type=\"button\" value=\"Delete\" onClick='if(confirm(\"Remove visitor?\")) window.location=\"adminbiregistration.aspx?id=" + B.ID + "&status=1\"; else alert(\"The visitor was not removed!\")' />";
                VisitorsPlaceholder.Text += "</td>";
                if (Convert.ToInt32(Request.Form["ctl00$ContentPlaceHolder1$rblReportView"]) == 0)
                {
                    VisitorsPlaceholder.Text += "<td><a href=\"visitorsreport.aspx?id=" + B.ID + "&view=0&translator=0 \" \" target=\"_blank\">Company=>Products</a>";
                    VisitorsPlaceholder.Text += "</td>";
                }
                else
                {
                    VisitorsPlaceholder.Text += "<td><a href=\"visitorsreport.aspx?id=" + B.ID + "&view=1&translator=0 \" \" target=\"_blank\">Product=>Companies</a>";
                    VisitorsPlaceholder.Text += "</td>";
                }
                VisitorsPlaceholder.Text += "</tr>";
                num = num + 1;
            }

            VisitorsPlaceholder.Text += "</table>";
        }
        else if (Convert.ToInt32(Request.Form["ctl00$ContentPlaceHolder1$rblLanguage"]) == 1)
        {
            linkPlaceHolder.Text = "<a href=exportbiusers.aspx?translator=1 target='_blank'>Generate report to export Big Iron visitors from the database into another appliaction</a>";
            foreach (BIRegistration B in BIR)
            {
                VisitorsPlaceholder.Text += "<tr>";
                VisitorsPlaceholder.Text += "<td>" + num + "</td>";
                VisitorsPlaceholder.Text += "<td width=22%><a href=\"englprintform.aspx?id=" + B.ID + "&translator=1 \" \" target=\"_blank\">" + Translator.DirectTranslation(B.FirstName) + " " + Translator.DirectTranslation(B.LastName) + "</a> ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td width=22%> " + Translator.DictionaryTranslation(B.JobTitle) + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td width=22%> " + Translator.DictionaryTranslation(B.Company) + " ";
                VisitorsPlaceholder.Text += "</td>";
                VisitorsPlaceholder.Text += "<td><input id=\"btnDelete\" type=\"button\" value=\"Delete\" onClick='if(confirm(\"Remove visitor?\")) window.location=\"adminbiregistration.aspx?id=" + B.ID + "&status=1\"; else alert(\"The visitor was not removed!\")' />";
                VisitorsPlaceholder.Text += "</td>";
                if (Convert.ToInt32(Request.Form["ctl00$ContentPlaceHolder1$rblReportView"]) == 0)
                {
                    VisitorsPlaceholder.Text += "<td><a href=\"visitorsreport.aspx?id=" + B.ID + "&view=0&translator=1 \" \" target=\"_blank\">Company=>Products</a>";
                    VisitorsPlaceholder.Text += "</td>";
                }
                else
                {
                    VisitorsPlaceholder.Text += "<td><a href=\"visitorsreport.aspx?id=" + B.ID + "&view=1&translator=1 \" \" target=\"_blank\">Product=>Companies</a>";
                    VisitorsPlaceholder.Text += "</td>";
                }
                VisitorsPlaceholder.Text += "</tr>";
                num = num + 1;
            }
            VisitorsPlaceholder.Text += "</table>";
        }
    }