Opened 8 years ago

Last modified 8 years ago

#1832 new defect

Administrator Tool shows blank ADM2s when search for geo for new cooperator

Reported by: Mark J. Millard Owned by:
Priority: minor Milestone:
Component: Admin Tool Version: Server 1.10.3
Severity: Keywords: ADM2 cooperator
Cc: Database Engine: N/A
Operating System: N/A

Description

The current administrator tool shows 100 rows on npgsWEB for United States, Iowa when adding a new user with the tool and selecting geography through the dropdown. It does this because we added 99 county geography rows and the lookup in the administrator tool does not show adm2,adm3, etc.

Change History (2)

comment:1 by Mark J. Millard, 8 years ago

A suggested code fix by a developer is:

I believe the place to change that behavior is GrinGlobal.Business\AdminData.cs SearchGeographies method

public DataSet SearchGeographies(string query) {

DataSet dsReturn = createReturnDataSet();
try {

using (DataManager dm = BeginProcessing(true)) {

make sure user has proper permissions
checkUserHasAdminEnabled();

if (!String.IsNullOrEmpty(query)) {

if (!query.Contains("%")) {

force a right-hand like if needed
query += "%";

}

}

dm.Read(@"

SELECT

g.geography_id,
g.current_geography_id,
r.region_id,
r.continent,
r.subcontinent,
g.country_code,
cvl.title as country_name,
g.adm1,
g.adm1_type_code,
g.adm2,
g.adm2_type_code,
g.adm3,
g.adm3_type_code,
g.adm4,
g.adm4_type_code,
g.changed_date,
g.note,
g.created_date,
g.created_by,
g.modified_date,
g.modified_by,
g.owned_date,
g.owned_by

FROM

geography g left join geography_region_map grm

on g.geography_id = grm.geography_id
left join region r
on grm.region_id = r.region_id
left join code_value cv

on g.country_code = cv.value
and cv.group_name = 'GEOGRAPHY_COUNTRY_CODE'

left join code_value_lang cvl

on cv.code_value_id = cvl.code_value_id
and cvl.sys_lang_id = :langid

where

g.country_code like :q1 or g.adm1 like :q2 or r.continent like :q3 or r.subcontinent like :q4 or cvl.title like :q5

order by

r.continent, r.subcontinent, g.country_code, g.adm1

", dsReturn, "search_geographies", new DataParameters(":q1", query, DbType.String,

":q2", query, DbType.String,
":q3", query, DbType.String,
":q4", query, DbType.String,
":q5", query, DbType.String,
":langid", LanguageID, DbType.Int32));

}

} catch (Exception ex) {

if (LogException(ex, dsReturn)) {

throw ex;

}

} finally {

FinishProcessing(dsReturn, LanguageID);

}
return dsReturn;

}

comment:2 by Mark J. Millard, 8 years ago

Type: enhancement → defect
Note: See TracTickets for help on using tickets.