Пример #1
0
        private void LoadApprovePersonListByEid(string employeeID)
        {
            try
            {
                HRM_PersonalInformations personalInformation = objEmp_BLL.getDepartmentByEID(employeeID);
                int departmentId = Convert.ToInt16(personalInformation.DepartmentId);
                List <ReportingBoss> personallist    = objEmp_BLL.LoadApprovePersonListByDepartmentId(departmentId);
                List <ReportingBoss> reportingBosses = new List <ReportingBoss>();

                foreach (var aitem in personallist)
                {
                    ReportingBoss _aitem = new ReportingBoss();
                    _aitem.FulllName = aitem.FirstName + " " + aitem.LastName;
                    reportingBosses.Add(_aitem);
                }

                if (personallist.Count > 0)
                {
                    drpdwnApproveSupervisor.DataSource     = personallist;
                    drpdwnApproveSupervisor.DataTextField  = "FulllName";
                    drpdwnApproveSupervisor.DataValueField = "EID";
                    drpdwnApproveSupervisor.DataBind();
                    drpdwnApproveSupervisor.Items.Insert(0, new ListItem("--Select--", "0"));

                    drpApprovedAdmin.DataSource     = personallist;
                    drpApprovedAdmin.DataTextField  = "FulllName";
                    drpApprovedAdmin.DataValueField = "EID";
                    drpApprovedAdmin.DataBind();
                    drpApprovedAdmin.Items.Insert(0, new ListItem("--Select--", "0"));
                }

                if (personallist.Count > 0)
                {
                    drpApprovedHR.DataSource     = personallist;
                    drpApprovedHR.DataTextField  = "FulllName";
                    drpApprovedHR.DataValueField = "EID";
                    drpApprovedHR.DataBind();
                    drpApprovedHR.Items.Insert(0, new ListItem("--Select--", "0"));
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
            }
        }
Пример #2
0
        //protected void txtEIdNo_TextChanged(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        string OCODE = ((SessionUser)Session["SessionUser"]).OCode;
        //        string employeeID = Convert.ToString(txtEid_TRNS.Text);
        //        getLeaveEnjoyedInfoById(employeeID);
        //        LoadApprovePersonListByEid(employeeID);
        //        var result = objEmp_BLL.GetEmployeeDetailsIDCard(employeeID, OCODE).ToList();
        //        if (result.Count > 0)
        //        {
        //            var objNewEmp = result.First();
        //            Emp_IMG_TR.Visible = true;
        //            Emp_IMG_TR.ImageUrl = "EmployeeIMG.ashx?eId=" + employeeID + "&oCode=" + OCODE;
        //            if (objNewEmp.Gender == "Male")
        //            {
        //                getLeaveTypeForMale();
        //                mlHeader.Visible = false;
        //                rdToal.Visible = false;
        //                tdMLE.Visible = false;
        //                tdmlB.Visible = false;
        //            }
        //            else
        //            {
        //                getLeaveTypesfordrp();
        //                mlHeader.Visible = true;
        //                rdToal.Visible = true;
        //                tdMLE.Visible = true;
        //                tdmlB.Visible = true;

        //            }


        //            txtEid_TRNS.Text = Convert.ToString(objNewEmp.EID);
        //            txtEmpName_TRNS.Text = Convert.ToString(objNewEmp.EMP_FIRSTNAME + " " + objNewEmp.EMP_LASTNAME);
        //            txtDepartment.Text = objNewEmp.DPT_NAME;
        //            txtDesignation.Text = objNewEmp.DEG_NAME;
        //        }
        //        else
        //        {
        //            Emp_IMG_TR.Visible = false;
        //            txtEmpName_TRNS.Text = "";
        //            txtDepartment.Text = "";
        //            txtDesignation.Text = "";
        //            ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('This Employee is Inactive!')", true);
        //            //NO RECORDS FOUND.
        //        }

        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        private void LoadApprovePersonListByEid(string employeeID)
        {
            try
            {
                HRM_PersonalInformations personalInformation = objEmp_BLL.getDepartmentByEID(employeeID);
                int departmentId = Convert.ToInt16(personalInformation.DepartmentId);
                List <ReportingBoss> personallist = objEmp_BLL.LoadApprovePersonListByDepartmentId(departmentId);
                if (personallist.Count > 0)
                {
                    drpdwnApproveSupervisor.DataSource     = personallist;
                    drpdwnApproveSupervisor.DataTextField  = "FulllName";
                    drpdwnApproveSupervisor.DataValueField = "EID";
                    drpdwnApproveSupervisor.DataBind();
                    drpdwnApproveSupervisor.Items.Insert(0, new ListItem("--Select--", "0"));

                    drpApprovedAdmin.DataSource     = personallist;
                    drpApprovedAdmin.DataTextField  = "FulllName";
                    drpApprovedAdmin.DataValueField = "EID";
                    drpApprovedAdmin.DataBind();
                    drpApprovedAdmin.Items.Insert(0, new ListItem("--Select--", "0"));
                }

                List <ReportingBoss> personalforHrm = objEmp_BLL.getPersonalInfoForHRM();

                if (personalforHrm.Count > 0)
                {
                    drpApprovedHR.DataSource     = personalforHrm;
                    drpApprovedHR.DataTextField  = "FulllName";
                    drpApprovedHR.DataValueField = "EID";
                    drpApprovedHR.DataBind();
                    drpApprovedHR.Items.Insert(0, new ListItem("--Select--", "0"));
                }
            }
            catch
            {
            }
        }