public string generateResultsString(Interview interview)
        {
            string results = "";
            //Check for NR results
            if (interview.NR == true)
                results = results + "NR - YES";
            else if (interview.NR == false)
                results = results + "NR - NO";
            //Check for INST results
            if (interview.INST == true)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "INST - YES";
            }
            else if (interview.INST == false)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "INST - NO";
            }
            //Check for NPS results
            if (interview.NPS == true)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "NPS - YES";
            }
            else if (interview.NPS == false)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "NPS - NO";
            }
            //Check for PXO results
            if (interview.PXO == true)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "PXO - YES";
            }
            else if (interview.PXO == false)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "PXO - NO";
            }
            //Check for EDO results
            if (interview.EDO == true)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "EDO - YES";
            }
            else if (interview.EDO == false)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "EDO - NO";
            }
            //Check for ENLTECH results
            if (interview.ENLTECH == true)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "ENLTECH - YES";
            }
            else if (interview.ENLTECH == false)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "ENLTECH - NO";
            }
            //Check for NR1 results
            if (interview.NR1 == true)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "NR1 - YES";
            }
            else if (interview.NR1 == false)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "NR1 - NO";
            }
            //Check for SUPPLY results
            if (interview.SUPPLY == true)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "SUPPLY - YES";
            }
            else if (interview.SUPPLY == false)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "SUPPLY - NO";
            }
            //Check for EOOW results
            if (interview.EOOW == true)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "EOOW - YES";
            }
            else if (interview.EOOW == false)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "EOOW - NO";
            }
            //Check for DOE results
            if (interview.DOE == true)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "DOE - YES";
            }
            else if (interview.DOE == false)
            {
                if (!results.Equals("")) results = results + ", ";
                results = results + "DOE - NO";
            }

            return results;
        }
        public void generateBioIDCards(int[] ids, string fileName)
        {
            string header = System.IO.File.ReadAllText(Server.MapPath("~/Templates/header.html"));
            string footer = System.IO.File.ReadAllText(Server.MapPath("~/Templates/footer.html"));
            string reportBody = "";

            string newTable, interviewRow;
            for (int i = 0; i < ids.Length; ++i)
            {
                int id = ids[i];
                BioData bioData = db.BioData.Find(id);
                var interviews = db.Interview.Where(x => x.BioDataID == id);

                newTable = System.IO.File.ReadAllText(Server.MapPath("~/Templates/BioCard.html"));
                newTable = newTable.Replace("lastName", bioData.LName);
                newTable = newTable.Replace("firstName", bioData.FName);
                if (bioData.MName != "" && bioData.MName != null)
                    newTable = newTable.Replace("middleName", bioData.MName);
                else
                    newTable = newTable.Replace(", middleName", "");
                newTable = newTable.Replace("ssn", bioData.SSN);
                newTable = newTable.Replace("fyg", bioData.FYG.Value.ToString());
                newTable = newTable.Replace("source", bioData.Sources.SourcesValue);
                newTable = newTable.Replace("dateOfBirth", bioData.DOB.Value.ToShortDateString());

                string schoolInfo = "", majorInfo = "", majors = "";
                foreach (SchoolsAttended school in bioData.SchoolsAttended.ToList())
                {
                    if (schoolInfo != "")
                        schoolInfo = schoolInfo + "<br>";
                    if (majorInfo != "")
                        majorInfo = majorInfo + "<br>";

                    majors = "";
                    foreach(Degree d in school.Degrees.ToList())
                    {
                        if(majors != "")
                        {
                            majors = majors + "; ";
                        }
                        majors = majors + d.Major.MajorValue + " (" + d.DegreeType.DegreeTypeValue + ")";
                    }
                    majorInfo = majorInfo + majors;

                    int numYears;
                    if (school.YearStart != null && school.YearEnd != null)
                    {
                        numYears = school.YearEnd.Value - school.YearStart.Value;
                    }
                    else
                    {
                        numYears = 0;
                    }

                    if(numYears == 0)
                        schoolInfo = school.School.SchoolValue + " (" + "< 1" + " year" + ")";
                    else
                        schoolInfo = school.School.SchoolValue + " (" + numYears.ToString() + " year" + ")";

                    if (numYears > 1) schoolInfo = schoolInfo.Replace("year", "years");
                }
                newTable = newTable.Replace("school", schoolInfo);
                newTable = newTable.Replace("major", majorInfo);

                DutyHistory mostRecentDH = null;
                DateTime mostRecentDate = new DateTime(1, 1, 1);
                foreach(DutyHistory dh in bioData.DutyHistories.ToList())
                {
                    foreach(DutyStation ds in dh.DutyStations.ToList())
                    {
                        if(mostRecentDH == null)
                        {
                            mostRecentDH = dh;
                            mostRecentDate = ds.ReportDate;
                        }
                        else if(ds.ReportDate.CompareTo(mostRecentDate) > 0)
                        {
                            mostRecentDH = dh;
                            mostRecentDate = ds.ReportDate;
                        }

                    }
                }
                if(mostRecentDH != null)
                newTable = newTable.Replace("rank", mostRecentDH.Rank);

                string program = "";
                foreach(Program prog in bioData.Programs.ToList())
                {
                    if(program != "")
                    {
                        program = program + ", ";
                    }
                    program = program + prog.ProgramValue;
                }
                newTable = newTable.Replace("program", program);

                newTable = newTable + System.IO.File.ReadAllText(Server.MapPath("~/Templates/tableStart.html"));
                int interviewIndex = 1, seenIndex = 0;
                Interview[] seenInterviews;
                if (bioData.Interviews.Count() > 0)
                    seenInterviews = new Interview[bioData.Interviews.Count()];
                else
                    seenInterviews = new Interview[10]; //10 is arbitrary... there shouldn't be any

                DateTime currentDate;
                string results;
                foreach(Interview interview in bioData.Interviews)
                {
                    if(!seenInterviews.Contains(interview))
                    {
                        currentDate = interview.Date.Value;
                        interviewRow = System.IO.File.ReadAllText(Server.MapPath("~/Templates/BioCardInterviewRow.html"));
                        interviewRow = interviewRow.Replace("index", interviewIndex.ToString());
                        interviewRow = interviewRow.Replace("date", currentDate.ToShortDateString());
                        results = "";
                        foreach (Interview inter in bioData.Interviews.Where(z => z.Date.Value == currentDate).OrderBy(a => a.EndTime).ToList())
                        {
                            if (results != "")
                            {
                                results = results + "<br>";
                            }
                            results = results + inter.InterviewerUser.LoginID + ": ";
                            results = results + generateResultsString(inter);
                            seenInterviews[seenIndex] = inter;
                            seenIndex++;
                        }
                        interviewRow = interviewRow.Replace("decisions", results);
                        interviewIndex++;
                        newTable = newTable + interviewRow;
                    }
                }

                newTable = newTable + System.IO.File.ReadAllText(Server.MapPath("~/Templates/tableEnd.html"));
                reportBody = reportBody + newTable;
                reportBody = reportBody + pageBreakParagraph;
            }

            string reportHtml = header + reportBody + footer;
            generateReport(fileName, reportHtml, true, true);
        }