Пример #1
0
        //private void BridGridTerminatedEmployees()
        //{

        //    try
        //    {

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

        //        throw;
        //    }


        //}
        void BindGridTransferedEmployee()
        {
            //try
            //{
            //    // string OCODE = ((SessionUser)Session["SessionUser"]).OCode;
            //    string OCODE = "8989";
            //    var emp = objEmp_BLL.GetTransfered_Employees(OCODE).ToList();
            //    if (emp.Count() > 0)
            //    {
            //        GridViewEMP_TRNS.DataSource = emp;
            //        GridViewEMP_TRNS.DataBind();
            //    }
            //    else
            //    {
            //        var obj = new List<HRM_EMPLOYEES>();
            //        obj.Add(new HRM_EMPLOYEES());

            //        // Bind the DataTable which contain a blank row to the GridView
            //        GridViewEMP_TRNS.DataSource = obj;
            //        GridViewEMP_TRNS.DataBind();

            //        int columnsCount = GridViewEMP_TRNS.Columns.Count;
            //        GridViewEMP_TRNS.Rows[0].Cells.Clear();// clear all the cells in the row
            //        GridViewEMP_TRNS.Rows[0].Cells.Add(new TableCell()); //add a new blank cell
            //        GridViewEMP_TRNS.Rows[0].Cells[0].ColumnSpan = columnsCount; //set the column span to the new added cell


            //        GridViewEMP_TRNS.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center;
            //        GridViewEMP_TRNS.Rows[0].Cells[0].ForeColor = System.Drawing.Color.Red;
            //        GridViewEMP_TRNS.Rows[0].Cells[0].Font.Bold = true;

            //        //set No Results found to the new added cell
            //        GridViewEMP_TRNS.Rows[0].Cells[0].Text = "NO RECORDS FOUND!";

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

            try
            {
                string           OCODE            = ((SessionUser)Session["SessionUser"]).OCode;
                List <REmployee> TransferEmployes = new List <REmployee>();

                TransferEmployes = employeeBll.GetTransFerEmployeeEmployees(OCODE).ToList();
                if (TransferEmployes.Count > 0)
                {
                    GridViewEMP_TRNS.DataSource = TransferEmployes;
                    GridViewEMP_TRNS.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);
            }
        }
Пример #2
0
        protected void btnTransfer_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtbxTranserfer.Text != "")
                {
                    string           OCODE        = ((SessionUser)Session["SessionUser"]).OCode;
                    string[]         EmpSrachItem = this.txtbxTranserfer.Text.Split('-');
                    List <REmployee> employees    = new List <REmployee>();

                    employees = employeeBll.GetTransferListBySearchitem(OCODE, EmpSrachItem[0]).ToList();
                    if (employees.Count > 0)
                    {
                        GridViewEMP_TRNS.DataSource = employees;
                        GridViewEMP_TRNS.DataBind();
                    }
                    else
                    {
                        GridViewEMP_TRNS.DataSource = null;
                        GridViewEMP_TRNS.DataBind();
                        ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('No Data Found!')", true);
                    }
                }
                else
                {
                    BindGridTransferedEmployee();
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
            }
        }
Пример #3
0
 void BindGridEmployeeTransfer()
 {
     try
     {
         string           OCODE    = ((SessionUser)Session["SessionUser"]).OCode;
         string           EId      = txtEid_TRNS.Text;
         int              eidMax   = objEmp_BLL.GetMaxEid(OCODE, EId);
         List <TransferR> transfer = objEmp_BLL.GetEmployeeTransfer(eidMax);
         if (transfer.Count > 0)
         {
             GridViewEMP_TRNS.DataSource = transfer;
             GridViewEMP_TRNS.DataBind();
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
     }
 }