Exemplo n.º 1
0
		public async Task startTrip(String boatId)
		{
			String sessionCookie = await login(hc);

            ongoingTrip = new TripInfo{ startTime = DateTime.Now };

			var content = new ContentForRequest {
				RowerID = rowerId,
				BoatID = boatId,
			}.build (sessionCookie);

			var response = await hc.PostAsync ("http://www.rokort.dk/workshop/row_update.php", content);

			Console.WriteLine ("Turen er startet, http status " + response.StatusCode + ", response " + await response.Content.ReadAsStringAsync ());
		}
Exemplo n.º 2
0
        public async Task stopTrip (int distance)
		{
			String sessionCookie = await login(hc);

            await fetchTripInfo (sessionCookie);

			var content = new ContentForRequest {
				ID = ongoingTrip.id,
                RowerID = rowerId,
                BoatID = ongoingTrip.boatID,
				xStart = ongoingTrip.startTime,
				xEnd = null,
				EndDateTime = DateTime.Now,
				Distance = distance+"",
				Completed = "1",
			}.build (sessionCookie);

			var response = await hc.PostAsync ("http://www.rokort.dk/workshop/row_update.php", content);

			Console.WriteLine ("Turen er stoppet, http status " + response.StatusCode + ", response " + await response.Content.ReadAsStringAsync ());
		}