示例#1
0
        public async Task cancel(WorkshopBooking workshop, Student student, string apiUri)
        {
            Dictionary <string, Object> parameters = new Dictionary <string, Object>();

            parameters.Add("workshopId", workshop.workshopID);
            parameters.Add("studentId", student.studentID);
            parameters.Add("userId", student.studentID);
            Response <Object> response = await db.post <Object>(apiUri + "cancel", parameters, null);

            if (!response.IsSuccess)
            {
                throw new BookingNotCancelled(response.DisplayMessage);
            }
        }
示例#2
0
        /// <summary>
        /// Called when a row is touched
        /// </summary>
        public async override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            if (myBookingDetailViewController == null)
            {
                myBookingDetailViewController = (MyBookingDetailViewController)AppDelegate.Storyboard.InstantiateViewController("MyBookingDetailViewController");
            }

            if (indexPath.Section == 0)
            {
                WorkshopBooking workshopBooking = workshopBookingList [indexPath.Row];
                //myBookingDetailViewController
                if (workshopBooking != null)
                {
                    LoadingOverlay.Instance.showLoading(myBookingViewController);
                    AppParam.campusName = await this.getCampusRoom(workshopBooking.campusID);

                    myBookingDetailViewController.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
                    myBookingDetailViewController.wkBooking            = workshopBooking;
                    myBookingDetailViewController.ssBooking            = null;
                    myBookingViewController.PresentViewController(myBookingDetailViewController, true, null);
                }
            }
            else
            {
                SessionBooking sessionBooking = sessionBookingList [indexPath.Row];
                //myBookingDetailViewController
                if (sessionBooking != null)
                {
                    myBookingDetailViewController.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
                    myBookingDetailViewController.wkBooking            = null;
                    myBookingDetailViewController.ssBooking            = sessionBooking;
                    myBookingViewController.PresentViewController(myBookingDetailViewController, true, null);
                }
            }
            //deselect row
            tableView.DeselectRow(indexPath, true);
        }
 public MyBookingDetailTableSource(WorkshopBooking workshopBooking, SessionBooking sessionBooking)
 {
     this.workshopBooking = workshopBooking;
     this.sessionBooking  = sessionBooking;
 }
示例#4
0
 public async Task cancelWaiting(WorkshopBooking workshop, Student student)
 {
     await cancel(workshop, student, apiWaitingUri);
 }