public void getprofilepic() { Connection_StringCLS connstr = new Connection_StringCLS(Campus); string studentid = Session["CurrentStudent"].ToString(); var services = new DAL.DAL(); DataTable dtStudentProfile = services.GetStudentDetailsForProfile(studentid, connstr.Conn_string); if (dtStudentProfile.Rows.Count > 0) { Session["ProfilePIc"] = dtStudentProfile.Rows[0]["strStudentPic"].ToString(); Session["sEmail"] = dtStudentProfile.Rows[0]["sECTemail"].ToString(); } }
//protected void btnReset_Click(object sender, EventArgs e) //{ //} public void loadstudentprofile() { Connection_StringCLS connstr = new Connection_StringCLS(Campus); string studentid = Session["CurrentStudent"].ToString(); var services = new DAL.DAL(); DataTable dtStudentProfile = services.GetStudentDetailsForProfile(studentid, connstr.Conn_string); string sCampus = Session["CurrentCampus"].ToString(); if (dtStudentProfile.Rows.Count > 0) { int sem = 0; int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem); int iYear = Year; int iSem = sem; string sSemester = LibraryMOD.GetSemesterString(iSem); txt_AcademicYear.Text = iYear.ToString(); txt_CurrentSemester.Text = sSemester.ToString(); txtFisrtName.Text = dtStudentProfile.Rows[0]["strLastDescEn"].ToString(); txtDateofBirth.Text = Convert.ToDateTime(dtStudentProfile.Rows[0]["dateBirth"]).ToString("dd/MM/yyyy"); txtEmail.Text = dtStudentProfile.Rows[0]["sECTemail"].ToString(); txtPhoneNumber.Text = dtStudentProfile.Rows[0]["Phone"].ToString(); txt_StudentID.Text = dtStudentProfile.Rows[0]["lngStudentNumber"].ToString(); txt_Major.Text = dtStudentProfile.Rows[0]["strCaption"].ToString(); txt_Nationality.Text = dtStudentProfile.Rows[0]["strNationalityDescEn"].ToString(); string sPic = dtStudentProfile.Rows[0]["strStudentPic"].ToString(); hdfiUnifiedID.Value = dtStudentProfile.Rows[0]["iUnifiedID"].ToString(); string sDir = "Students"; if (sCampus == "Males") { txt_Gender.Text = "Male"; } else { txt_Gender.Text = "Female"; } } }
public void loadstudentprofile() { Connection_StringCLS connstr = new Connection_StringCLS(Campus); string studentid = Session["CurrentStudent"].ToString(); var services = new DAL.DAL(); DataTable dtStudentProfile = services.GetStudentDetailsForProfile(studentid, connstr.Conn_string); string sCampus = Session["CurrentCampus"].ToString(); if (dtStudentProfile.Rows.Count > 0) { int sem = 0; int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem); int iYear = Year; int iSem = sem; string sSemester = LibraryMOD.GetSemesterString(iSem); //txt_AcademicYear.Text = iYear.ToString(); //txt_CurrentSemester.Text = sSemester.ToString(); //txtFisrtName.Text = dtStudentProfile.Rows[0]["strLastDescEn"].ToString(); //txtDateofBirth.Text = Convert.ToDateTime(dtStudentProfile.Rows[0]["dateBirth"]).ToString("dd/MM/yyyy"); lbl_Email_ID.Text = dtStudentProfile.Rows[0]["sECTemail"].ToString(); //txtPhoneNumber.Text = dtStudentProfile.Rows[0]["Phone"].ToString(); lbl_Student_ID.Text = dtStudentProfile.Rows[0]["lngStudentNumber"].ToString(); lbl_Current_Major.Text = dtStudentProfile.Rows[0]["strCaption"].ToString(); string acceptance_type = ""; string acceptance_condition = ""; if (dtStudentProfile.Rows[0]["iAcceptanceType"].ToString() == "1") { acceptance_type = "Permanently Accepted"; } else if (dtStudentProfile.Rows[0]["iAcceptanceType"].ToString() == "2") { acceptance_type = "One Academic Semester(Conditional)"; } else if (dtStudentProfile.Rows[0]["iAcceptanceType"].ToString() == "3") { acceptance_type = "Two Academic Semesters(Conditional)"; } else if (dtStudentProfile.Rows[0]["iAcceptanceType"].ToString() == "4") { acceptance_type = "One Academic Year(Conditional)"; } if (dtStudentProfile.Rows[0]["iAcceptanceCondition"].ToString() == "1") { acceptance_condition = "All conditions have been met"; } else if (dtStudentProfile.Rows[0]["iAcceptanceCondition"].ToString() == "2") { acceptance_condition = "High school equivalency needed"; } else if (dtStudentProfile.Rows[0]["iAcceptanceCondition"].ToString() == "3") { acceptance_condition = "EmSAT needed"; } else if (dtStudentProfile.Rows[0]["iAcceptanceCondition"].ToString() == "4") { acceptance_condition = "Major requirements are not met"; } lbl_Acceptance_Type.Text = acceptance_type; lbl_Acceptance_Condition.Text = acceptance_condition; Session["Student_AT"] = acceptance_type; Session["Student_AC"] = acceptance_condition; if (dtStudentProfile.Rows[0]["byteCancelReason"].ToString() == "") { lbl_Status.Text = "Active"; } else { SqlConnection sc = new SqlConnection(connstr.Conn_string); SqlCommand cmd = new SqlCommand("select strReasonDesc from Lkp_Reasons where byteReason=@byteReason", sc); cmd.Parameters.AddWithValue("@byteReason", dtStudentProfile.Rows[0]["byteCancelReason"].ToString()); DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); try { sc.Open(); da.Fill(dt); sc.Close(); if (dt.Rows.Count > 0) { lbl_Status.Text = dt.Rows[0]["strReasonDesc"].ToString();; } else { lbl_Status.Text = "Active"; } } catch (Exception ex) { sc.Close(); Console.WriteLine(ex.Message); } finally { sc.Close(); } } //txt_Nationality.Text = dtStudentProfile.Rows[0]["strNationalityDescEn"].ToString(); //string sPic = dtStudentProfile.Rows[0]["strStudentPic"].ToString(); //hdfiUnifiedID.Value = dtStudentProfile.Rows[0]["iUnifiedID"].ToString(); //string sDir = "Students"; //if (sCampus == "Males") //{ // txt_Gender.Text = "Male"; //} //else //{ // txt_Gender.Text = "Female"; //} } }