public void populateLists()
{
int count = 0;
//get cinderella ids of Paired
//use class SQL_Queries and getCinderellaStatus method
DataSet cdsPaired = sqlQuery.getCinderellaStatus("Paired", "transID");
int c = 0;
foreach (DataRow dr in cdsPaired.Tables[0].Rows)
{
//variables for name
string fname = "";
string lname = "";
//name retreived from db
string a = dr["Name"].ToString();
//Breaks fname and lname up and swaps spots
lname = a.Remove(a.IndexOf(","));
fname = a.Remove(0, lname.Length + 2);
cNamePaired.Add(fname + " " + lname);
//tracks all cinderellas so display will not exceed 35
c++;
if (c >= 35)
{
break;
}
}
//get god mother ids Paired
//use class SQL_Queries and getGodmotherStatus method
DataSet gmdsPaired = sqlQuery.getGodmotherStatus("Paired", "transID", false);
int f = 0;
foreach (DataRow dr in gmdsPaired.Tables[0].Rows)
{
count++;
//variables for name
string fname = "";
string lname = "";
//name retreived from db
string a = dr["Name"].ToString();
//Breaks fname and lname up and swaps spots
lname = a.Remove(a.IndexOf(","));
fname = a.Remove(0, lname.Length + 2);
gMNamePaired.Add(count.ToString() + "---" + fname + " " + lname);
//tracks all godmothers so display will not exceed 35
f++;
if (f >= 35)
{
break;
}
}
//get cinderella ids waiting
//use class SQL_Queries and getCinderellaStatus method
DataSet cds = sqlQuery.getCinderellaStatus("Waiting", "transID");
foreach (DataRow dr in cds.Tables[0].Rows)
{
//variables for name
string fname = "";
string lname = "";
//name retreived from db
string a = dr["Name"].ToString();
//Breaks fname and lname up and swaps spots
lname = a.Remove(a.IndexOf(","));
fname = a.Remove(0, lname.Length + 2);
cName.Add(fname + " " + lname);
//tracks all cinderellas so display will not exceed 35
c++;
if (c >= 35)
{
break;
}
}
//get god mother ids available
//use class SQL_Queries and getGodmotherStatus method
DataSet gmds = sqlQuery.getGodmotherStatus("Available", "transID", false);
foreach (DataRow dr in gmds.Tables[0].Rows)
{
//variables for name
count++;
string fname = "";
string lname = "";
//name retreived from db
string a = dr["Name"].ToString();
//Breaks fname and lname up and swaps spots
lname = a.Remove(a.IndexOf(","));
fname = a.Remove(0, lname.Length + 2);
gMName.Add(count.ToString()+ "---" +fname + " " + lname);
//tracks all godmothers so display will not exceed 35
f++;
if (f >= 35)
{
break;
}
}
}