protected void BindAccountManagerDetails() { try { Int64 UserId = Convert.ToInt64(Session["UserId"]); DataTable dtFaculty = TMSFacultyDetails.GetStaffFacultyDetails(null, 7, UserId).Tables[0]; if (dtFaculty.Rows.Count > 0) { Int64 FacultyId = Convert.ToInt64(dtFaculty.Rows[0]["FD_FacultyDetailsId"]); DataTable dtAccount = TMSFacultyDetails.GetStaffFacultyDetails(FacultyId, 7, UserId).Tables[0]; if (dtAccount.Rows.Count > 0) { lblFullName.Text = dtAccount.Rows[0]["FD_FirstName"].ToString() + " " + dtAccount.Rows[0]["FD_MiddleName"].ToString() + " " + dtAccount.Rows[0]["FD_LastName"].ToString(); Image1.ImageUrl = dtAccount.Rows[0]["FD_Image"].ToString(); lblDOB.Text = String.Format("{0:dd MMM yyyy}", dtAccount.Rows[0]["FD_BirthDate"]);// (Convert.ToString(objstudappl.StdaDob))("MM/dd/yyyy"); lblNationality.Text = dtAccount.Rows[0]["FD_Nationality"].ToString(); lblGender.Text = dtAccount.Rows[0]["FD_Gender"].ToString(); lblMotherTongue.Text = dtAccount.Rows[0]["FD_MotherTounge"].ToString(); lblMedicalproblems.Text = dtAccount.Rows[0]["FD_MedicalProblem"].ToString(); lblBithPlace.Text = dtAccount.Rows[0]["FD_BirthPlace"].ToString(); lblBloodGroup.Text = dtAccount.Rows[0]["FD_BloodGroup"].ToString(); lblCaste.Text = dtAccount.Rows[0]["FD_Caste"].ToString(); lblSubcaste.Text = dtAccount.Rows[0]["FD_SubCaste"].ToString(); lblDOJ.Text = String.Format("{0:dd MMM yyyy}", dtAccount.Rows[0]["FD_JoiningDate"]); lblHihestDegree.Text = dtAccount.Rows[0]["FD_HighestDegreeCompletd"].ToString(); lblCopleteYear.Text = dtAccount.Rows[0]["FD_CompletionDate"].ToString(); lblUniversity.Text = dtAccount.Rows[0]["FD_University"].ToString(); lblLastSchoolWas.Text = dtAccount.Rows[0]["FD_LastSchoolwas"].ToString(); lblLastSchoolFrom.Text = dtAccount.Rows[0]["FD_LastSchoolFromDate"].ToString(); if (lblLastSchoolFrom.Text != "") { string[] s = lblLastSchoolFrom.Text.Split(' '); lblLastSchoolFrom.Text = String.Format("{0:dd MMM yyyy}", Convert.ToDateTime(s[0])); } lblLastSchoolTo.Text = dtAccount.Rows[0]["FD_LastSchoolToDate"].ToString(); if (lblLastSchoolTo.Text != "") { string[] s = lblLastSchoolTo.Text.Split(' '); lblLastSchoolTo.Text = String.Format("{0:dd MMM yyyy}", Convert.ToDateTime(s[0])); } lblTotalExpInMonth.Text = dtAccount.Rows[0]["FD_ExperienceFrom"].ToString(); lblTotalExpInYear.Text = dtAccount.Rows[0]["FD_ExperienceTo"].ToString(); lblSpecialization.Text = dtAccount.Rows[0]["FD_SpecificExpertise"].ToString(); //***Mother Details //***Residance Details lblAddress.Text = dtAccount.Rows[0]["FacultyPerAdd"].ToString(); lblmobileNo.Text = dtAccount.Rows[0]["FacultyMobNo"].ToString(); lblResidencePhone.Text = dtAccount.Rows[0]["FacultyResNo"].ToString(); lblEmailID.Text = dtAccount.Rows[0]["FacultyEmailId"].ToString(); lblCountry.Text = dtAccount.Rows[0]["FacultyCountry"].ToString(); lblState.Text = dtAccount.Rows[0]["FacultyState"].ToString(); lblCity.Text = dtAccount.Rows[0]["FacultyCity"].ToString(); lblPin.Text = dtAccount.Rows[0]["FacultyPinCode"].ToString(); //***Residance Details } } } catch (Exception ex) { } }
protected void BindStaffDetails() { DataTable dtstaffDetails = TMSFacultyDetails.GetSearchStaffFacultyDetails(null, null, "Staff", Convert.ToInt64(HiddenID.Value)).Tables[0]; ListStaff.DataSource = dtstaffDetails; ListStaff.DataBind(); }
protected void BtnSave_Click(object sender, EventArgs e) { try { int status = TMSFacultyDetails.DeleteAccount(Convert.ToInt64(Session["UserId"])); if (status.ToString() == "-1") { Response.Redirect("../Default.aspx?var=Logout"); } } catch (Exception ex) { } }
protected void BindAcountManagerPhoto() { try { Int64 UserId = Convert.ToInt64(Session["UserId"]); DataTable dtFaculty = TMSFacultyDetails.GetStaffFacultyDetails(null, 7, UserId).Tables[0]; if (dtFaculty.Rows.Count > 0) { image1.ImageUrl = dtFaculty.Rows[0]["FD_Image"].ToString(); } } catch (Exception ex) { } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { Int64 UserId = Convert.ToInt64(Session["UserId"]); //DataTable dtFaculty = TMSFacultyDetails.GetSearch(null, UserId, 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1).Tables[0]; DataTable dtFaculty = TMSFacultyDetails.GetStaffFacultyDetails(null, 7, UserId).Tables[0]; if (dtFaculty.Rows.Count > 0) { Int64 FacultyId = Convert.ToInt64(dtFaculty.Rows[0]["FD_FacultyDetailsId"]); TMSFacultyDetails objFaculty = TMSFacultyDetails.Get(FacultyId); if (objFaculty != null) { //objFaculty.FDImage = ImageE; if (FileUpload1.PostedFile.FileName != "") { bool isExist = false; string strFatherFileNameWithPath = FileUpload1.PostedFile.FileName; string strFatherExtensionName = System.IO.Path.GetExtension(strFatherFileNameWithPath); string strFatherFileName = System.IO.Path.GetFileName(strFatherFileNameWithPath).Replace(" ", "_"); if (strFatherExtensionName.Equals(".jpg") || strFatherExtensionName.Equals(".gif") || strFatherExtensionName.Equals(".png") || strFatherExtensionName.Equals(".jpeg") || strFatherExtensionName.Equals(".bmp")) { isExist = File.Exists(Server.MapPath(@"~\\UploadImages\\FacultyPhoto\\" + strFatherFileName)); string[] Name = strFatherFileName.Split('.'); string Fname = Name[0]; string ReplacFileName = Fname + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + strFatherExtensionName; FileUpload1.PostedFile.SaveAs(Server.MapPath(@"..\\UploadImages\\FacultyPhoto\\" + ReplacFileName)); objFaculty.FDImage = "../UploadImages/FacultyPhoto/" + ReplacFileName; } else { dvMsg.Visible = true; lblMessage.Text = "Please Upload .jpg,.gif,.jpeg,.bmp File Only !"; dvMsg.Attributes.Add("class", "error_msg"); return; } } objFaculty.Update(); Response.Redirect("ChangePhoto.aspx?msg=Photo is updated Successfully"); } } } catch (Exception ex) { } }
protected void BindTeacherDetails() { try { if ((Session["AccountID"] != null) && (Session["FacultyType"] != null)) { Int64 UserId = Convert.ToInt64(Session["AccountID"]); DataTable dtFaculty = TMSFacultyDetails.GetStaffFacultyDetails(null, Convert.ToInt64(Session["FacultyType"]), UserId).Tables[0]; if (dtFaculty.Rows.Count > 0) { if (dtFaculty.Rows[0]["FD_AgeProof"].ToString() != "AGEPROOF") { string[] dd = dtFaculty.Rows[0]["FD_AgeProof"].ToString().Split('/'); hyperAge.Text = dd[2].ToString(); hyperAge.NavigateUrl = dtFaculty.Rows[0]["FD_AgeProof"].ToString(); } else { hyperAge.Text = dtFaculty.Rows[0]["FD_AgeProof"].ToString(); } if (dtFaculty.Rows[0]["FD_Image"] != null) { string[] dd = dtFaculty.Rows[0]["FD_Image"].ToString().Split('/'); hyperPassphoto.Text = dd[3].ToString(); hyperPassphoto.NavigateUrl = dtFaculty.Rows[0]["FD_Image"].ToString(); } if (dtFaculty.Rows[0]["FD_ReleavingLetter"].ToString() != "ReleavingLetter") { string[] dd = dtFaculty.Rows[0]["FD_ReleavingLetter"].ToString().Split('/'); hyperOleavingSchoolSertificate.Text = dd[2].ToString(); hyperOleavingSchoolSertificate.NavigateUrl = dtFaculty.Rows[0]["FD_ReleavingLetter"].ToString(); } else { hyperOleavingSchoolSertificate.Text = dtFaculty.Rows[0]["FD_ReleavingLetter"].ToString(); } } } } catch (Exception ex) { } }
protected void Getuser() { DataTable dtTeacher = TMSFacultyDetails.GetSearch(null, Convert.ToInt32(Session["UserId"]), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null).Tables[0]; int dtteachercnt = dtTeacher.Rows.Count; if (dtTeacher.Rows.Count > 0) { lblUser.Text = dtTeacher.Rows[0]["FD_FirstName"].ToString() + " " + dtTeacher.Rows[0]["FD_LastName"].ToString(); imageteacher.ImageUrl = dtTeacher.Rows[0]["FD_Image"].ToString(); if (imageteacher.ImageUrl == "") { imageteacher.ImageUrl = "~/UploadImages/TeacherPhoto/UserNoImage.jpg"; Session["Imageurlt"] = imageteacher.ImageUrl; } else { Session["Imageurlt"] = imageteacher.ImageUrl; } } }
protected void BindPrincipalDetails() { try { DataTable dt = null; dt = TMSFacultyDetails.GetStaffFacultyDetails(null, 1, null).Tables[0]; if (dt.Rows.Count > 0) { ListStaff.DataSource = dt; ListStaff.DataBind(); } else { ListStaff.DataSource = null; ListStaff.DataBind(); } } catch { } }
public void getdetails() { if (Session["UserId"] != null) { try { DataSet ds = TMSFacultyDetails.GetAccountManagerDetails(Convert.ToInt32(Session["UserId"].ToString())); if (ds.Tables[0].Rows.Count > 0) { lblschoolname.Text = ds.Tables[0].Rows[0]["FD_LastSchoolwas"].ToString(); lblteachername.Text = ds.Tables[0].Rows[0]["FD_FirstName"].ToString() + " " + ds.Tables[0].Rows[0]["FD_LastName"].ToString(); lblteacherQualification.Text = ds.Tables[0].Rows[0]["FD_HighestDegreeCompletd"].ToString() + " " + ds.Tables[0].Rows[0]["FD_SpecificExpertise"].ToString() + "(" + (Convert.ToInt64(ds.Tables[0].Rows[0]["FD_CompletionDate"].ToString()) - 1) + "-" + ds.Tables[0].Rows[0]["FD_CompletionDate"].ToString() + ")"; if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["FD_ExperienceTo"].ToString())) { //lblexperience.Text = ds.Tables[0].Rows[0]["FD_ExperienceTo"].ToString(); } else { //lblexperience.Text ="0"; } lbladdressNuber.Text = ds.Tables[0].Rows[0]["AD_PermanentAddress"].ToString(); lblcontactNumber.Text = ds.Tables[0].Rows[0]["AD_MobileNo"].ToString(); lblemailID.Text = ds.Tables[0].Rows[0]["AD_EmailId"].ToString(); if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["FD_LastSchoolFromDate"].ToString()) && !string.IsNullOrEmpty(ds.Tables[0].Rows[0]["FD_LastSchoolToDate"].ToString())) { DateTime dtf = Convert.ToDateTime(ds.Tables[0].Rows[0]["FD_LastSchoolFromDate"].ToString()); DateTime dtto = Convert.ToDateTime(ds.Tables[0].Rows[0]["FD_LastSchoolToDate"].ToString()); string monthfrom = dtf.ToString("MMM"); string monthto = dtto.ToString("MMM"); string FromDate = dtf.Year.ToString(); string Todate = dtto.Year.ToString(); int totalpastyear = (Convert.ToInt32(Todate)) - (Convert.ToInt32(FromDate)); lblpasttime.Text = monthfrom + " " + FromDate + "_" + monthto + " " + Todate; lblpastexpyear.Text = "(" + totalpastyear.ToString() + "years)"; } } } catch (Exception) {} } }
protected void BindTeacterDetails() { try { string SchoolType = null; string Name = null; SchoolType = "Pre-Primary"; if (txtName.Text != "") { Name = txtName.Text; } else { Name = null; } DataTable dt = null; if (ViewState["Sort"] != null) { dt = TMSFacultyDetails.GetSearchStaffFacultyDetails(Name, SchoolType, "Teacher", null).Tables[0]; } else { dt = TMSFacultyDetails.GetSearchStaffFacultyDetails(null, SchoolType, "Teacher", null).Tables[0]; } if (dt.Rows.Count > 0) { ListTeacher.DataSource = dt; ListTeacher.DataBind(); } else { ListTeacher.DataSource = null; ListTeacher.DataBind(); } } catch { } }
public static void Update(TMSFacultyDetails tMSFacultyDetails, DbTransaction transaction) { tMSFacultyDetails.Update(transaction); }
public static void Update(TMSFacultyDetails tMSFacultyDetails) { tMSFacultyDetails.Update(); }
public static TMSFacultyDetails[] Search(TMSFacultyDetails searchObject) { return Search ( searchObject.FDFacultyDetailsId, searchObject.FDLoginId, searchObject.FDFacultyId, searchObject.FDSchoolCatgoryId, searchObject.FDTitle, searchObject.FDFirstName, searchObject.FDMiddleName, searchObject.FDLastName, searchObject.FDDate, searchObject.FDCaste, searchObject.FDSubCaste, searchObject.FDBirthPlace, searchObject.FDBloodGroup, searchObject.FDMotherTongue, searchObject.FDNationality, searchObject.FDTransportStatus, searchObject.FDMedicalProblem, searchObject.FDSchoolCategoryId, searchObject.FDSchoolSubCategoryId, searchObject.FDSubjectId, searchObject.FDInterestPosition, searchObject.FDCertifiedSubject, searchObject.FDCertifiedAgeGroup, searchObject.FDFullTimeTeaching, searchObject.FDIndustryExpertise, searchObject.FDSpecificExpertise, searchObject.FDHighestDegreeCompletd, searchObject.FDFieldOfStudy, searchObject.FDUniversity, searchObject.FDCompletionDate, searchObject.FDAddressId, searchObject.FDQualificationDetails, searchObject.FDExperienceFrom, searchObject.FDExperienceTo, searchObject.FDExperienceInYrs, searchObject.FDImage, searchObject.FDJoiningDate, searchObject.FDBirthDate, searchObject.FDGender, searchObject.FDMarrialStatus, searchObject.FDAgeProof, searchObject.FDResume, searchObject.FDReleavingLetter, searchObject.FDRetiredOn, searchObject.FDExtraOne, searchObject.FDCreatedBy, searchObject.FDLastSchoolwas, searchObject.FDLastSchoolFromDate, searchObject.FDLastSchoolToDate, searchObject.FDStatus); }
public static TMSFacultyDetails[] MapFrom(DataSet ds) { List<TMSFacultyDetails> objects; // Initialise Collection. objects = new List<TMSFacultyDetails>(); // Validation. if (ds == null) throw new ApplicationException("Cannot map to dataset null."); else if (ds.Tables[TABLE_NAME].Rows.Count == 0) return objects.ToArray(); if (ds.Tables[TABLE_NAME] == null) throw new ApplicationException("Cannot find table [dbo].[TMS_FacultyDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_FacultyDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSFacultyDetails instance = new TMSFacultyDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
protected void BindTeacherDetails() { try { Int64 UserId = Convert.ToInt64(Session["AccountID"]); DataTable dtFaculty = TMSFacultyDetails.GetStaffFacultyDetails(null, Convert.ToInt64(Session["FacultyType"]), UserId).Tables[0]; if (dtFaculty.Rows.Count > 0) { lblFullName.Text = dtFaculty.Rows[0]["FD_FirstName"].ToString() + " " + dtFaculty.Rows[0]["FD_MiddleName"].ToString() + " " + dtFaculty.Rows[0]["FD_LastName"].ToString(); if (dtFaculty.Rows[0]["FD_Image"] != null) { imasdfdsg.ImageUrl = dtFaculty.Rows[0]["FD_Image"].ToString(); } lblEduDetail.Text = dtFaculty.Rows[0]["FD_HighestDegreeCompletd"].ToString() + "-" + dtFaculty.Rows[0]["FD_SpecificExpertise"].ToString() + " " + dtFaculty.Rows[0]["FD_CompletionDate"].ToString(); lblAddress.Text = dtFaculty.Rows[0]["FacultyPerAdd"].ToString(); lblnationality.Text = dtFaculty.Rows[0]["FD_Nationality"].ToString(); lblgender.Text = dtFaculty.Rows[0]["FD_Gender"].ToString(); lblmotherLong.Text = dtFaculty.Rows[0]["FD_MotherTounge"].ToString(); lblmedicolprm.Text = dtFaculty.Rows[0]["FD_MedicalProblem"].ToString(); lblbirthPlace.Text = dtFaculty.Rows[0]["FD_BirthPlace"].ToString(); lblbloodgroup.Text = dtFaculty.Rows[0]["FD_BloodGroup"].ToString(); lblcast.Text = dtFaculty.Rows[0]["FD_Caste"].ToString(); lblsubcast.Text = dtFaculty.Rows[0]["FD_SubCaste"].ToString(); if (dtFaculty.Rows[0]["FD_HighestDegreeCompletd"].ToString() != "-1") { lblhighestDegree.Text = dtFaculty.Rows[0]["FD_HighestDegreeCompletd"].ToString(); } if (dtFaculty.Rows[0]["FD_CompletionDate"].ToString() != "Select") { lblcomplicationDateofHigherDegree.Text = dtFaculty.Rows[0]["FD_CompletionDate"].ToString(); } lbluniversity.Text = dtFaculty.Rows[0]["FD_University"].ToString(); if ((dtFaculty.Rows[0]["FD_ExperienceFrom"] != null) && (dtFaculty.Rows[0]["FD_ExperienceTo"] != null)) { lblexpyears.Text = dtFaculty.Rows[0]["FD_ExperienceTo"].ToString() + " Year"; lblexperience.Text = dtFaculty.Rows[0]["FD_ExperienceTo"].ToString() + " Year" + " " + dtFaculty.Rows[0]["FD_ExperienceFrom"].ToString() + " Month"; } else if ((dtFaculty.Rows[0]["FD_ExperienceFrom"] != null) && (dtFaculty.Rows[0]["FD_ExperienceTo"] == null)) { lblexperience.Text = dtFaculty.Rows[0]["FD_ExperienceFrom"].ToString() + " Year"; lblexpyears.Text = dtFaculty.Rows[0]["FD_ExperienceFrom"].ToString() + " Year"; } // lblspeciolisation.Text = dtFaculty.Rows[0]["FD_SpecificExpertise"].ToString(); if (dtFaculty.Rows[0]["ClassName"] != null) { string Classname = dtFaculty.Rows[0]["ClassName"].ToString(); if (Classname != "") { lblstandard.Text = Classname.Remove(Classname.Length - 1, 1); } } if (dtFaculty.Rows[0]["SubjectName"] != null) { string SubjectName = dtFaculty.Rows[0]["SubjectName"].ToString(); if (SubjectName != "") { lblsubject.Text = SubjectName.Remove(SubjectName.Length - 1, 1); } } // lblusingtransport.Text = dtFaculty.Rows[0]["FD_TransportStatus"].ToString(); } } catch (Exception ex) { } }
protected void btnLogin_Click(object sender, EventArgs e) { if (ddlLogintype.SelectedIndex != 0) { try { // DataTable dtLogin = TMSUserLogin.CheckLoginDetails(txtUserName.Text.Trim(), "c3VtaXQx", Convert.ToInt32(ddlLogintype.SelectedValue)).Tables[0]; DataTable dtLogin = TMSUserLogin.CheckLoginDetails(txtUserName.Text.Trim(), help.encryptPassword(txtPassword.Text.Trim()), Convert.ToInt32(ddlLogintype.SelectedValue)).Tables[0]; if (dtLogin.Rows.Count > 0) { if (Convert.ToInt32(dtLogin.Rows[0]["UL_Status"]) == 0) { dverror.Style.Add("display", "block"); lblMessage.InnerHtml = "Your Account has been disabled, Please contact Admin !"; txtUserName.Focus(); } else { DataTable dtUserName = null; Session["UserId"] = dtLogin.Rows[0]["UL_LoginId"]; Session["Username"] = txtUserName.Text.Trim(); Session["Password"] = txtPassword.Text.Trim(); Session["UserType"] = dtLogin.Rows[0]["UL_UserType"]; string Uname = txtUserName.Text; string Psw = txtPassword.Text; if (Convert.ToInt32(Session["UserType"]) == 1) { dtUserName = TMSFacultyDetails.GetCurrentStaffFacultyDetails(null, null, Convert.ToInt64(Session["UserId"]), null, null).Tables[0]; if (dtUserName.Rows.Count > 0) { string name = dtUserName.Rows[0]["UserName"].ToString(); Session["LoginName"] = name; ILog logger = log4net.LogManager.GetLogger("" + name + "(Principal)"); logger.Info("Login Time,This is info message"); logger.Debug("Login Time,This is Debug message"); logger.Error("Login Time,This is Error message"); logger.Warn("Login Time,This is Warn message"); logger.Fatal("Login Time,This is Fatal message"); } Response.Redirect("Principal/DashboardPrincipal.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 2) { dtUserName = TMSFacultyDetails.GetCurrentStaffFacultyDetails(null, null, Convert.ToInt64(Session["UserId"]), null, null).Tables[0]; if (dtUserName.Rows.Count > 0) { string name = dtUserName.Rows[0]["UserName"].ToString(); Session["LoginName"] = name; ILog logger = log4net.LogManager.GetLogger("" + name + "(Principal)"); logger.Info("Login Time,This is info message"); logger.Debug("Login Time,This is Debug message"); logger.Error("Login Time,This is Error message"); logger.Warn("Login Time,This is Warn message"); logger.Fatal("Login Time,This is Fatal message"); } Response.Redirect("Teacher/DashboardTeacher.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 3) { Response.Redirect("Parents/ParentDashboard.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 4) { Response.Redirect("Student/Dashboard.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 5) { Response.Redirect("Vendor/VendorDashboard.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 6) { Response.Redirect("Transpotation/transportdashboard.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 7) { Response.Redirect("Librarian/Librariandashboard.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 8) { Response.Redirect("AccountManager/AccountManagerDashboard.aspx", false); } } } else { //If password not found in DB, display mesg to user. dverror.Style.Add("display", "block"); lblMessage.InnerHtml = "Incorrect Username or Password !"; txtUserName.Focus(); } } catch (Exception ex) { //Response.Write(ex); } } else { dverror.Style.Add("display", "block"); lblMessage.InnerHtml = "Please Select Login Type !"; txtUserName.Focus(); } }
private void BindLoginSection() { if (Session["UserId"] != null) { secLogin.Style.Add("display", "none"); secLogout.Style.Add("display", "block"); DataTable dtLoginInfo = null; if (Convert.ToInt32(Session["UserType"]) == 1) { dtLoginInfo = TMSFacultyDetails.GetPricipalDetails(Convert.ToInt32(Session["UserId"])).Tables[0]; if (dtLoginInfo.Rows.Count > 0) { lblUser.Text = dtLoginInfo.Rows[0]["FD_FirstName"].ToString() + " " + dtLoginInfo.Rows[0]["FD_LastName"].ToString(); lblLoginType.Text = "Login as Principal"; hrefDashboard.HRef = "Principal/DashboardPrincipal.aspx"; } // Response.Redirect("Principal/DashboardPrincipal.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 2) { dtLoginInfo = TMSFacultyDetails.GetCurrentStaffFacultyDetails(null, 2, Convert.ToInt32(Session["UserId"]), null, null).Tables[0]; if (dtLoginInfo.Rows.Count > 0) { lblUser.Text = dtLoginInfo.Rows[0]["FD_FirstName"].ToString() + " " + dtLoginInfo.Rows[0]["FD_LastName"].ToString(); lblLoginType.Text = "Login as Teacher"; hrefDashboard.HRef = "Teacher/DashboardTeacher.aspx"; } // Response.Redirect("Teacher/DashboardTeacher.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 3) { dtLoginInfo = TMSStudentDetails.GetParentName(Convert.ToInt32(Session["UserId"])).Tables[0];// TMSFacultyDetails.GetCurrentStaffFacultyDetails(null, 3, Convert.ToInt32(Session["UserId"]), null, null).Tables[0]; if (dtLoginInfo.Rows.Count > 0) { lblUser.Text = dtLoginInfo.Rows[0]["UserName"].ToString();// +" " + dtLoginInfo.Rows[0]["FD_LastName"].ToString(); lblLoginType.Text = "Login as Parent"; hrefDashboard.HRef = "Parents/ParentDashboard.aspx"; } // Response.Redirect("Parents/ParentDashboard.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 4) { dtLoginInfo = TMSStudentDetails.GetStudentName(Convert.ToInt32(Session["UserId"])).Tables[0];// TMSFacultyDetails.GetCurrentStaffFacultyDetails(null, 3, Convert.ToInt32(Session["UserId"]), null, null).Tables[0]; if (dtLoginInfo.Rows.Count > 0) { lblUser.Text = dtLoginInfo.Rows[0]["UserName"].ToString();// +" " + dtLoginInfo.Rows[0]["FD_LastName"].ToString(); lblLoginType.Text = "Login as Student"; hrefDashboard.HRef = "Student/Dashboard.aspx"; } // Response.Redirect("Student/Dashboard.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 5) { dtLoginInfo = TMSFacultyDetails.GetCurrentStaffFacultyDetails(null, 5, Convert.ToInt32(Session["UserId"]), null, null).Tables[0]; if (dtLoginInfo.Rows.Count > 0) { lblUser.Text = dtLoginInfo.Rows[0]["FD_FirstName"].ToString() + " " + dtLoginInfo.Rows[0]["FD_LastName"].ToString(); lblLoginType.Text = "Login as Vendor"; hrefDashboard.HRef = "Vendor/VendorDashboard.aspx"; } // Response.Redirect("Vendor/VendorDashboard.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 6) { dtLoginInfo = TMSFacultyDetails.GetCurrentStaffFacultyDetails(null, 4, Convert.ToInt32(Session["UserId"]), null, null).Tables[0]; if (dtLoginInfo.Rows.Count > 0) { lblUser.Text = dtLoginInfo.Rows[0]["FD_FirstName"].ToString() + " " + dtLoginInfo.Rows[0]["FD_LastName"].ToString(); lblLoginType.Text = "Login as Transpotation"; hrefDashboard.HRef = "Transpotation/transportdashboard.aspx"; } // Response.Redirect("Transpotation/transportdashboard.aspx", false); } else if (Convert.ToInt32(Session["UserType"]) == 7) { dtLoginInfo = TMSFacultyDetails.GetCurrentStaffFacultyDetails(null, 6, Convert.ToInt32(Session["UserId"]), null, null).Tables[0]; if (dtLoginInfo.Rows.Count > 0) { lblUser.Text = dtLoginInfo.Rows[0]["FD_FirstName"].ToString() + " " + dtLoginInfo.Rows[0]["FD_LastName"].ToString(); lblLoginType.Text = "Login as Librarian"; hrefDashboard.HRef = "Librarian/Librariandashboard.aspx"; } // Response.Redirect("Librarian/Librariandashboard.aspx", false); } } }
protected void btnEdit_Click(object sender, EventArgs e) { try { btnSave.Text = "Update"; SectionEditProfile.Visible = true; SectionViewProfile.Visible = false; fillCountry(); BindState(); BindCity(); //fillQualification(); fillCompletedYear(); Int64 UserId = Convert.ToInt64(Session["UserId"]); DataTable dtFaculty = TMSFacultyDetails.GetStaffFacultyDetails(null, 7, UserId).Tables[0]; if (dtFaculty.Rows.Count > 0) { Int64 FacultyId = Convert.ToInt64(dtFaculty.Rows[0]["FD_FacultyDetailsId"]); TMSFacultyDetails objFaculty = TMSFacultyDetails.Get(FacultyId); if (objFaculty != null) { txtFullName.Text = objFaculty.FDFirstName; txtMiddleName.Text = objFaculty.FDMiddleName; txtLatName.Text = objFaculty.FDLastName; txtBithPlace.Text = objFaculty.FDBirthPlace; txtDOB.Text = String.Format("{0:MM/dd/yyyy}", objFaculty.FDBirthDate); ddlBloddGroup.SelectedValue = Convert.ToString(objFaculty.FDBloodGroup); txtNationality.Text = objFaculty.FDNationality; txtCaste.Text = objFaculty.FDCaste; txtSubcaste.Text = objFaculty.FDSubCaste; ddlGender.SelectedValue = objFaculty.FDGender; txtMotherTongue.Text = objFaculty.FDMotherTongue; txtMedicalproblems.Text = objFaculty.FDMedicalProblem; if (objFaculty.FDJoiningDate != null) { txtDOJ.Text = String.Format("{0:MM/dd/yyyy}", objFaculty.FDJoiningDate); } if (objFaculty.FDHighestDegreeCompletd != null) { //ddlHighestDegree.SelectedValue = objFaculty.FDHighestDegreeCompletd; txtHeighestDegree.Text = objFaculty.FDHighestDegreeCompletd.ToString();; } if (objFaculty.FDSpecificExpertise != "") { ddlSpeciallization.SelectedItem.Text = objFaculty.FDSpecificExpertise; } if (objFaculty.FDCompletionDate != "") { ddlCompletedYear.SelectedValue = objFaculty.FDCompletionDate; } txtUniversity.Text = objFaculty.FDUniversity; txtLastSchoolWas.Text = objFaculty.FDLastSchoolwas; if (objFaculty.FDLastSchoolFromDate != null) { txtLastSchoolFrom.Text = String.Format("{0:MM/dd/yyyy}", objFaculty.FDLastSchoolFromDate); } if (objFaculty.FDLastSchoolToDate != null) { txtLastSchoolTo.Text = String.Format("{0:MM/dd/yyyy}", objFaculty.FDLastSchoolToDate); } txtTotalExpInYear.Text = objFaculty.FDExperienceTo; txtTotalExpInMonth.Text = objFaculty.FDExperienceFrom; Int64 AddressId = Convert.ToInt64(objFaculty.FDAddressId); TMSAddressDetails objAddress = TMSAddressDetails.Get(AddressId); if (objAddress != null) { txtAddress.Text = objAddress.ADPermanentAddress; txtmobileNo.Text = objAddress.ADMobileNo; txtResidencePhone.Text = objAddress.ADLandLineNo; txtPin.Text = objAddress.ADPinCode; txtEmailID.Text = objAddress.ADEmailId; ddlCountry.SelectedValue = objAddress.ADCountryId.ToString(); BindState(); ddlState.SelectedValue = objAddress.ADStateId.ToString(); BindCity(); ddlCity.SelectedValue = objAddress.ADCityId.ToString(); } Image2.Visible = true; Image2.ImageUrl = objFaculty.FDImage; Session["Image"] = objFaculty.FDImage; } } } catch (Exception ex) { } }
protected void btnSave_Click(object sender, EventArgs e) { try { string ImageE = EditGetImage(); if (ImageE == "Ext") { dvMsg.Visible = true; lblMessage.Text = "InValid File Format"; dvMsg.Attributes.Add("class", "error_msg"); } else { Int64 UserId = Convert.ToInt64(Session["UserId"]); DataTable dtFaculty = TMSFacultyDetails.GetStaffFacultyDetails(null, 7, UserId).Tables[0]; if (dtFaculty.Rows.Count > 0) { Int64 FacultyId = Convert.ToInt64(dtFaculty.Rows[0]["FD_FacultyDetailsId"]); TMSFacultyDetails objFaculty = TMSFacultyDetails.Get(FacultyId); if (objFaculty != null) { objFaculty.FDFirstName = txtFullName.Text; objFaculty.FDBirthPlace = txtBithPlace.Text; objFaculty.FDBirthDate = Convert.ToDateTime(txtDOB.Text); objFaculty.FDBloodGroup = ddlBloddGroup.SelectedValue; objFaculty.FDNationality = txtNationality.Text; objFaculty.FDCaste = txtCaste.Text; objFaculty.FDSubCaste = txtSubcaste.Text; objFaculty.FDGender = ddlGender.SelectedValue; objFaculty.FDMotherTongue = txtMotherTongue.Text; objFaculty.FDMedicalProblem = txtMedicalproblems.Text; if (txtDOJ.Text != "") { objFaculty.FDJoiningDate = Convert.ToDateTime(txtDOJ.Text); } else { objFaculty.FDJoiningDate = null; } //objFaculty.FDHighestDegreeCompletd = ddlHighestDegree.SelectedValue; objFaculty.FDHighestDegreeCompletd = txtHeighestDegree.Text; objFaculty.FDSpecificExpertise = ddlSpeciallization.SelectedItem.Text; objFaculty.FDCompletionDate = ddlCompletedYear.SelectedValue; objFaculty.FDUniversity = txtUniversity.Text; objFaculty.FDLastSchoolwas = txtLastSchoolWas.Text; if (txtLastSchoolFrom.Text != "") { objFaculty.FDLastSchoolFromDate = Convert.ToDateTime(txtLastSchoolFrom.Text); } if (txtLastSchoolTo.Text != "") { objFaculty.FDLastSchoolToDate = Convert.ToDateTime(txtLastSchoolTo.Text); } objFaculty.FDExperienceTo = txtTotalExpInYear.Text; objFaculty.FDExperienceFrom = txtTotalExpInMonth.Text; objFaculty.FDImage = ImageE; objFaculty.Update(); Int64 AddressId = Convert.ToInt64(objFaculty.FDAddressId); TMSAddressDetails objAddressDetails = TMSAddressDetails.Get(AddressId); if (objAddressDetails != null) { objAddressDetails.ADPermanentAddress = txtAddress.Text.Trim(); if (!string.IsNullOrEmpty(ddlCity.SelectedValue)) { objAddressDetails.ADCityId = Convert.ToInt64(ddlCity.SelectedValue); } if (!string.IsNullOrEmpty(ddlCountry.SelectedValue)) { objAddressDetails.ADCountryId = Convert.ToInt64(ddlCountry.SelectedValue); } if (!string.IsNullOrEmpty(ddlState.SelectedValue)) { objAddressDetails.ADStateId = Convert.ToInt64(ddlState.SelectedValue); } objAddressDetails.ADEmailId = txtEmailID.Text.Trim(); objAddressDetails.ADMobileNo = txtmobileNo.Text.Trim(); objAddressDetails.ADPinCode = txtPin.Text.Trim(); objAddressDetails.ADLandLineNo = txtResidencePhone.Text; objAddressDetails.Update(); } TMSUserLogin objLogin = TMSUserLogin.Get(Convert.ToInt64(Session["UserId"])); if (objLogin != null) { //objLogin.ULUserName = txtEmailID.Text.Trim(); objLogin.ULEmailId = txtEmailID.Text.Trim(); objLogin.Update(); } BindAccountManagerDetails(); SectionEditProfile.Visible = false; SectionViewProfile.Visible = true; dvMsg.Visible = true; lblMessage.Text = "Profile Is Updated Successfully"; dvMsg.Attributes.Add("class", "warring_msg"); } } } } catch (Exception ex) { } }
public static TMSFacultyDetails Get(System.Int64 fdFacultyDetailsId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSFacultyDetails instance; instance = new TMSFacultyDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSFacultyDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, fdFacultyDetailsId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) //throw new ApplicationException("Could not get TMSFacultyDetails ID:" + fdFacultyDetailsId.ToString()+ " from Database."); // Return results. return null; ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }
public static DataSet GetSearch(TMSFacultyDetails searchObject) { return(GetSearch(searchObject.FDFacultyDetailsId, searchObject.FDLoginId, searchObject.FDFacultyId, searchObject.FDSchoolCatgoryId, searchObject.FDTitle, searchObject.FDFirstName, searchObject.FDMiddleName, searchObject.FDLastName, searchObject.FDDate, searchObject.FDCaste, searchObject.FDSubCaste, searchObject.FDBirthPlace, searchObject.FDBloodGroup, searchObject.FDMotherTongue, searchObject.FDNationality, searchObject.FDTransportStatus, searchObject.FDMedicalProblem, searchObject.FDSchoolCategoryId, searchObject.FDSchoolSubCategoryId, searchObject.FDSubjectId, searchObject.FDInterestPosition, searchObject.FDCertifiedSubject, searchObject.FDCertifiedAgeGroup, searchObject.FDFullTimeTeaching, searchObject.FDIndustryExpertise, searchObject.FDSpecificExpertise, searchObject.FDHighestDegreeCompletd, searchObject.FDFieldOfStudy, searchObject.FDUniversity, searchObject.FDCompletionDate, searchObject.FDAddressId, searchObject.FDQualificationDetails, searchObject.FDExperienceFrom, searchObject.FDExperienceTo, searchObject.FDExperienceInYrs, searchObject.FDImage, searchObject.FDJoiningDate, searchObject.FDBirthDate, searchObject.FDGender, searchObject.FDMarrialStatus, searchObject.FDAgeProof, searchObject.FDResume, searchObject.FDReleavingLetter, searchObject.FDRetiredOn, searchObject.FDExtraOne, searchObject.FDCreatedBy, searchObject.FDLastSchoolwas, searchObject.FDLastSchoolFromDate, searchObject.FDLastSchoolToDate, searchObject.FDStatus)); }