Ejemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            var extras = Intent.Extras;

            if (extras != null)
            {
                //Get vars from bundle
                var sessionId = extras.GetInt("Id");
                cts.Cancel();
                //Get the Session Details
                session = Services.Session.GetSession(sessionId);
                SetToolbarColor(ListBaseAdapter.GetColor(session.Type.Length));
                UpdateFields();
                cts.Cancel();
            }
        }
Ejemplo n.º 2
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            var extras = Intent.Extras;

            if (extras != null)
            {
                //Get vars from bundle
                var workshopId = extras.GetInt("Id");

                cts.Cancel();
                //Get the Booking Details
                if (extras.GetBoolean("IsBooking"))
                {
                    session = await Services.Workshop.GetWorkshopFromBooking(workshopId);
                }
                else
                {
                    session  = Services.Workshop.GetWorkshop(workshopId);
                    HideEdit = true;
                }

                ListBaseAdapter.InitColors(Resources);
                SetToolbarColor(ListBaseAdapter.GetColor(session.WorkshopSetId));
                InitWorkshopComponents();
                UpdateFields();

                cts.Cancel();
                //Load booking information so the buttons can be updated
                //Get Local Data First, then update later
                await Task.Factory.StartNew(() => LoadBooking(true));

                if (!extras.GetBoolean("IsBooking"))
                {
                    isWaitlisted = await Services.Workshop.IsWaitlisted(session.Id);
                }

                //Do a background Sync now
                await Task.Factory.StartNew(() => LoadBooking(false, false));
            }
        }