private void FetchCampusData() { WorkshopController workshopController = new WorkshopController(); campusData = (CampusData)workshopController.GetCampusData(); Constants.CAMPUSES = campusData.attributes; }
private async Task FetchAvailableWorkshops() { ShowProgressDialog(progressDialog, "Fetching available workshops. Please wait...", true); WorkshopController workshopController = new WorkshopController(); workshopData = await workshopController.searchWorkshops(DateTime.Now.ToString("yyyy-MM-dd HH:mm")); ShowProgressDialog(progressDialog, "Fetching available workshops. Please wait...", false); }
private void FetchWorkshopSetData() { WorkshopController workshopController = new WorkshopController(); WorkshopSetData workshopSetData = (WorkshopSetData)workshopController.GetWorkshopSetData(); Constants.WORKSHOP_SETS = workshopSetData.attributes; }
private async Task FetchWorkshopBookingData() { studentData = JsonConvert.DeserializeObject<StudentData>(Intent.GetStringExtra("student")); ShowProgressDialog(progressDialog, "Fetching bookings. Please wait...", true); WorkshopController workshopController = new WorkshopController(); workshopBookingData = await workshopController.GetWorkshopBookingData(studentData.attributes.studentID); Server.currentWorkshopBookingData = workshopBookingData; if (workshopBookingData != null && workshopBookingData.attributes.Count > 0) { FetchCampusData(); FetchWorkshopSetData(); } ShowProgressDialog(progressDialog, "Fetching bookings. Please wait...", false); }
private async Task Book() { // Code to book the workshop WorkshopController workshopController = new WorkshopController(); if (! await workshopController.Book(_Workshop.WorkshopId)) { //show error , stay on page; } else { //show dialog saying booked var SuccesDialog = new AlertDialog.Builder(this); SuccesDialog.SetMessage("You have successfully been booked!"); SuccesDialog.SetNeutralButton("OK", delegate { Finish(); }); SuccesDialog.Show(); } }
// Warns user that they will delete this booking and removes the booking if user presses okay private void CancelBooking() { AlertDialog.Builder cancelAlert = new AlertDialog.Builder(this); cancelAlert.SetTitle(GetString(Resource.String.cancelBooking)); cancelAlert.SetMessage(GetString(Resource.String.areYouSureCancel)); cancelAlert.SetPositiveButton("YES", delegate { if(_Booking.GetType() == typeof(SessionBooking)) { SessionController sessionController = new SessionController(); if (!sessionController.CancelSession(_Booking.ID())) { //show error, stay on page } else { //show dialog saying canceled var SuccesDialog = new AlertDialog.Builder(this); SuccesDialog.SetMessage("Booking has been Canceled!"); SuccesDialog.SetNeutralButton("OK", delegate { Finish(); }); SuccesDialog.Show(); if (bookingType.Equals("Session")) Server.sessionBookingsAltered = true; else Server.workshopBookingsAltered = true; } } else if (_Booking.GetType() == typeof(WorkshopBooking)) { // Code to cancel booking. WorkshopController workshopController = new WorkshopController(); if (!workshopController.CancelBooking(_Booking.ID())) { //show error, stay on page; } else { //show dialog saying cancled var SuccesDialog = new AlertDialog.Builder(this); SuccesDialog.SetMessage("Booking has been Canceled!"); SuccesDialog.SetNeutralButton("OK", delegate { Finish(); }); SuccesDialog.Show(); if (bookingType.Equals("Session")) Server.sessionBookingsAltered = true; else Server.workshopBookingsAltered = true; } } }); cancelAlert.SetNegativeButton("NO", delegate { }); cancelAlert.Show(); }
private async Task Waitlist() { WorkshopController workshopController = new WorkshopController(); await workshopController.Waitlist(_Workshop.WorkshopId); //show dialog saying canceled var SuccesDialog = new AlertDialog.Builder(this); SuccesDialog.SetMessage("You have successfully been waitlisted!"); SuccesDialog.SetNeutralButton("OK", delegate { Finish(); }); SuccesDialog.Show(); }