protected void BtnUpdate(object sender, EventArgs e) { if (string.IsNullOrEmpty(TbNewPassword.Text) || string.IsNullOrEmpty(TbNewPassword.Text)) { LblResult.Text = "Pls fill in all the blank"; } else { LblAdminNo.Text = Session["AdminNo"].ToString(); Student selTD = new Student(); StudentProfileDAO updTD = new StudentProfileDAO(); if (TbNewPassword.Text == TbCfmNewPassword.Text) { int updCnt; updCnt = updTD.ChangePw(LblAdminNo.Text, TbNewPassword.Text); if (updCnt == 1) { LblResult.Text = "Password has been changed!"; LblResult.ForeColor = System.Drawing.Color.Black; Response.Redirect("GeneralSetting.aspx"); } } else { LblResult.Text = "Password Different. Please double check"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["AdminNo"] != null) { LblAdminNo.Text = Session["AdminNo"].ToString(); StudentProfile selTD = new StudentProfile(); StudentProfileDAO updTD = new StudentProfileDAO(); selTD = updTD.getStudentById(LblAdminNo.Text); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["AdminNo"] != null) { LblAdminNo.Text = Session["AdminNo"].ToString(); LblStudentName.Text = Session["SSStudentName"].ToString(); StudentProfile selTD = new StudentProfile(); StudentProfileDAO updTD = new StudentProfileDAO(); selTD = updTD.getStudentById(LblAdminNo.Text); LblMedicalCondition.Text = selTD.MedicalCondition.ToString(); LblMedicalHistory.Text = selTD.MedicalHistory.ToString(); LblSummary.Text = selTD.Summary.ToString(); LblHpNumber.Text = selTD.HpNumber.ToString(); LblEmail.Text = selTD.Email.ToString(); StudentCurrentPicture.ImageUrl = selTD.ProfilePicture; } } }
protected void BtnUpdate(object sender, EventArgs e) { //if(String.IsNullOrEmpty(LblMedicalCondition.Text) || String.IsNullOrEmpty(LblMedicalHistory.Text) || String.IsNullOrEmpty(LblSummary.Text) || String.IsNullOrEmpty(LblEmail.Text)){ //} //else //{ // LblAdminNo.Text = Session["SSAdminNo"].ToString(); // Student selTD = new Student(); // StudentDAO updTD = new StudentDAO(); // int updCnt; // updCnt = updTD.updateTD(LblAdminNo.Text, LblStudentName.Text, LblMedicalCondition.Text, LblMedicalHistory.Text, LblSummary.Text, LblEmail.Text); // if (updCnt == 1) // { // LblResult.Text = "Profile has been changed!"; // LblResult.ForeColor = System.Drawing.Color.Black; // } //} if (String.IsNullOrEmpty(LblMedicalCondition.Text) || String.IsNullOrEmpty(LblMedicalHistory.Text) || String.IsNullOrEmpty(LblSummary.Text) || String.IsNullOrEmpty(LblHpNumber.Text) || String.IsNullOrEmpty(LblEmail.Text)) { LblResult.Text = "Pls Fill in All the Blank !"; } else { LblAdminNo.Text = Session["AdminNo"].ToString(); StudentProfile selTD = new StudentProfile(); StudentProfileDAO updTD = new StudentProfileDAO(); int updCnt; int hpnumber = Convert.ToInt32(LblHpNumber.Text.ToString()); string imgName = SaveFile(StudentPicture.PostedFile); updCnt = updTD.updateTD(LblAdminNo.Text, LblStudentName.Text, LblMedicalCondition.Text, LblMedicalHistory.Text, LblSummary.Text, hpnumber, LblEmail.Text, imgName); if (updCnt == 1) { LblResult.Text = "Profile has been changed!"; LblResult.ForeColor = System.Drawing.Color.Red; Response.Redirect("ProfilePage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { StudentProfile StudentObj = new StudentProfile(); StudentProfileDAO StudentDao = new StudentProfileDAO(); String adminNo = Session["AdminNo"].ToString(); StudentObj = StudentDao.getStudentById(adminNo); if (StudentObj != null) { //PanelErrorResult.Visible = false; //Panelstudent.Visible = true; Lbl_studentname.Text = StudentObj.StudentName; Lbl_Gender.Text = StudentObj.Gender; Lbl_Diploma.Text = StudentObj.Diploma; Lbl_MedicalCondition.Text = StudentObj.MedicalCondition; Lbl_MedicalHistory.Text = StudentObj.MedicalHistory; Lbl_Summary.Text = StudentObj.Summary; Lbl_HpNumber.Text = StudentObj.HpNumber.ToString(); Lbl_Email.Text = StudentObj.Email; Image1.ImageUrl = StudentObj.ProfilePicture; //Lbl_err.Text = String.Empty; } }