Esempio n. 1
0
        //Signature save clicked
        async void saveSignature(object sender, EventArgs e)
        {
            string result = "";

            //get details where image is available
            var signatureAddedGuests = guestsignature.Where(x => x.imageAvailability == "").ToList();

            pageLoading();
            //Loop All images
            foreach (guestSignature sigAddedGuestDetails in signatureAddedGuests)
            {
                if (sigAddedGuestDetails.base64String != "")
                {
                    //Data service
                    var postServiceManager = new PostServiceManager();

                    //Add details to payload
                    var statusChangedCheckin = new StatusChangeCheckin(Constants._reservation_id, Constants._hotel_code, sigAddedGuestDetails.guestNumber.ToString(), sigAddedGuestDetails.base64String, "T", "Checkin App");

                    result = await postServiceManager.StatusChangecheckinAsync(statusChangedCheckin);
                }
                Constants._base64Code = "";
                Constants._notAvailableSignatureAdded = false;
            }
            if (result == "Checked-In Successfully!")
            {
                await DisplayAlert(Constants._headerMessage, Constants._signatureSuccessfullySaved, Constants._buttonOkay);

                //Signatuers saved
                MessagingCenter.Send <RegistrationCard, string>(this, Constants._signatureSuccessfullySaved, "");
            }
            else
            {
                await DisplayAlert(Constants._headerMessage, result, Constants._buttonOkay);
            }
        }
Esempio n. 2
0
        //Checking button clicked
        async void reservationCheckin(object sender, EventArgs e)

        {
            //Asssigned Room Inspected
            if (Constants._roomStatus == Constants._inspectedRoom)
            {
                string result = "";
                //get sigatures with image availability
                var signatureAddedGuests = guestsignature.Where(x => x.imageAvailability == "").ToList();
                pageLoading();
                string IntiailGuestDetail = "F";
                //Loop All available images
                foreach (guestSignature sigAddedGuestDetails in signatureAddedGuests)
                {
                    if (sigAddedGuestDetails.base64String != "")
                    {
                        //Data source
                        var postServiceManager = new PostServiceManager();

                        //Add details to Payload
                        StatusChangeCheckin statusChangedCheckin = new StatusChangeCheckin(Constants._reservation_id, Constants._hotel_code, sigAddedGuestDetails.guestNumber.ToString(), sigAddedGuestDetails.base64String, IntiailGuestDetail, "Checkin App");

                        result = await postServiceManager.StatusChangecheckinAsync(statusChangedCheckin);
                    }

                    Constants._base64Code = "";
                    IntiailGuestDetail    = "T";
                }

                //save signature if already saved signature
                if (signatureAddedGuests.Count < 1)
                {
                    var postServiceManager = new PostServiceManager();

                    string resSigns = await checkInManager.GetGuestSignature("1");

                    var outputSign         = JObject.Parse(resSigns);
                    var retrivedSignBase64 = Convert.ToString(outputSign["d"]["XIMAGE"]);

                    if (retrivedSignBase64 != null)
                    {
                        IntiailGuestDetail = "F";
                        StatusChangeCheckin statusChangedCheckin = new StatusChangeCheckin(Constants._reservation_id, Constants._hotel_code, "1", retrivedSignBase64, IntiailGuestDetail, "Checkin App");
                        result = await postServiceManager.StatusChangecheckinAsync(statusChangedCheckin);
                    }
                    IntiailGuestDetail = "T";
                }


                //await DisplayAlert(Constants._headerMessage, result, Constants._buttonOkay);

                if (result == "Checked-In Successfully!")
                {
                    Constants._reservationStatus          = Constants._reservationStatusCheckedIn;
                    Constants._notAvailableSignatureAdded = false;

                    //Save usage time to API
                    var apires = await APIPostService.SaveTimeTrackToAPI();

                    Debug.WriteLine("API Res " + apires);

                    await DisplayAlert(Constants._headerMessage, result, Constants._buttonOkay);

                    //Checked in
                    MessagingCenter.Send <RegistrationCard, string>(this, Constants._reservationStatusCheckedIn, Constants._reservationStatus);
                }
                else
                {
                    await DisplayAlert(Constants._headerMessage, result, Constants._buttonOkay);
                }

                stopPageLoading();
            }
            else
            {
                await DisplayAlert(Constants._headerMessage, Constants._checkinInspectedValidation, Constants._buttonOkay);
            }
        }