<%Response.Write(sectionHeading);%>
<% SqlCommand queryAuthorExists = new SqlCommand("select AUTHOR1ID FROM CSA_AUTHORS WHERE SHOWID='" + showID + "'", readOnly); readOnly.Open(); SqlDataReader getAuthorExists = queryAuthorExists.ExecuteReader(); bool noAuthorID = true; while (getAuthorExists.Read()) { noAuthorID = getAuthorExists.IsDBNull(0); } readOnly.Close(); int t=0; string authorText = ""; readOnly.Open(); SqlCommand queryTestLength = new SqlCommand("select AUTHOR1ID, AUTHOR1CREDIT, AUTHOR2ID, AUTHOR2CREDIT, AUTHOR3ID, AUTHOR3CREDIT, AUTHOR4ID, AUTHOR4CREDIT, AUTHOR5ID, AUTHOR5CREDIT FROM CSA_AUTHORS WHERE SHOWID='" + showID + "'", readOnly); SqlDataReader getTestLength = queryTestLength.ExecuteReader(); while(getTestLength.Read()) { int r=0; while (r<9) { if (getTestLength.IsDBNull(r)==false) { t++; }; r = r+2; } } readOnly.Close(); if (t>0) { noAuthorInfo = false; } if (thisSection=="authorinfo") { string[,] creditsArray = new string[t,2]; readOnly.Open(); SqlDataReader getAuthIDs = queryTestLength.ExecuteReader(); int g=0; while (getAuthIDs.Read()) { int e=0; int f=1; while (e<9 && f<10) { if (getAuthIDs.IsDBNull(e)==false) { creditsArray[g,0] = getAuthIDs.GetString(e); if (getAuthIDs.IsDBNull(f)==false) { creditsArray[g,1] = getAuthIDs.GetString(f); } g++; } e = e+2; f = f+2; } } readOnly.Close(); for (i = 0; i < t; i++) { readOnly.Open(); SqlCommand queryAuthorBios= new SqlCommand("select AUTHORINFO, AUTHORFULLNAME from CSA_AUTHORINFO WHERE AUTHORID='" + creditsArray[i,0] + "'", readOnly); SqlDataReader getAuthorBios = queryAuthorBios.ExecuteReader(); while (getAuthorBios.Read()) { authorText += "
";
authorText += "" + getAuthorBios.GetString(1).ToUpper() + "";
authorText += " (";
authorText += creditsArray[i,1];
authorText += ") ";
authorText += getAuthorBios.GetString(0);
authorText += "
";
}
readOnly.Close();
}
}
string thistext="";
if (thisSection == "authorinfo") {
thistext = authorText;
}
else {
string colName = thisSection.ToUpper();
SqlCommand querytext = new SqlCommand("select " + colName + " from CSA_SHOWINFO WHERE SHOWID='" + showID + "'", readOnly);
readOnly.Open();
SqlDataReader readtext = querytext.ExecuteReader();
while (readtext.Read()) {
if ((thisSection=="synopsis") && (noSynopsis==true)) {
thistext = "";
}
else {
thistext = readtext.GetString(0);
}
}
readOnly.Close();
}
thistext = thistext.Replace("%R%%R%","
");
thistext = thistext.Replace("%B%","");
thistext = thistext.Replace("%/B%","");
thistext = thistext.Replace("%SP%"," ");
Response.Write(thistext.Replace("%R%","
"));
%>