public List <tbl_DeptLeaveRequest> GetAutoCompleteList(string search)
 {
     try
     {
         DALBase obj = new DALBase(_config);
         List <tbl_DeptLeaveRequest> listObj = new List <tbl_DeptLeaveRequest>();
         DataSet   ds = obj.GetAutoCompleteList(ConstantStoredProcedure.SP_BCL_GETEMPLOYEENAMEDEPT, search);
         DataTable dt = ds.Tables[0];
         if (dt.Rows.Count > 0)
         {
             foreach (DataRow dtRow in dt.Rows)
             {
                 string[] vals      = dtRow["EmpNameId"].ToString().Split('_');
                 var      EmpID     = Convert.ToString(vals[0]);
                 var      EmpName   = Convert.ToString(vals[1]);
                 var      objAutoId = new tbl_DeptLeaveRequest();
                 objAutoId.EmployeeID   = EmpID;
                 objAutoId.EmployeeName = EmpName;
                 listObj.Add(objAutoId);
             }
         }
         return(listObj);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #2
0
 public List <string> GetAutoCompleteList(string search)
 {
     try
     {
         DALBase       obj     = new DALBase(_config);
         List <string> listObj = new List <string>();
         DataSet       ds      = obj.GetAutoCompleteList(ConstantStoredProcedure.SP_BCL_GETEMPLOYEENAME, search);
         DataTable     dt      = ds.Tables[0];
         if (dt.Rows.Count > 0)
         {
             foreach (DataRow dtRow in dt.Rows)
             {
                 var EmpName = dtRow["EmpNameId"].ToString();
                 listObj.Add(EmpName);
             }
         }
         return(listObj);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }