protected void GetEmpoyeeRecords() { if (Session["USERID"].ToString().Trim().ToUpper() != "ADMIN") { // dtEmp = objAttnRmdMgr.SelectSupervisorWiseEmp(Session["EMPID"].ToString().Trim()); ddlOffice.Enabled = false; lblOffice.Visible = false; grEmpList.DataSource = objEmpInfoMgr.GetSuperVisiorWiseEmp(Session["EMPID"].ToString().ToUpper(), Session["OFFICEID"].ToString()); grEmpList.DataBind(); } else { dtEmp = objAttnRmdMgr.SelectLocationWiseEmp(ddlOffice.SelectedValue.ToString()); ddlOffice.Enabled = true; lblOffice.Visible = true; grEmpList.DataSource = dtEmp; grEmpList.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["ISADMIN"].ToString() == "N") { txtEmpId.Text = Session["EMPID"].ToString().ToUpper(); this.SearchEmployee(); btnSearch.Visible = false; txtEmpId.Enabled = false; pnlEmpList.Visible = true; if (Session["COUNTRYDIRECTOR"].ToString() == "N") { grEmpList.DataSource = objEmpInfoMgr.GetSuperVisiorWiseEmp(Session["EMPID"].ToString().ToUpper(), Session["OFFICEID"].ToString()); } else { grEmpList.DataSource = objEmpInfoMgr.GetSuperviseeEmp(Session["EMPID"].ToString().ToUpper()); } grEmpList.DataBind(); if (grEmpList.Rows.Count > 1) { btnSearch.Visible = true; } else { btnSearch.Visible = false; } } else if (Session["ISADMIN"].ToString() == "Y") { if (Session["USERID"].ToString().ToUpper() != "ADMIN") { txtEmpId.Text = Session["EMPID"].ToString().ToUpper(); this.SearchEmployee(); btnSearch.Visible = false; txtEmpId.Enabled = false; pnlEmpList.Visible = true; grEmpList.DataSource = objEmpInfoMgr.SelectDivisionWiseEmp(Session["EMPID"].ToString().ToUpper()); grEmpList.DataBind(); if (grEmpList.Rows.Count > 1) { btnSearch.Visible = true; } else { btnSearch.Visible = false; } } else { txtEmpId.Text = ""; btnSearch.Visible = true; txtEmpId.Enabled = true; pnlEmpList.Visible = false; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["USERID"] == null) { ShowClientMessage(Page, "Session Expired. You are redirected to Login Again!", "error"); Thread.Sleep(1000); Response.Redirect("~/Login.aspx"); } lblSideBarUserName.InnerText = HttpContext.Current.Session["USERID"].ToString(); lblUserIDFullName.InnerText = HttpContext.Current.Session["USERNAME"].ToString(); //imgUserAccount.Src = HttpContext.Current.Session["PHOTO"].ToString(); //imgUserSideBar.Src= HttpContext.Current.Session["PHOTO"].ToString(); //imgUserAccountDown.Src = HttpContext.Current.Session["PHOTO"].ToString(); DataTable dtEmpInfo = objEmpInfoMgr.SelectEmpInfo(HttpContext.Current.Session["EMPID"].ToString()); if (dtEmpInfo.Rows.Count > 0) { if (Common.CheckNullString(dtEmpInfo.Rows[0]["EmpImage"].ToString().Trim()) != "") { MemoryStream ms = new MemoryStream((byte[])dtEmpInfo.Rows[0]["EmpImage"]); Byte[] imgByte = ms.ToArray(); string base64String = Convert.ToBase64String(imgByte, 0, imgByte.Length); imgEmpImage.ImageUrl = "data:image/png;base64," + base64String; imgUserAccountDown.ImageUrl = "data:image/png;base64," + base64String; //imgUserAccount.ImageUrl = "data:image/png;base64," + base64String; } else { imgEmpImage.ImageUrl = "~/Content/images/NoImageSmall.jpg"; imgUserAccountDown.ImageUrl = "~/Content/images/NoImageSmall.jpg"; //imgUserAccount.ImageUrl = "~/Content/images/NoImageSmall.jpg"; } } else { imgEmpImage.ImageUrl = "~/Content/images/NoImageSmall.jpg"; imgUserAccountDown.ImageUrl = "~/Content/images/NoImageSmall.jpg"; //imgUserAccount.ImageUrl = "~/Content/images/NoImageSmall.jpg"; } lblFullName.InnerText = HttpContext.Current.Session["USERNAME"].ToString(); lblDesig.InnerText = HttpContext.Current.Session["DESIGNATION"].ToString(); lblJoinDate.InnerText = "Employee Since " + HttpContext.Current.Session["JOINDATE"].ToString(); //Session["USERID"] = "Admin"; Session["FISCALYRID"] = "1"; // For leave menu item check if (Session["ISADMIN"].ToString().Trim() == "N") { DataTable dtSupervisee = objEmpInfoMgr.GetSuperVisiorWiseEmp(Session["EMPID"].ToString().Trim(), Session["DIVISIONID"].ToString().Trim(), objDS.dtEmpList); if (dtSupervisee.Rows.Count <= 1) { liLeaveRecommendation.Visible = false; liLeaveApplicationList.Visible = false; liRegrettedLeaveList.Visible = false; liApprovedLeaveList.Visible = false; } } else { liLeaveRecommendation.Visible = false; liLeaveApplicationList.Visible = false; liRegrettedLeaveList.Visible = false; liApprovedLeaveList.Visible = false; } if (Session["IsCountryDirector"].ToString() == "Y") { liLeaveRecommendation.Visible = false; } } Thread.Sleep(200); ScriptManager.RegisterStartupScript(this.UpdatePanelMaster, typeof(string), "ValidatorUpdateDisplay", this.GetValidatationScript(), true); ScriptManager.RegisterStartupScript(this.UpdatePanelMaster, typeof(string), "deleteLink", this.getDeleteConfirmScript(), true); ScriptManager.RegisterStartupScript(this.UpdatePanelMaster, typeof(string), "datepicker", this.getPageOnLoadScript(), true); ScriptManager.RegisterStartupScript(this.UpdatePanelMaster, typeof(string), "iCheck", this.getiCheckScript(), true); }