protected void Dvw_ParentGuardianDetails_ItemUpdating(object sender, DetailsViewUpdateEventArgs e) { try { if (Dvw_ParentGuardianDetails.CurrentMode == DetailsViewMode.Edit) { Label lbl_findStudentid = (Label)Dvw_ParentGuardianDetails.Rows[0].FindControl("Lbl_EditParentStudentId"); TextBox Txt_findFathername = (TextBox)Dvw_ParentGuardianDetails.Rows[1].FindControl("Txt_EditFatherName"); TextBox Txt_findFatherContact = (TextBox)Dvw_ParentGuardianDetails.Rows[2].FindControl("Txt_EditFatherContact"); TextBox Txt_findFatherEmail = (TextBox)Dvw_ParentGuardianDetails.Rows[3].FindControl("Txt_EditFatherEmail"); TextBox Txt_findMothername = (TextBox)Dvw_ParentGuardianDetails.Rows[4].FindControl("Txt_EditMotherName"); TextBox Txt_findMotherContact = (TextBox)Dvw_ParentGuardianDetails.Rows[5].FindControl("Txt_EditMotherContact"); TextBox Txt_findMotherEmail = (TextBox)Dvw_ParentGuardianDetails.Rows[6].FindControl("Txt_EditMotherEmail"); TextBox Txt_findGuardianname = (TextBox)Dvw_ParentGuardianDetails.Rows[7].FindControl("TxtEditGuardianName"); TextBox Txt_findGuardianContact = (TextBox)Dvw_ParentGuardianDetails.Rows[8].FindControl("Txt_EditGuardianContact"); TextBox Txt_findGuardianEmail = (TextBox)Dvw_ParentGuardianDetails.Rows[9].FindControl("Txt_EditGuardianEmail"); Student_BLogic obj_studblogic = new Student_BLogic(); Student obj_student = new Student(); obj_student.studentid = int.Parse(lbl_findStudentid.Text); obj_student.FatherName = Txt_findFathername.Text; obj_student.FatherContact = Txt_findFatherContact.Text; obj_student.FatherEmail = Txt_findFatherEmail.Text; obj_student.MotherName = Txt_findMothername.Text; obj_student.MotherContact = Txt_findMotherContact.Text; obj_student.MotherEmail = Txt_findMotherEmail.Text; obj_student.GuardianName = Txt_findGuardianname.Text; obj_student.GuardianContact = Txt_findGuardianContact.Text; obj_student.GuardianEmail = Txt_findGuardianEmail.Text; obj_studblogic.UpdateStudentProfile(obj_student, "parent"); Dvw_ParentGuardianDetails.ChangeMode(DetailsViewMode.ReadOnly); Student Student = new Student(); Student_BLogic BAL_Student = new Student_BLogic(); Student.studentid = AppSessions.StudentID; DataSet dsSelect = new DataSet(); dsSelect = BAL_Student.BAL_Student_Select(Student, "SelectByID"); Dvw_ParentGuardianDetails.DataSource = dsSelect; Dvw_ParentGuardianDetails.DataBind(); TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), StringEnum.stringValueOf(EnumFile.AccessedPages.AccessMyAccount), "Save Button", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.MyAccountProfileSectionUpdated), "Updated Parent Details.", 0); } } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Student Student = new Student(); Student_BLogic BAL_Student = new Student_BLogic(); Student.studentid = AppSessions.StudentID; DataSet dsSelect = new DataSet(); dsSelect = BAL_Student.BAL_Student_Select(Student, "SelectByID"); Dvw_PersonalDetails.DataSource = dsSelect; Dvw_PersonalDetails.DataBind(); Dvw_ParentGuardianDetails.DataSource = dsSelect; Dvw_ParentGuardianDetails.DataBind(); Dvw_EducationalDetails.DataSource = dsSelect; Dvw_EducationalDetails.DataBind(); } }
protected void Dvw_ParentGuardianDetails_ModeChanging(object sender, DetailsViewModeEventArgs e) { try { if (Dvw_ParentGuardianDetails.CurrentMode == DetailsViewMode.Edit) { Dvw_ParentGuardianDetails.ChangeMode(DetailsViewMode.ReadOnly); } else { Dvw_ParentGuardianDetails.ChangeMode(DetailsViewMode.Edit); } Student Student = new Student(); Student_BLogic BAL_Student = new Student_BLogic(); Student.studentid = AppSessions.StudentID; DataSet dsSelect = new DataSet(); dsSelect = BAL_Student.BAL_Student_Select(Student, "SelectByID"); Dvw_ParentGuardianDetails.DataSource = dsSelect; Dvw_ParentGuardianDetails.DataBind(); } catch (Exception ex) { } }