public static QuickSearchResult LoadSingle(long userId, string entity, string id, string parameters = "") { var item = new DdlVm.DdlOption(); switch (entity) { //case "LOCATION": item = BlLocation.LoadQs(userId, Convert.ToInt64(id)); break; //case "LOCATIONEMPLOYEE": item = BlLocation.LoadLocationEmployeeQs(userId, id); break; case "EMPLOYEE": item = BlEmployee.LoadQs(userId, Convert.ToInt64(id), parameters); break; //case "PRODUCT": item = BlProduct.LoadQs(userId, Convert.ToInt64(id)); break; //case "SUPPLIER": item = BlSupplier.LoadQs(userId, Convert.ToInt64(id)); break; case "USER": item = BlUser.LoadQs(userId, Convert.ToInt64(id)); break; case "MODULE": item = BlModule.LoadQs(userId, id); break; case "CODE": item = BlCode.LoadQs(userId, id, parameters); break; //case "WAREHOUSE": item = BlWarehouse.LoadQs(userId, Convert.ToInt64(id), parameters); break; //case "LOCATIONMORAL": item = BlLocationMoral.LoadQs(userId, Convert.ToInt64(id), parameters); break; //case "STOCK": item = BlStock.LoadQs(userId, Convert.ToInt64(id)); break; } var toRet = new QuickSearchResult { id = item.value, text = item.label }; return(toRet); }
public static QuickSearchPagedResult LoadSearch(long userId, string entity, string parameters, string searchTerm, int pageSize, int pageNum) { List <DdlVm.DdlOption> items = null; long count = 0; switch (entity) { //case "LOCATION": items = BlLocation.LoadQs(userId, parameters, searchTerm, pageSize, pageNum, out count); break; //case "LOCATIONEMPLOYEE": items = BlLocation.LoadLocationEmployeeQs(userId, parameters, searchTerm, pageSize, pageNum, out count); break; case "EMPLOYEE": items = BlEmployee.LoadQs(userId, parameters, searchTerm, pageSize, pageNum, out count); break; //case "PRODUCT": items = BlProduct.LoadQs(userId, parameters, searchTerm, pageSize, pageNum, out count); break; //case "SUPPLIER": items = BlSupplier.LoadQs(userId, parameters, searchTerm, pageSize, pageNum, out count); break; case "USER": items = BlUser.LoadQs(userId, parameters, searchTerm, pageSize, pageNum, out count); break; case "MODULE": items = BlModule.LoadQs(userId, parameters, searchTerm, pageSize, pageNum, out count); break; case "CODE": items = BlCode.LoadQs(userId, parameters, searchTerm, pageSize, pageNum, out count); break; //case "WAREHOUSE": items = BlWarehouse.LoadQs(userId, parameters, searchTerm, pageSize, pageNum, out count); break; //case "LOCATIONMORAL": items = BlLocationMoral.LoadQs(userId, parameters, searchTerm, pageSize, pageNum, out count); break; //case "STOCK": items = BlStock.LoadQs(userId, parameters, searchTerm, pageSize, pageNum, out count); break; } var toRet = new QuickSearchPagedResult { total = count }; if (items != null) { foreach (var item in items) { toRet.results.Add(new QuickSearchResult { id = item.value, text = item.label }); } } return(toRet); }