got it to fill all fields

This commit is contained in:
EggMan20339 2024-03-21 19:26:58 -04:00
parent 995a4b9de5
commit adecd7bda0
3 changed files with 58 additions and 7 deletions

View File

@ -155,7 +155,7 @@
<virtualDirectoryDefaults allowSubDirConfig="true" /> <virtualDirectoryDefaults allowSubDirConfig="true" />
<site name="CNSA-216-Personal-v2" id="1"> <site name="CNSA-216-Personal-v2" id="1">
<application path="/" applicationPool="Clr4IntegratedAppPool"> <application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\caschick221\RiderProjects\CNSA-216-Personal-v2\CNSA-216-Personal-v2" /> <virtualDirectory path="/" physicalPath="C:\Users\eggman\Nextcloud\TSCT\2nd Year\SEM 4\RiderProjects\CNSA-216-Personal-v2\CNSA-216-Personal-v2" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:5000:localhost" /> <binding protocol="http" bindingInformation="*:5000:localhost" />
@ -163,7 +163,7 @@
</site> </site>
<site name="CH2" id="2"> <site name="CH2" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool"> <application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\caschick221\RiderProjects\CNSA-216-Personal-v2\CH2" /> <virtualDirectory path="/" physicalPath="C:\Users\eggman\Nextcloud\TSCT\2nd Year\SEM 4\RiderProjects\CNSA-216-Personal-v2\CH2" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:5000:localhost" /> <binding protocol="http" bindingInformation="*:5000:localhost" />
@ -171,7 +171,7 @@
</site> </site>
<site name="Scripting" id="3"> <site name="Scripting" id="3">
<application path="/" applicationPool="Clr4IntegratedAppPool"> <application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\caschick221\RiderProjects\CNSA-216-Personal-v2\Scripting" /> <virtualDirectory path="/" physicalPath="C:\Users\eggman\Nextcloud\TSCT\2nd Year\SEM 4\RiderProjects\CNSA-216-Personal-v2\Scripting" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:5000:localhost" /> <binding protocol="http" bindingInformation="*:5000:localhost" />
@ -179,7 +179,7 @@
</site> </site>
<site name="CH456" id="4"> <site name="CH456" id="4">
<application path="/" applicationPool="Clr4IntegratedAppPool"> <application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\caschick221\RiderProjects\CNSA-216-Personal-v2\CH456" /> <virtualDirectory path="/" physicalPath="C:\Users\eggman\Nextcloud\TSCT\2nd Year\SEM 4\RiderProjects\CNSA-216-Personal-v2\CH456" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:5000:localhost" /> <binding protocol="http" bindingInformation="*:5000:localhost" />
@ -187,7 +187,7 @@
</site> </site>
<site name="masterpage" id="5"> <site name="masterpage" id="5">
<application path="/" applicationPool="Clr4IntegratedAppPool"> <application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\caschick221\RiderProjects\CNSA-216-Personal-v2\masterpage" /> <virtualDirectory path="/" physicalPath="C:\Users\eggman\Nextcloud\TSCT\2nd Year\SEM 4\RiderProjects\CNSA-216-Personal-v2\masterpage" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:5000:localhost" /> <binding protocol="http" bindingInformation="*:5000:localhost" />
@ -195,7 +195,7 @@
</site> </site>
<site name="CH46" id="6"> <site name="CH46" id="6">
<application path="/" applicationPool="Clr4IntegratedAppPool"> <application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\caschick221\RiderProjects\CNSA-216-Personal-v2\CH46" /> <virtualDirectory path="/" physicalPath="C:\Users\eggman\Nextcloud\TSCT\2nd Year\SEM 4\RiderProjects\CNSA-216-Personal-v2\CH46" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:5000:localhost" /> <binding protocol="http" bindingInformation="*:5000:localhost" />
@ -203,7 +203,7 @@
</site> </site>
<site name="CH78" id="7"> <site name="CH78" id="7">
<application path="/" applicationPool="Clr4IntegratedAppPool"> <application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\caschick221\RiderProjects\CNSA-216-Personal-v2\CH78" /> <virtualDirectory path="/" physicalPath="C:\Users\eggman\Nextcloud\TSCT\2nd Year\SEM 4\RiderProjects\CNSA-216-Personal-v2\CH78" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:5000:localhost" /> <binding protocol="http" bindingInformation="*:5000:localhost" />

View File

@ -55,6 +55,15 @@ namespace CH78
txtStuID.Text = ds.Tables[0].Rows[0]["student_id"].ToString(); txtStuID.Text = ds.Tables[0].Rows[0]["student_id"].ToString();
txtFNAME.Text = ds.Tables[0].Rows[0]["fname"].ToString(); txtFNAME.Text = ds.Tables[0].Rows[0]["fname"].ToString();
txtLNAME.Text = ds.Tables[0].Rows[0]["lname"].ToString(); txtLNAME.Text = ds.Tables[0].Rows[0]["lname"].ToString();
txtMidInit.Text = ds.Tables[0].Rows[0]["midinit"].ToString();
txtDOB.Text = ds.Tables[0].Rows[0]["DOB"].ToString();
txtActBal.Text = ds.Tables[0].Rows[0]["ACCT_BAL"].ToString();
txtMajor.Text = ds.Tables[0].Rows[0]["MAJOR"].ToString();
txtCellPhone.Text = ds.Tables[0].Rows[0]["CELL_PHONE"].ToString();
txtAdr1.Text = ds.Tables[0].Rows[0]["ADDRESS_ONE"].ToString();
txtCity.Text = ds.Tables[0].Rows[0]["CITY"].ToString();
txtZip.Text = ds.Tables[0].Rows[0]["ZIP"].ToString();
txtCreds.Text = ds.Tables[0].Rows[0]["TOTALCREDITS"].ToString();
// TODO complete other fields // TODO complete other fields
gender = ds.Tables[0].Rows[0]["GENDER"].ToString().Trim(); gender = ds.Tables[0].Rows[0]["GENDER"].ToString().Trim();
@ -78,6 +87,12 @@ namespace CH78
txtState.SelectedValue = "1"; txtState.SelectedValue = "1";
txtState.DataBind(); txtState.DataBind();
txtGender.DataSource = StudentDataTier.GetGenders();
txtGender.DataTextField = "CommonName";
txtGender.DataValueField = "Gender_ID";
txtGender.SelectedValue = "0";
txtGender.DataBind();
// txtState.SelectedValue = ds.Tables[0].Rows[0]["state"].ToString(); // txtState.SelectedValue = ds.Tables[0].Rows[0]["state"].ToString();
if (type.ToUpper() == "VIEW") if (type.ToUpper() == "VIEW")
{ {

View File

@ -103,6 +103,42 @@ namespace CH78
myConn.Close(); myConn.Close();
} }
} }
public static DataSet GetGenders()
{
try
{
// open connection
myConn.Open();
//clear any parameters
cmdString.Parameters.Clear();
// command
cmdString.Connection = myConn;
cmdString.CommandType = CommandType.StoredProcedure;
cmdString.CommandTimeout = 1500;
cmdString.CommandText = "GetAllGenders";
// adapter and dataset
SqlDataAdapter aAdapter = new SqlDataAdapter();
aAdapter.SelectCommand = cmdString;
DataSet aDataSet = new DataSet();
// fill adapter
aAdapter.Fill(aDataSet);
// return dataSet
return aDataSet;
}
catch (Exception ex)
{
throw new ArgumentException(ex.Message);
}
finally
{
myConn.Close();
}
}
public static DataSet SearchStudents(string fname, string lname, string stuID) public static DataSet SearchStudents(string fname, string lname, string stuID)
{ {