示例#1
0
 // Use this for initialization
 void Start()
 {
     location = new Location_DAO();
     resuilt  = location.getAllLocations();
     for (int i = 0; i < resuilt.Rows.Count; i++)
     {
         lbCity.GetComponent <UIPopupList>().items.Add(resuilt[i]["Name"].ToString());
     }
     EventDelegate.Add(lbCity.GetComponent <UIPopupList>().onChange,
                       () =>
     {
         Debug.Log(lbCity.GetComponent <UIPopupList>().value);
         Location = lbCity.GetComponent <UIPopupList>().value;
     });
 }
示例#2
0
    // Use this for initialization

    public void Innit()
    {
        Debug.Log("Start Innit");
        crrStation     = new Stations();
        TxtStation     = GameObject.Find("txtStationID/Label");
        TxtStationName = GameObject.Find("txtStationName/Label");

        CbUnderground = GameObject.Find("Underground");
        CbRail        = GameObject.Find("Rail");
        CbDlr         = GameObject.Find("DLR");
        LbLocation    = GameObject.Find("lbLocation");

        CbWifi        = GameObject.Find("Wifi");
        CbToilets     = GameObject.Find("Toilets");
        CbTrolleys    = GameObject.Find("Trolleys");
        CbRefesh      = GameObject.Find("Refesh");
        CbAtm         = GameObject.Find("ATM");
        CbPhone       = GameObject.Find("Phone");
        BtnAddStation = GameObject.Find("btnAddStation");


        Debug.Log("DAO Innit");
        stationDAO  = new Stations_DAO();
        locationDAO = new Location_DAO();

        Debug.Log("Data Innit");
        TxtStation.GetComponent <UILabel>().text = (stationDAO.getMaxStaID() + 1).ToString();


        Debug.Log("Fill Data Innit");
        resuilt = locationDAO.getAllLocations();
        for (int i = 0; i < resuilt.Rows.Count; i++)
        {
            LbLocation.GetComponent <UIPopupList>().items.Add(resuilt[i]["Name"].ToString());
        }

        Debug.Log("Event Innit");
        EventDelegate.Add(LbLocation.GetComponent <UIPopupList>().onChange,
                          () =>
        {
            Debug.Log(LbLocation.GetComponent <UIPopupList>().value);
            Location = LbLocation.GetComponent <UIPopupList>().value;
        });

        EventDelegate.Add(BtnAddStation.GetComponent <UIButton>().onClick, BtnClickAddNewStation);

        Debug.Log("End Innit");
    }