public static ClsSeviceCategoryData GetServiceCategoriesData(ServiceDirectorySearch input) { try { MySqlParameter[] param = new MySqlParameter[4]; param[0] = new MySqlParameter("@grpId", input.groupId); param[1] = new MySqlParameter("@moduleId", input.moduleId); DataSet Result = MySqlHelper.ExecuteDataset(GlobalVar.strAppConn, CommandType.StoredProcedure, "V8_GetServiceCategoriesList", param); DataTable dtCategory = Result.Tables[0]; DataTable dtDirectory = Result.Tables[1]; List <ServiceCategoryList> ServiceCategoryList = new List <ServiceCategoryList>(); List <ServiceDirectoryList> ServiceDirectoryList = new List <ServiceDirectoryList>(); if (dtCategory.Rows.Count > 0) { ServiceCategoryList = GlobalFuns.DataTableToList <ServiceCategoryList>(dtCategory); } if (dtDirectory.Rows.Count > 0) { ServiceDirectoryList = GlobalFuns.DataTableToList <ServiceDirectoryList>(dtDirectory); } ClsSeviceCategoryData obj = new ClsSeviceCategoryData(); obj.Category = ServiceCategoryList; obj.DirectoryData = ServiceDirectoryList; return(obj); } catch (Exception ex) { throw ex; } }
public object GetServiceCategoriesData(ServiceDirectorySearch service) { dynamic TBGetServiceCategoriesDataList; try { ClsSeviceCategoryData Result = ServiceDirectory.GetServiceCategoriesData(service); if (Result != null) { TBGetServiceCategoriesDataList = new { status = "0", message = "success", Result = Result }; } else { TBGetServiceCategoriesDataList = new { status = "0", message = "Record not found" }; } } catch { TBGetServiceCategoriesDataList = new { status = "1", message = "failed" }; } return(new { TBGetServiceCategoriesDataList }); }