Пример #1
0
        protected void btnallEmployee_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtbxSearchAllEmployee.Text != "")
                {
                    string           OCODE        = ((SessionUser)Session["SessionUser"]).OCode;
                    string[]         EmpSrachItem = this.txtbxSearchAllEmployee.Text.Split('-');
                    List <REmployee> employees    = new List <REmployee>();

                    employees = employeeBll.GeAlltSearchEmployeesList(OCODE, EmpSrachItem[0]).ToList();
                    if (employees.Count > 0)
                    {
                        GridivewAllEmployes.DataSource = employees;
                        GridivewAllEmployes.DataBind();
                    }
                    else
                    {
                        GridivewAllEmployes.DataSource = null;
                        GridivewAllEmployes.DataBind();
                        ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('No Data Found!')", true);
                    }
                }
                else
                {
                    GetAllEmploye();
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
            }
        }
Пример #2
0
        //private void GetResignation()
        //{
        //    try
        //    {
        //        string OCODE = ((SessionUser)Session["SessionUser"]).OCode;
        //        List<REmployee> employees = new List<REmployee>();
        //        employees = employeeBll.GetResignation(OCODE).ToList();
        //        if (employees.Count > 0)
        //        {
        //            gridviewResignation.DataSource = employees;
        //            gridviewResignation.DataBind();
        //        }
        //    }
        //    catch (Exception ex)
        //    {

        //        throw;
        //    }

        //}

        //private void GetRetiredEmployee()
        //{


        //        try
        //        {
        //            string OCODE = ((SessionUser)Session["SessionUser"]).OCode;
        //            List<REmployee> employees = new List<REmployee>();
        //            employees = employeeBll.GetRetiredEmployee(OCODE).ToList();
        //            if (employees.Count > 0)
        //            {
        //                gridTetired.DataSource = employees;
        //                gridTetired.DataBind();
        //            }
        //        }
        //        catch (Exception ex)
        //        {

        //            throw;
        //        }

        //}

        //protected void gridTetired_PageIndexChanging(object sender, GridViewPageEventArgs e)
        //{
        //    try
        //    {
        //        gridTetired.PageIndex = e.NewPageIndex;
        //        GetRetiredEmployee();

        //    }
        //    catch (Exception)
        //    {

        //        throw;
        //    }
        //}

        //protected void gridviewResignation_PageIndexChanging(object sender, GridViewPageEventArgs e)
        //{
        //    try
        //    {
        //        gridviewResignation.PageIndex = e.NewPageIndex;
        //        GetResignation();

        //    }
        //    catch (Exception)
        //    {

        //        throw;
        //    }
        //}

        private void GetAllEmploye()
        {
            try
            {
                string           OCODE     = ((SessionUser)Session["SessionUser"]).OCode;
                List <REmployee> employees = new List <REmployee>();
                employees = employeeBll.GetAllEmploye(OCODE).ToList();
                if (employees.Count > 0)
                {
                    GridivewAllEmployes.DataSource = employees;
                    GridivewAllEmployes.DataBind();
                }
            }
            catch (Exception ex)
            {
                //string EID = Convert.ToString(((SessionUser)Session["SessionUser"]).EID);
                //LogController<employeeList>.SetLog(ex, EID);
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
            }
        }