protected void btnSepartaion_Click(object sender, EventArgs e) { try { if (txtbxSeparation.Text != "") { string OCODE = ((SessionUser)Session["SessionUser"]).OCode; string[] EmpSrachItem = this.txtbxSeparation.Text.Split('-'); List <REmployee> employees = new List <REmployee>(); employees = employeeBll.GetSeparationSearchEmployeesList(OCODE, EmpSrachItem[0]).ToList(); if (employees.Count > 0) { GridviewSeparation.DataSource = employees; GridviewSeparation.DataBind(); } else { GridviewSeparation.DataSource = null; GridviewSeparation.DataBind(); ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('No Data Found!')", true); } } else { GetSeparationList(); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }
private void GetSeparationList() { try { string OCODE = ((SessionUser)Session["SessionUser"]).OCode; List <REmployee> employees = new List <REmployee>(); employees = employeeBll.GetEmployeeSeparation(OCODE).ToList(); if (employees.Count > 0) { GridviewSeparation.DataSource = employees; GridviewSeparation.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); } }