diff --git a/.idea/config/applicationhost.config b/.idea/config/applicationhost.config index 654d94b..4030689 100644 --- a/.idea/config/applicationhost.config +++ b/.idea/config/applicationhost.config @@ -155,7 +155,7 @@ - + @@ -163,7 +163,7 @@ - + @@ -171,7 +171,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -187,7 +187,7 @@ - + @@ -195,7 +195,7 @@ - + @@ -203,7 +203,7 @@ - + diff --git a/CH78/Display.aspx.cs b/CH78/Display.aspx.cs index 9a3e9fb..85d69f4 100644 --- a/CH78/Display.aspx.cs +++ b/CH78/Display.aspx.cs @@ -55,6 +55,15 @@ namespace CH78 txtStuID.Text = ds.Tables[0].Rows[0]["student_id"].ToString(); txtFNAME.Text = ds.Tables[0].Rows[0]["fname"].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 gender = ds.Tables[0].Rows[0]["GENDER"].ToString().Trim(); @@ -78,6 +87,12 @@ namespace CH78 txtState.SelectedValue = "1"; 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(); if (type.ToUpper() == "VIEW") { diff --git a/CH78/StudentDataTier.cs b/CH78/StudentDataTier.cs index 58ebba7..5728581 100644 --- a/CH78/StudentDataTier.cs +++ b/CH78/StudentDataTier.cs @@ -103,6 +103,42 @@ namespace CH78 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) {