public Signature(List <guestSignature> guestSignature, guestSignature guestSignatureNumber) { InitializeComponent(); guestsignature = guestSignature; signature = Int32.Parse(guestSignatureNumber.guestNumber.ToString()); string name = Regex.Replace(guestSignatureNumber.guestName.ToString(), @"(?<=(^|[.;:])\s*)[a-z]", (match) => { return(match.Value.ToUpper()); }); GuestNameText.Text = "Dear " + name + " ! Please add your signature below."; SignatureLayout.IsVisible = false; }
public RegistrationCard() { initialPageLoading(); //Privacy statement //Signature Added MessagingCenter.Subscribe <Signature, List <guestSignature> >(this, Constants._signatureAddedMessage, (sender, arg) => { checkinAndSaveButton.IsVisible = true; if (Constants._reservationStatus == Constants._reservationStatusCheckedIn) { //saveSignatureButton.IsVisible = true;//false checkinButton.IsVisible = false; PerformaButton.IsVisible = true; } else { //saveSignatureButton.IsVisible = false;//false checkinButton.IsVisible = true; PerformaButton.IsVisible = false; } GuestSignatureList.ItemsSource = null; guestsignature = arg; GuestSignatureList.ItemsSource = guestsignature; //MessagingCenter.Unsubscribe<Signature, List<guestSignature>>(this, Constants._signatureAddedMessage); }); //Guest Edited MessagingCenter.Subscribe <GuestEdit, List <guestDetails> >(this, Constants._guestEdited, (sender, arg) => { GuestNameList.ItemsSource = null; guestdetails = arg; GuestNameList.ItemsSource = guestdetails; var obj = guestdetails.FirstOrDefault(x => x.guestNumber == Int32.Parse(Constants._guestNumber)); if (obj != null) { var obj1 = guestsignature.FirstOrDefault(x => x.guestNumber == Int32.Parse(Constants._guestNumber)); if (obj1 == null) { guestSignature newGuestSignature = new guestSignature("SignatureImage.jpg", obj.guestName, "Purple", obj.guestNumber, Constants._notAvailable, "White", ""); GuestSignatureList.ItemsSource = null; guestsignature.Add(newGuestSignature); GuestSignatureList.ItemsSource = guestsignature; GuestSignatureView.HeightRequest = 40 + (157 * guestsignature.Count); } else { obj1.guestName = obj.guestName; obj1.guestNumber = obj.guestNumber; GuestSignatureList.ItemsSource = null; GuestSignatureList.ItemsSource = guestsignature; } if (obj.guestNumber == 1) { string title = obj.salutation; //List of salutations from dictiona var nameToSalutation = CountryDictionary.listofSalutation(); if (title != "" || title != "") { //Item Value in dictionar string name = nameToSalutation.FirstOrDefault(x => x.Value == title).Key; titleName.Text = name; titleName.TextColor = serviceDataValidation.validationColor(name); } fname.Text = serviceDataValidation.validation(obj.guestFirstName); fname.TextColor = serviceDataValidation.validationColor(obj.guestFirstName); lname.Text = serviceDataValidation.validation(obj.guestLastName); lname.TextColor = serviceDataValidation.validationColor(obj.guestLastName); emailaddress.Text = serviceDataValidation.validation(obj.email); emailaddress.TextColor = serviceDataValidation.validationColor(obj.email); ContactNumber.Text = serviceDataValidation.validation(obj.contactNumber); ContactNumber.TextColor = serviceDataValidation.validationColor(obj.contactNumber); dob.Text = serviceDataValidation.validation(obj.dateOfBirth); dob.TextColor = serviceDataValidation.validationColor(obj.dateOfBirth); NICPASS.Text = serviceDataValidation.validation(obj.passportIdNumber); NICPASS.TextColor = serviceDataValidation.validationColor(obj.passportIdNumber); houseno.Text = serviceDataValidation.validation(obj.houseNumber); houseno.TextColor = serviceDataValidation.validationColor(obj.houseNumber); street.Text = serviceDataValidation.validation(obj.street); street.TextColor = serviceDataValidation.validationColor(obj.street); city.Text = serviceDataValidation.validation(obj.city); city.TextColor = serviceDataValidation.validationColor(obj.city); country.Text = serviceDataValidation.validation(serviceDataValidation.titleCountry(obj.country)); country.TextColor = serviceDataValidation.validationColor(obj.country); nationality.Text = serviceDataValidation.validation(serviceDataValidation.titleNationality(obj.nationality)); nationality.TextColor = serviceDataValidation.validationColor(obj.nationality); } } //MessagingCenter.Unsubscribe<GuestEdit, List<guestDetails>>(this, Constants._guestEdited); }); //Signature Saved MessagingCenter.Subscribe <RegistrationCard, string>(this, Constants._signatureSuccessfullySaved, (sender, arg) => { //checkinAndSaveButton.IsVisible = false;//false stopPageLoading(); MessagingCenter.Unsubscribe <RegistrationCard, string>(this, Constants._signatureSuccessfullySaved); }); //Checked-In MessagingCenter.Subscribe <RegistrationCard, string>(this, Constants._reservationStatusCheckedIn, (sender, arg) => { //checkinAndSaveButton.IsVisible = false;//false Device.BeginInvokeOnMainThread(() => { checkinButton.IsVisible = false; }); checkinButton.IsVisible = false; stopPageLoading(); MessagingCenter.Unsubscribe <RegistrationCard, string>(this, Constants._reservationStatusCheckedIn); }); }