Exemplo n.º 1
0
 public void SetDetailItem(AreaMasterMiddles newTargetAreaItem, string selCategory)
 {
     if (newTargetAreaItem != null)
     {
         targetAreaItem   = newTargetAreaItem;
         selectedCategory = selCategory;
     }
 }
Exemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = NSBundle.MainBundle.LocalizedString("エリア選択", "エリア選択");

            // エリアMマスター取得
            dataSource = new DataSource(this);

            GourmetNaviAPI gourmetApi = new GourmetNaviAPI();
            JObject        data       = gourmetApi.GetApiData(GourmetNaviAPI.PrefMaster);

            targetPrefCode = (string)data["pref"][saitamaPrefNumber]["pref_code"];
            data           = gourmetApi.GetApiData(GourmetNaviAPI.AreaMasterM);

            bool start = false;
            int  i     = 0;

            while (true)
            {
                if ((string)data["garea_middle"][i]["pref"]["pref_code"] == targetPrefCode)
                {
                    AreaMasterMiddles am = new AreaMasterMiddles();

                    am.areacode_m = (string)data["garea_middle"][i]["areacode_m"];
                    am.areaname_m = (string)data["garea_middle"][i]["areaname_m"];
                    am.areacode_l = (string)data["garea_middle"][i]["garea_large"]["areacode_l"];
                    am.areaname_l = (string)data["garea_middle"][i]["garea_large"]["areaname_l"];
                    am.pref_code  = (string)data["garea_middle"][i]["pref"]["pref_code"];
                    am.pref_name  = (string)data["garea_middle"][i]["pref"]["pref_name"];

                    dataSource.Objects.Add(am);
                    start = true;
                }
                else
                {
                    if (start && (string)data["garea_middle"][i]["pref"]["pref_code"] != targetPrefCode)
                    {
                        break;
                    }
                }
                i++;
            }

            TableView.Source = dataSource;
        }
using Foundation;
using System;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using UIKit;
using CoreGraphics;

namespace SaitamaGourmet
{
	public partial class RestaurantListViewController : UIViewController
	{
		public AreaMasterMiddles targetAreaItem { get; set; }
		public List<Restaurants> restData { get; set; }
		DataSource dataSource;
		public string selectedCategory;

		public RestaurantListViewController(IntPtr handle) : base(handle)
		{
		}

		public void SetDetailItem(AreaMasterMiddles newTargetAreaItem)
		{
			if (targetAreaItem != null)
			{
				targetAreaItem = newTargetAreaItem;

				ConfigureView();
			}

		}

		void ConfigureView()
		{