protected void btnSave_Click(object sender, EventArgs e) { foreach (DataGridItem itm in dgEducation.Items) { HiddenField phdnEducCode = (HiddenField)itm.FindControl("hdnEducCode"); DropDownList pddlLevel = (DropDownList)itm.FindControl("ddlLevel"); TextBox ptxtEducCourse = (TextBox)itm.FindControl("txtEducCourse"); TextBox ptxtEducDates = (TextBox)itm.FindControl("txtEducDates"); TextBox ptxtEducRecognition = (TextBox)itm.FindControl("txtEducRecognition"); TextBox ptxtSchool = (TextBox)itm.FindControl("txtSchool"); TextBox ptxtSchoolAddress = (TextBox)itm.FindControl("txtSchoolAddress"); CheckBox pchkEducComplete = (CheckBox)itm.FindControl("chkEducComplete"); clsEmployeeEducation ed = new clsEmployeeEducation(); ed.EducationCode = phdnEducCode.Value; ed.EducationLevelCode = pddlLevel.SelectedValue; ed.Course = ptxtEducCourse.Text; ed.InclusiveDates = ptxtEducDates.Text; ed.SchoolName = ptxtSchool.Text; ed.SchoolAddress = ptxtSchoolAddress.Text; ed.Recognition = ptxtEducRecognition.Text; ed.Complete = (pchkEducComplete.Checked ? "1" : "0"); ed.Edit(); } BindEducationList(); }
private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectEntries()) { int intResults = 0; clsEmployeeEducation ed = new clsEmployeeEducation(); ed.EducationCode = _strEducationCode; ed.EducationLevelCode = cmbLevel.SelectedValue.ToString(); ed.Course = txtCourse.Text; ed.InclusiveDates = txtInclusiveDates.Text; ed.Recognition = txtRecognition.Text; ed.SchoolName = txtSchoolName.Text; ed.SchoolAddress = txtSchoolAddress.Text; ed.Complete = (chkComplete.Checked ? "1" : "0"); intResults = ed.Edit(); if (intResults > 0) { _frmEmployeeDetails.LoadEducationList(); Close(); } } }