made pop up work

This commit is contained in:
caschick221 2024-03-21 14:09:34 -04:00
parent fb27c94b95
commit 995a4b9de5
2 changed files with 16 additions and 16 deletions

View File

@ -46,7 +46,7 @@ namespace CH78
public void GetStudent(string studentid, string type) public void GetStudent(string studentid, string type)
{ {
// the right record // the right record
StudentDataTier stuDT = new StudentDataTier();
DataSet ds = new DataSet(); DataSet ds = new DataSet();
string gender; string gender;
ds = StudentDataTier.SearchStudents("","",studentid); ds = StudentDataTier.SearchStudents("","",studentid);
@ -57,15 +57,15 @@ namespace CH78
txtLNAME.Text = ds.Tables[0].Rows[0]["lname"].ToString(); txtLNAME.Text = ds.Tables[0].Rows[0]["lname"].ToString();
// TODO complete other fields // TODO complete other fields
gender = ds.Tables[0].Rows[0]["gender_desc"].ToString().Trim(); gender = ds.Tables[0].Rows[0]["GENDER"].ToString().Trim();
if (gender.ToUpper() == "F") // if (gender.ToUpper() == "F")
{ // {
txtGender.SelectedItem.Text = "FEMALE"; // txtGender.SelectedItem.Text = "FEMALE";
} // }
else // else
{ // {
txtGender.SelectedItem.Text = "MALE"; // txtGender.SelectedItem.Text = "MALE";
} // }
txtGender.Enabled = false; txtGender.Enabled = false;
//mysalary = Decimal.Parse(ds.Tables[0].Rows[0]["salary"]) //mysalary = Decimal.Parse(ds.Tables[0].Rows[0]["salary"])
@ -73,12 +73,12 @@ namespace CH78
//txtSalary.Enabled = False //txtSalary.Enabled = False
txtState.DataSource = StudentDataTier.GetStates(); txtState.DataSource = StudentDataTier.GetStates();
txtState.DataTextField = "FullAndAbbrev"; txtState.DataTextField = "Name";
txtState.DataValueField = "abbreviation"; txtState.DataValueField = "StateID";
txtState.SelectedValue = "PA"; txtState.SelectedValue = "1";
txtState.DataBind(); txtState.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")
{ {
txtStuID.Enabled = false; txtStuID.Enabled = false;

View File

@ -210,8 +210,8 @@ namespace CH78
// this script will open a popup // this script will open a popup
sb.Append("<script language='javascript'>"); sb.Append("<script language='javascript'>");
sb.Append("window.open('Display.aspx?ID=" + recordToBeEdited.ToString() + "&typeEdit=" + "'DisplayEdit';"); sb.Append("window.open('Display.aspx?ID=" + recordToBeEdited.ToString() + "&type=Edit" +"' , 'DisplayEdit',");
sb.Append(", 'width=525, height=525, menubar=no, resizable=yes, left=50, top=50, scrollbars=yes');"); sb.Append("'width=525, height=525, menubar=no, resizable=yes, left=50, top=50, scrollbars=yes');");
sb.Append("</script>"); sb.Append("</script>");
// register with ClientScript // register with ClientScript