Example #1
0
 void Start()
 {
     request = new ClassRequest(Constantes.urlApi + Constantes.uriGetAvailableVehicles + PlayerPrefs.GetString("usageStart") + "/" + PlayerPrefs.GetString("usageEnd"));
     Debug.Log(Constantes.urlApi + Constantes.uriGetAvailableVehicles + PlayerPrefs.GetString("usageStart") + "/" + PlayerPrefs.GetString("usageEnd"));
     StartCoroutine(request.GetRequest(initList));
     ListView.verticalNormalizedPosition = 1;
 }
Example #2
0
        private IEnumerator UserLogin(Action <bool, string> Callback)
        {
            Debug.Log(Constantes.urlApi + Constantes.uriGetUserByEmail + email.text);
            ClassRequest getUser = new ClassRequest(Constantes.urlApi + Constantes.uriGetUserByEmail + email.text);

            yield return(getUser.GetRequest(Debug.Log));

            ClassRequest testConn = new ClassRequest(Constantes.urlApi + Constantes.uriConnect, curUser.ToJson());

            yield return(testConn.PostRequest(Debug.Log));

            curUser.password = null;
            Debug.Log(getUser.json);
            curUser       = JsonUtility.FromJson <User>(getUser.json);
            curUser.token = JsonUtility.FromJson <Token>(testConn.json);
            Debug.Log(curUser._id);
            if (curUser.token is null)
            {
                Callback(false, "Identifiants incorrects");
            }
            else
            {
                Callback(true, curUser.ToJson());
            }
        }
Example #3
0
 public void UpdateDropdown()
 {
     request = new ClassRequest(Constantes.urlApi + Constantes.uriGetAvailableVehicles + start.date.ToString("yyyy-MM-dd hh:mm") + "/" + end.date.ToString("yyyy-MM-dd hh:mm"));
     StartCoroutine(request.GetRequest(PopulateDropdown));
 }
Example #4
0
 // Start is called before the first frame update
 void Start()
 {
     request = new ClassRequest(Constantes.urlApi + Constantes.uriGetUsagesFutur);
     StartCoroutine(request.GetRequest(initList));
     ListView.verticalNormalizedPosition = 1;
 }