//		Dictionary<string, WorkshopBooking> dictGroupCurr = new Dictionary<string, WorkshopBooking> ();
//		Dictionary<string, WorkshopBooking> dictGroupPast = new Dictionary<string, WorkshopBooking> ();
//		List<string> lstKeysCurr = new List<string> ();
//		List<string> lstKeysPast = new List<string> ();

		protected override async void OnCreate (Bundle bundle)
		{
			try
			{
				base.OnCreate (bundle);
				SetContentView(Resource.Layout.TabsLayout);

				ActionBar.SetHomeButtonEnabled(true);
				ActionBar.SetDisplayHomeAsUpEnabled(true);

				if (ProgressDialogLogin == null)
				{
					ProgressDialogLogin = ProgressDialog.Show(this, "", "Loading...");
				}

				Globals.StuBookings = await RESTClass.GetWorkshopBookings(String.Format("?active=true&studentId={0}", Globals.LoggedStudent.studentID));

				FragmentTransaction transaction = FragmentManager.BeginTransaction();
				ViewBookingsFragment sltFragment = new ViewBookingsFragment();
				transaction.Replace(Resource.Id.flTabs, sltFragment);
				transaction.Commit();

				if (ProgressDialogLogin != null)
				{
					ProgressDialogLogin.Dismiss();
					ProgressDialogLogin = null;
				}
			}
			catch (Exception e)
			{
				new AlertDialog.Builder (this)
					.SetMessage(e.Message + "\n" + e.StackTrace)
					.SetTitle("Application Error")
					.Show();
			}
			finally
			{
				if (ProgressDialogLogin != null)
				{
					ProgressDialogLogin.Dismiss();
					ProgressDialogLogin = null;
				}
			}
		}
Beispiel #2
0
//		Dictionary<string, WorkshopBooking> dictGroupCurr = new Dictionary<string, WorkshopBooking> ();
//		Dictionary<string, WorkshopBooking> dictGroupPast = new Dictionary<string, WorkshopBooking> ();
//		List<string> lstKeysCurr = new List<string> ();
//		List<string> lstKeysPast = new List<string> ();

        protected override async void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.TabsLayout);

                ActionBar.SetHomeButtonEnabled(true);
                ActionBar.SetDisplayHomeAsUpEnabled(true);

                if (ProgressDialogLogin == null)
                {
                    ProgressDialogLogin = ProgressDialog.Show(this, "", "Loading...");
                }

                Globals.StuBookings = await RESTClass.GetWorkshopBookings(String.Format("?active=true&studentId={0}", Globals.LoggedStudent.studentID));

                FragmentTransaction  transaction = FragmentManager.BeginTransaction();
                ViewBookingsFragment sltFragment = new ViewBookingsFragment();
                transaction.Replace(Resource.Id.flTabs, sltFragment);
                transaction.Commit();

                if (ProgressDialogLogin != null)
                {
                    ProgressDialogLogin.Dismiss();
                    ProgressDialogLogin = null;
                }
            }
            catch (Exception e)
            {
                new AlertDialog.Builder(this)
                .SetMessage(e.Message + "\n" + e.StackTrace)
                .SetTitle("Application Error")
                .Show();
            }
            finally
            {
                if (ProgressDialogLogin != null)
                {
                    ProgressDialogLogin.Dismiss();
                    ProgressDialogLogin = null;
                }
            }
        }