protected override void OnRequest() { base.OnRequest(); string marketLocation = getParameter("location"); try { MarketListModel marketList = null; using (Controller.Market controllerMarket = new Controller.Market()) { marketList = controllerMarket.GetMarketList(marketLocation, null); } WriteJson(marketList); } catch (UnfulfilException ex) { WriteUnfulfil(ex.DisplayMessage); } catch (Database.Exception ex) { WriteException(ex); } catch (Exception ex) { WriteException(ex); } }
protected override void OnRequest() { base.OnRequest(); string marketType = getParameter("market_type"); ProductListModel marketList = null; using (Controller.Market controllerMarket = new Controller.Market()) { marketList = controllerMarket.GetProductList(marketType); } WriteJson(marketList); }