示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     txtEmployeeName.Attributes.Add("readonly", "true");
     if (!IsPostBack)
     {
         InitializeSession();
         hfCurrentUser.Value = CurrentUserSession.UserCode;
         //  txtFromDate.Text = DateTime.Now.ToShortDateString();
         //  txtToDate.Text = DateTime.Now.ToShortDateString();
     }
     else
     {
         Page.ClientScript.GetPostBackEventReference(this, String.Empty);
         String eventTarget = Request["__EVENTTARGET"].IsNullOrEmpty() ? String.Empty : Request["__EVENTTARGET"];
         if (eventTarget == "SearchEmployee")
         {
             HRM_Emp searchEmp = Session[ASL.STATIC.StaticInfo.SearchSessionVarName] as HRM_Emp;
             if (searchEmp.IsNotNull())
             {
                 CustomList <HRM_Emp> empList = new CustomList <HRM_Emp>();
                 txtEmployeeName.Text = searchEmp.EmpName;
                 // empList.Add(searchEmp);
                 // Session["View_EmpList"] = empList;
             }
         }
     }
 }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack.IsFalse())
            {
                InitializeCombo();
            }
            else
            {
                Page.ClientScript.GetPostBackEventReference(this, String.Empty);
                String eventTarget = Request["__EVENTTARGET"].IsNullOrEmpty() ? String.Empty : Request["__EVENTTARGET"];
                if (eventTarget == "SearchEmployee")
                {
                    HRM_Emp searchEmp = Session[StaticInfo.SearchSessionVarName] as HRM_Emp;
                    if (searchEmp.IsNotNull())
                    {
                        txtEmployeeName.Text = searchEmp.EmpName;
                        hfEmpKey.Value       = searchEmp.EmpKey.ToString();
                        txtBal.Text          = manager.GetBal(searchEmp.EmpKey).ToString();
                        txtCreditAmount.Text = txtBal.Text;

                        ddlReceiptFromAC_nc.DataSource     = manager.GetReceiptHeadList(searchEmp.EmpKey);
                        ddlReceiptFromAC_nc.DataTextField  = "COAName";
                        ddlReceiptFromAC_nc.DataValueField = "COAKey";
                        ddlReceiptFromAC_nc.DataBind();
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                txtEmployeeName.Attributes.Add("readonly", "true");

                if (IsPostBack.IsFalse())
                {
                    InitializeCombo();
                }
                else
                {
                    Page.ClientScript.GetPostBackEventReference(this, String.Empty);
                    String eventTarget = Request["__EVENTTARGET"].IsNullOrEmpty() ? String.Empty : Request["__EVENTTARGET"];
                    if (Request["__EVENTTARGET"] == "SearchEmployee")
                    {
                        hfEmpCode.Value = "";
                        HRM_Emp searchEmp = Session[ASL.STATIC.StaticInfo.SearchSessionVarName] as HRM_Emp;
                        if (searchEmp.IsNotNull())
                        {
                            txtEmployeeName.Text = searchEmp.EmpName;
                            hfEmpCode.Value      = searchEmp.EmpCode;
                            txtEmpID.Text        = searchEmp.EmpCode;
                            hfEmpKey.Value       = searchEmp.EmpKey.ToString();

                            //added by zaki
                            //if (searchEmp.OrgKey > 0)
                            //{
                            //    string comKey = string.Empty, branKey = string.Empty, depKey = string.Empty;
                            //    GetAllOrgKey(searchEmp.OrgKey, out comKey, out branKey, out depKey);

                            //    ddlCompany.SelectedValue = comKey;
                            //    ddlCompany_SelectedIndexChanged(null, null);
                            //    ddlBranch.SelectedValue = ddlBranch.Items.FindByValue(branKey.ToString()) == null ? "" : branKey;
                            //    ddlBranch_SelectedIndexChanged(null, null);
                            //    ddlDepartment.SelectedValue = ddlDepartment.Items.FindByValue(depKey.ToString()) == null ? "" : depKey;
                            //}
                            //ddlGrade.SelectedValue = ddlGrade.Items.FindByValue(searchEmp.GradeKey.ToString()) == null ? "" : searchEmp.GradeKey.ToString();
                            //ddlGrade_SelectedIndexChanged(null, null);
                            //ddlDesignation.SelectedValue = ddlDesignation.Items.FindByValue(searchEmp.DesigKey.ToString()) == null ? "" : searchEmp.DesigKey.ToString();
                            //end zaki

                            StringBuilder searchString = SearchString();
                            Session[StaticInfo.SearchArg] = searchString;

                            string selectedEmpHeadline = string.Format("Employee Code: {0}. Employee Name: {1}", searchEmp.EmpCode, searchEmp.EmpName);
                            this.Page.ClientScript.RegisterStartupScript(this.GetType(), "loadEmp", string.Format("loadEmp('{0}','{1}')", searchEmp.EmpCode, selectedEmpHeadline), true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack.IsFalse())
     {
         InitializeCombo();
         InitializeSession();
     }
     else
     {
         Page.ClientScript.GetPostBackEventReference(this, String.Empty);
         String eventTarget = Request["__EVENTTARGET"].IsNullOrEmpty() ? String.Empty : Request["__EVENTTARGET"];
         if (eventTarget == "SearchEmployee")
         {
             HRM_Emp searchEmp = Session[StaticInfo.SearchSessionVarName] as HRM_Emp;
             if (searchEmp.IsNotNull())
             {
                 txtEmployeeName.Text = searchEmp.EmpName;
                 hfEmpKey.Value       = searchEmp.EmpKey.ToString();
             }
         }
     }
 }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack.IsFalse())
            {
                EmployeeList = new CustomList <HRM_Emp>();
                string empKey = Request.QueryString.Get("EmpKey");
                Session["ProfileEmpKey"] = empKey;
                if (empKey.IsNullOrEmpty())
                {
                    EmployeeList = _empManager.GetEmpInfo("");
                }
                else
                {
                    EmployeeList = _empManager.GetReportees(Convert.ToInt64(empKey));
                }
                string empcode = Request.QueryString.Get("empCodeForLeave");
                if (empcode.IsNotNullOrEmpty())
                {
                    LeaveInformationTrans(empcode);
                }
            }
            else
            {
                Page.ClientScript.GetPostBackEventReference(this, String.Empty);

                String eventTarget = Request["__EVENTTARGET"].IsNullOrEmpty() ? String.Empty : Request["__EVENTTARGET"];
                if (Request["__EVENTTARGET"] == "SearchEmployee")
                {
                    string empCode = txtSearch.Text;
                    var    page2   = this.Page;
                    string s2      = page2.Page.ToString();
                    //string s3 = page2.Items.ToString();
                    //string s1 = page2.Title.ToString();
                    HRM_Emp searchEmp = Session[ASL.STATIC.StaticInfo.SearchSessionVarName] as HRM_Emp;
                    if (s2 == "ASP.ui_leavemanagement_leavetransaction_aspx")
                    {
                        if (empCode != "" || searchEmp.EmpCode != "")
                        {
                            empCode        = searchEmp.EmpCode;
                            txtSearch.Text = searchEmp.EmpCode;
                            LeaveInformationTrans(empCode);
                        }
                    }
                    else if (s2 == "ASP.ui_leavemanagement_leaveallocation_aspx")
                    {
                        if (empCode != "" || searchEmp.EmpCode != "")
                        {
                            empCode        = searchEmp.EmpCode;
                            txtSearch.Text = searchEmp.EmpCode;
                            LeaveInformation(empCode);
                        }
                    }
                    else if (s2 == "ASP.ui_employeebasicinfo_madicalreinversement_aspx")
                    {
                        if (empCode != "" || searchEmp.EmpCode != "")
                        {
                            empCode        = searchEmp.EmpCode;
                            txtSearch.Text = searchEmp.EmpCode;
                            MedicalAllowance(empCode);
                        }
                    }
                    else if (s2 == "ASP.ui_employeebasicinfo_promotionincrement_aspx")
                    {
                        if (empCode != "" || searchEmp.EmpCode != "")
                        {
                            empCode        = searchEmp.EmpCode;
                            txtSearch.Text = searchEmp.EmpCode;
                            Promotion(empCode);
                        }
                    }
                    else if (s2 == "ASP.ui_payroll_customerinfo_aspx")
                    {
                        if (empCode != "" || searchEmp.EmpCode != "")
                        {
                            empCode        = searchEmp.EmpCode;
                            txtSearch.Text = searchEmp.EmpCode;
                            CustomerInfo(empCode);
                        }
                    }
                    else if (s2 == "ASP.ui_employeebasicinfo_employeebasicinformation_aspx")
                    {
                        if (searchEmp.IsNotNull())
                        {
                            var page = this.Page as EmployeeBasicInformation;
                            var emp  = _empManager.GetEmpByCode(searchEmp.EmpCode);
                            page.ClearControls();
                            txtSearch.Text = searchEmp.EmpCode;
                            #region populate other tab
                            page.PopulteControl(emp);
                            #endregion

                            (this.Parent.FindControl("btnSave") as Button).Visible   = false;
                            (this.Parent.FindControl("btnUpdate") as Button).Visible = true;
                            //(this.Parent.FindControl("btnDelete") as Button).Visible = true;
                        }
                    }
                    else
                    {
                    }
                }
            }
        }