//
        // GET: /AutoComplete/

        public JsonResult GetTableData(string q, int page, int pageLimit, string idFieldName, string textFieldName, string tableName, string dependentFieldName, string dependentFieldValue, string extraFields)
        {
            //List<IdTextInfo> aList = new List<IdTextInfo>();

            DataTable aList = new DataTable();

            AutoCompleteRepo aRepo = new AutoCompleteRepo();

            int totalCount = 0;

            string data = "";

            try
            {
                aList = aRepo.GetTableData(q, page, idFieldName, textFieldName, tableName, dependentFieldName, dependentFieldValue, extraFields);

                totalCount = aList.Rows.Count;

                data = JsonConvert.SerializeObject(aList);
            }
            catch (Exception ex)
            {
            }

            return(Json(new
            {
                data,
                totalCount,
                page
            }, JsonRequestBehavior.AllowGet));
        }
 public DataTable GetTableData(string q, int page, string idFieldName, string textFieldName, string tableName, string dependentFieldName, string dependentFieldValue, string extraFields)
 {
     return(_autoCompleteRepo.GetTableData(q, page, idFieldName, textFieldName, tableName, dependentFieldName, dependentFieldValue, extraFields));
 }