private void BtnClickSaveCouponData_Click(object sender, EventArgs e)
        {
            //Serial number
            EditText edtSerialNumberCoupon = FindViewById <EditText>(Resource.Id.serinumberCoupon);
            string   serialNumber          = edtSerialNumberCoupon.Text.Trim().ToString();

            if (TextUtils.IsEmpty(serialNumber))
            {
                Toast.MakeText(this, "Serialnumber can't be empty.", ToastLength.Long).Show();
                return;
            }

            //Organization id
            EditText edtOrganizationIdCoupon = FindViewById <EditText>(Resource.Id.cardNumberCoupon);
            string   organizationId          = edtOrganizationIdCoupon.Text.Trim().ToString();

            if (TextUtils.IsEmpty(organizationId))
            {
                Toast.MakeText(this, "Cardnumber can't be empty.", ToastLength.Long).Show();
                return;
            }

            //Style id
            EditText edtPassStyleIdentifierCoupon = FindViewById <EditText>(Resource.Id.passStyleIdentifierCoupon);
            string   styleId = edtPassStyleIdentifierCoupon.Text.Trim().ToString();

            if (TextUtils.IsEmpty(styleId))
            {
                Toast.MakeText(this, "Template ID can't be empty.", ToastLength.Long).Show();
                return;
            }

            //Pass type id
            EditText edtPassType = FindViewById <EditText>(Resource.Id.typeIdentifierCoupon);
            string   typeId      = edtPassType.Text.Trim().ToString();

            if (TextUtils.IsEmpty(typeId))
            {
                Toast.MakeText(this, "Pass type can't be empty.", ToastLength.Long).Show();
                return;
            }

            //Issuer id.
            EditText edtIssuerId = FindViewById <EditText>(Resource.Id.issuerIdCoupon);
            string   issuerId    = edtIssuerId.Text.Trim().ToString();

            if (TextUtils.IsEmpty(issuerId))
            {
                Toast.MakeText(this, "Issuer id can't be empty.", ToastLength.Long).Show();
                return;
            }

            EditText edtBackgroundColor = FindViewById <EditText>(Resource.Id.backgroundColorCoupon);
            EditText edtLogoCoupon      = FindViewById <EditText>(Resource.Id.logoCoupon);

            //Merchant name
            EditText edtMerchantNameCoupon = FindViewById <EditText>(Resource.Id.merchantNameCoupon);
            string   merchantName          = edtMerchantNameCoupon.Text.Trim().ToString();

            if (TextUtils.IsEmpty(merchantName))
            {
                Toast.MakeText(this, "Merchant name can't be empty.", ToastLength.Long).Show();
                return;
            }

            //Coupon title
            EditText edtNameCoupon = FindViewById <EditText>(Resource.Id.nameCoupon);
            string   name          = edtNameCoupon.Text.Trim().ToString();

            if (TextUtils.IsEmpty(name))
            {
                Toast.MakeText(this, "Coupon title can't be empty.", ToastLength.Long).Show();
                return;
            }

            //State
            string state = WalletPassConstant.PassStateActive;

            switch (dataList[index])
            {
            case "ACTIVE":
                state = WalletPassConstant.PassStateActive;
                break;

            case "COMPLETED":
                state = WalletPassConstant.PassStateCompleted;
                break;

            case "EXPIRED":
                state = WalletPassConstant.PassStateExpired;
                break;

            case "INACTIVE":
                state = WalletPassConstant.PassStateInactive;
                break;

            default:
                break;
            }

            //Time check
            long start = 0;
            long end   = 0;
            Date date  = new Date();

            if (TextUtils.IsEmpty(startTime))
            {
                Toast.MakeText(this, "Please select StartTime.", ToastLength.Long).Show();
                return;
            }
            else
            {
                start = BasisTimesUtils.GetLongtimeOfYMD(startTime);
            }

            if (TextUtils.IsEmpty(endTime))
            {
                Toast.MakeText(this, "Please select EndTime", ToastLength.Long).Show();
                return;
            }
            else
            {
                end = BasisTimesUtils.GetLongtimeOfYMD(endTime);
            }

            if (end <= start || end <= date.Time)
            {
                Toast.MakeText(this, "Please check (EndTime > StartTime) && (EndTime > CurrentTime)", ToastLength.Long).Show();
                return;
            }

            //Provider name
            EditText edtMerchantProviderCoupon = FindViewById <EditText>(Resource.Id.merchantProvidesCoupon);
            string   providesCoupon            = edtMerchantProviderCoupon.Text.ToString();

            if (TextUtils.IsEmpty(providesCoupon))
            {
                Toast.MakeText(this, "ProvidesName can't be empty.", ToastLength.Long).Show();
                return;
            }

            //Bar code
            EditText edtPassBarcode      = FindViewById <EditText>(Resource.Id.barcodeTextCoupon);
            EditText edtPassBarcodeValue = FindViewById <EditText>(Resource.Id.barcodeValueCoupon);

            //Details
            EditText edtDetailsCoupon = FindViewById <EditText>(Resource.Id.DetailsCoupon);

            //ImageUris
            EditText edtImageModuleDataMainImageUrisCoupon        = FindViewById <EditText>(Resource.Id.imageModuleDataMainImageUrisCoupon);
            EditText edtImageModuleDataMainImageUrisDescCoupon    = FindViewById <EditText>(Resource.Id.imageModuleDataMainImageUrisDesCoupon);
            EditText edtImageModuleDataMainImageUrisCouponOne     = FindViewById <EditText>(Resource.Id.imageModuleDataMainImageUrisCoupon1);
            EditText edtImageModuleDataMainImageUrisDescCouponOne = FindViewById <EditText>(Resource.Id.imageModuleDataMainImageUrisDesCoupon1);

            string imageUris    = edtImageModuleDataMainImageUrisCoupon.Text.Trim().ToString();
            string imageDesc    = edtImageModuleDataMainImageUrisDescCoupon.Text.Trim().ToString();
            string imageUrisOne = edtImageModuleDataMainImageUrisCouponOne.Text.Trim().ToString();
            string imageDescOne = edtImageModuleDataMainImageUrisDescCouponOne.Text.Trim().ToString();

            //DisclaimerCoupon
            EditText edtDisclaimerCoupon = FindViewById <EditText>(Resource.Id.disclaimerCoupon);

            //Message
            EditText edtMessageHeaderCoupon    = FindViewById <EditText>(Resource.Id.messageHeaderCoupon);
            EditText edtMessageBodyCoupon      = FindViewById <EditText>(Resource.Id.messageBodyCoupon);
            EditText edtMessageHeaderCouponOne = FindViewById <EditText>(Resource.Id.messageHeaderCoupon1);
            EditText edtMessageBodyCouponOne   = FindViewById <EditText>(Resource.Id.messageBodyCoupon1);

            string messageHeader    = edtMessageHeaderCoupon.Text.Trim().ToString();
            string messageBody      = edtMessageBodyCoupon.Text.Trim().ToString();
            string messageHeaderOne = edtMessageHeaderCouponOne.Text.Trim().ToString();
            string messageBodyOne   = edtMessageBodyCouponOne.Text.Trim().ToString();

            PassObject.Builder passBuilder = PassObject.GetBuilder();
            //Common fields
            List <CommonField> commonFields = new List <CommonField>();
            //Append fields
            List <AppendField> appendFields = new List <AppendField>();

            //1 Background color of the outer frame.
            CommonField backgroundColorCommonField = CommonField.GetBuilder()
                                                     .SetKey(WalletPassConstant.PassAppendFieldKeyBackgroundColor)
                                                     .SetLabel("Background color label")
                                                     .SetValue(edtBackgroundColor.Text.Trim().ToString())
                                                     .Build();

            commonFields.Add(backgroundColorCommonField);

            //3 Logo on the coupon.
            CommonField logoCommonField = CommonField.GetBuilder()
                                          .SetKey(WalletPassConstant.PassCommonFieldKeyLogo)
                                          .SetLabel("This is logo label")
                                          .SetValue(edtLogoCoupon.Text.Trim().ToString())
                                          .Build();

            commonFields.Add(logoCommonField);

            //4 Merchant name
            CommonField merchantNameCommonField = CommonField.GetBuilder()
                                                  .SetKey(WalletPassConstant.PassCommonFieldKeyMerchantName)
                                                  .SetLabel("This is merchant name label")
                                                  .SetValue(merchantName)
                                                  .Build();

            commonFields.Add(merchantNameCommonField);

            //5 Coupon title
            CommonField couponTitleCommonField = CommonField.GetBuilder()
                                                 .SetKey(WalletPassConstant.PassCommonFieldKeyName)
                                                 .SetLabel("This is Coupon title label")
                                                 .SetValue(name)
                                                 .Build();

            commonFields.Add(couponTitleCommonField);

            //6 Expiration time
            //Simple date format.
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");

            passBuilder.SetStatus(PassStatus.GetBuilder().SetState(state).SetEffectTime(format.Format(new Date(start))).SetExpireTime(format.Format(new Date(end))).Build());

            //7 Merchant that provides the coupon
            AppendField merchantProvidesAppendField = AppendField.GetBuilder()
                                                      .SetKey(WalletPassConstant.PassCommonFieldKeyProviderName)
                                                      .SetLabel("This is merchant provider label")
                                                      .SetValue(providesCoupon)
                                                      .Build();

            appendFields.Add(merchantProvidesAppendField);

            //8 Barcode or QR code
            //9 Remarks
            BarCode barCode = BarCode.GetBuilder()
                              .SetType(BarCode.BarcodeTypeQrCode)
                              .SetValue(edtPassBarcodeValue.Text.Trim().ToString())
                              .SetText(edtPassBarcode.Text.Trim().ToString())
                              .Build();

            passBuilder.SetBarCode(barCode);

            //10 Details
            AppendField detailsAppendField = AppendField.GetBuilder()
                                             .SetKey(WalletPassConstant.PassAppendFieldKeyDetails)
                                             .SetLabel("This is details label")
                                             .SetValue(edtDetailsCoupon.Text.Trim().ToString())
                                             .Build();

            appendFields.Add(detailsAppendField);

            //11 Scrolling images
            List <AppendField> imageList = new List <AppendField>();

            imageList.Add(AppendField.GetBuilder()
                          .SetKey("1")
                          .SetLabel(imageDesc)
                          .SetValue(imageUris)
                          .Build());
            imageList.Add(AppendField.GetBuilder()
                          .SetKey("2")
                          .SetLabel(imageDescOne)
                          .SetValue(imageUrisOne)
                          .Build());
            passBuilder.AddImageList(imageList);

            //Urllist
            EditText edtCouponUrlLabel    = FindViewById <EditText>(Resource.Id.couponUrlLable);
            EditText edtCouponUrlValue    = FindViewById <EditText>(Resource.Id.couponUrlValue);
            EditText edtCouponUrlLabelOne = FindViewById <EditText>(Resource.Id.couponUrlLable1);
            EditText edtCouponUrlValueOne = FindViewById <EditText>(Resource.Id.couponUrlValue1);

            List <AppendField> urlList = new List <AppendField>();

            urlList.Add(AppendField.GetBuilder()
                        .SetKey("1")
                        .SetLabel(edtCouponUrlLabel.Text.Trim().ToString())
                        .SetValue(edtCouponUrlValue.Text.Trim().ToString())
                        .Build());
            urlList.Add(AppendField.GetBuilder()
                        .SetKey("2")
                        .SetLabel(edtCouponUrlLabelOne.Text.Trim().ToString())
                        .SetValue(edtCouponUrlValueOne.Text.Trim().ToString())
                        .Build());
            passBuilder.AddUrlList(urlList);

            //12 Disclaimer
            AppendField disclaimerAppendField = AppendField.GetBuilder()
                                                .SetKey(WalletPassConstant.PassAppendFieldKeyDisclaimer)
                                                .SetLabel("This is Disclaimer label")
                                                .SetValue(edtDisclaimerCoupon.Text.Trim().ToString())
                                                .Build();

            appendFields.Add(disclaimerAppendField);

            //13 Message
            List <AppendField> messageList = new List <AppendField>();

            messageList.Add(AppendField.GetBuilder()
                            .SetKey("1")
                            .SetLabel(messageHeader)
                            .SetValue(messageBody)
                            .Build());
            messageList.Add(AppendField.GetBuilder()
                            .SetKey("2")
                            .SetLabel(messageHeaderOne)
                            .SetValue(messageBodyOne)
                            .Build());
            passBuilder.AddMessageList(messageList);

            passBuilder.SetOrganizationPassId(organizationId);
            passBuilder.SetPassStyleIdentifier(styleId);
            passBuilder.SetPassTypeIdentifier(typeId);
            passBuilder.SetSerialNumber(serialNumber);
            passBuilder.AddAppendFields(appendFields);
            passBuilder.AddCommonFields(commonFields);

            PassObject passObject = passBuilder.Build();
            Intent     intent     = new Intent(this, typeof(PassTestActivity));

            intent.PutExtra("passObject", passObject.ToJson());
            intent.PutExtra("passId", organizationId);
            intent.PutExtra("issuerId", issuerId);
            intent.PutExtra("typeId", typeId);
            StartActivity(intent);
        }
        private void BtnClickSaveGiftData_Click(object sender, EventArgs e)
        {
            //Pass style identifier.
            EditText edtPassStyleIdentifierGift = FindViewById <EditText>(Resource.Id.passStyleIdentifierGift);
            string   styleId = edtPassStyleIdentifierGift.Text.Trim().ToString();

            if (TextUtils.IsEmpty(styleId))
            {
                Toast.MakeText(this, "Template Id cant be empty.", ToastLength.Long).Show();
                return;
            }

            //Construct gift card data.
            PassObject.Builder passBuilder = PassObject.GetBuilder();

            //Common fields.
            List <CommonField> commonFields = new List <CommonField>();
            //Append fields.
            List <AppendField> appendFields = new List <AppendField>();

            //Background and description
            EditText edtBackgroundColor     = FindViewById <EditText>(Resource.Id.giftBackGroundImage);
            EditText edtBackgroundColorDesc = FindViewById <EditText>(Resource.Id.giftBackGroundImageDesc);

            //1 Background image of the card.
            CommonField backgroundImageCommonField = CommonField.GetBuilder()
                                                     .SetKey(WalletPassConstant.PassCommonFieldKeyBackgroundImg)
                                                     .SetLabel(edtBackgroundColorDesc.Text.Trim().ToString())
                                                     .SetValue(edtBackgroundColor.Text.Trim().ToString())
                                                     .Build();

            commonFields.Add(backgroundImageCommonField);

            //2 Logo on the card
            //Logo
            EditText    edtGiftCardLogo = FindViewById <EditText>(Resource.Id.giftCardLogo);
            CommonField logoCommonField = CommonField.GetBuilder()
                                          .SetKey(WalletPassConstant.PassCommonFieldKeyLogo)
                                          .SetLabel("This is logo label")
                                          .SetValue(edtGiftCardLogo.Text.Trim().ToString())
                                          .Build();

            commonFields.Add(logoCommonField);

            //3 Merchant name
            EditText edtMerchantName = FindViewById <EditText>(Resource.Id.giftMerchantName);

            CommonField merchantNameCommonField = CommonField.GetBuilder()
                                                  .SetKey(WalletPassConstant.PassCommonFieldKeyMerchantName)
                                                  .SetLabel("This is Merchant Name label")
                                                  .SetValue(edtMerchantName.Text.Trim().ToString())
                                                  .Build();

            commonFields.Add(merchantNameCommonField);

            //4 Card name
            EditText    edtGiftCardname     = FindViewById <EditText>(Resource.Id.giftCardname);
            CommonField cardNameCommonField = CommonField.GetBuilder()
                                              .SetKey(WalletPassConstant.PassCommonFieldKeyName)
                                              .SetLabel("This is Card name label")
                                              .SetValue(edtGiftCardname.Text.Trim().ToString())
                                              .Build();

            commonFields.Add(cardNameCommonField);

            //5 Card number
            EditText edtGiftCardNumber = FindViewById <EditText>(Resource.Id.giftCardNumber);
            string   giftCardNumber    = edtGiftCardNumber.Text.Trim().ToString();

            if (TextUtils.IsEmpty(giftCardNumber))
            {
                Toast.MakeText(this, "Card number can't be empty.", ToastLength.Long).Show();
                return;
            }
            CommonField cardNumberCommonField = CommonField.GetBuilder()
                                                .SetKey(WalletPassConstant.PassCommonFieldKeyCardNumber)
                                                .SetLabel("This is CardNumber label")
                                                .SetValue(giftCardNumber)
                                                .Build();

            commonFields.Add(cardNumberCommonField);

            //6 Balance
            EditText    edtGiftBalance     = FindViewById <EditText>(Resource.Id.giftBalance);
            CommonField balanceCommonField = CommonField.GetBuilder()
                                             .SetKey(WalletPassConstant.PassCommonFieldKeyBalance)
                                             .SetLabel("This is balance label")
                                             .SetValue(edtGiftBalance.Text.Trim().ToString())
                                             .Build();

            commonFields.Add(balanceCommonField);

            //Gift currrency
            EditText edtGiftCurrency = FindViewById <EditText>(Resource.Id.giftCurrency);

            passBuilder.SetCurrencyCode(edtGiftCurrency.Text.Trim().ToString());

            //7 Barcode or Qrcode
            EditText edtPassBarcodeAlternate = FindViewById <EditText>(Resource.Id.passBarcodeAlternateText);
            string   barType             = BarCode.BarcodeTypeQrCode;
            EditText edtPassBarcodeValue = FindViewById <EditText>(Resource.Id.passBarcodeValue);

            switch (barcodeStyleList[barcodeStyleIndex])
            {
            case "Codabar":
                barType = BarCode.BarcodeTypeCodabar;
                break;

            case "QrCode":
                barType = BarCode.BarcodeTypeQrCode;
                break;

            default:
                break;
            }

            BarCode barCode = BarCode.GetBuilder()
                              .SetType(barType)
                              .SetValue(edtPassBarcodeValue.Text.Trim().ToString())
                              .SetText(edtPassBarcodeAlternate.Text.Trim().ToString())
                              .Build();

            passBuilder.SetBarCode(barCode);

            //9 Balance update time
            // balance update time
            long update = 0;

            if (TextUtils.IsEmpty(updateTime))
            {
                Toast.MakeText(this, "Please select balance updateTime", ToastLength.Long).Show();
                return;
            }
            else
            {
                update = BasisTimesUtils.GetLongtimeOfYMD(updateTime);
            }

            //Simple date format
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
            // Create SimpleDateFormat
            string      updateTimeValue = format.Format(new Java.Util.Date(update));
            CommonField balanceUpdateTimeAppendfield = CommonField.GetBuilder()
                                                       .SetKey(WalletPassConstant.PassCommonFieldKeyBalanceRefreshTime)
                                                       .SetLabel("Updated")
                                                       .SetValue(updateTimeValue)
                                                       .Build();

            commonFields.Add(balanceUpdateTimeAppendfield);

            //10 Pin
            EditText    edtGiftCardPin = FindViewById <EditText>(Resource.Id.giftCardPin);
            CommonField pinCommonField = CommonField.GetBuilder()
                                         .SetKey(WalletPassConstant.PassCommonFieldKeyBlancePin)
                                         .SetLabel("PIN Number")
                                         .SetValue(edtGiftCardPin.Text.ToString())
                                         .Build();

            commonFields.Add(pinCommonField);

            //11 Event number
            EditText    edtGiftEventNumber     = FindViewById <EditText>(Resource.Id.giftEventNumber);
            AppendField eventNumberAppendField = AppendField.GetBuilder()
                                                 .SetKey(WalletPassConstant.PassAppendFieldKeyEventNumber)
                                                 .SetLabel("Event Number")
                                                 .SetValue(edtGiftEventNumber.Text.Trim().ToString())
                                                 .Build();

            appendFields.Add(eventNumberAppendField);

            //12 Message
            //message
            EditText edtMessageHeaderGift    = FindViewById <EditText>(Resource.Id.messageHeaderGift);
            EditText edtMessageBodyGift      = FindViewById <EditText>(Resource.Id.messageBodyGift);
            EditText edtMessageHeaderGiftOne = FindViewById <EditText>(Resource.Id.messageHeaderGift1);
            EditText edtMessageBodyGiftOne   = FindViewById <EditText>(Resource.Id.messageBodyGift1);

            List <AppendField> messageList = new List <AppendField>();

            messageList.Add(AppendField.GetBuilder()
                            .SetKey("1")
                            .SetLabel(edtMessageHeaderGift.Text.Trim().ToString())
                            .SetValue(edtMessageBodyGift.Text.Trim().ToString())
                            .Build());
            messageList.Add(AppendField.GetBuilder()
                            .SetKey("2")
                            .SetLabel(edtMessageHeaderGiftOne.Text.Trim().ToString())
                            .SetValue(edtMessageBodyGiftOne.Text.Trim().ToString())
                            .Build());
            passBuilder.AddMessageList(messageList);

            //13 Scrolling images
            List <AppendField> imageList                 = new List <AppendField>();
            EditText           edtScrollingImagesOne     = FindViewById <EditText>(Resource.Id.giftScrollingImages1);
            EditText           edtScrollingImagesDescOne = FindViewById <EditText>(Resource.Id.giftScrollingDesc1);
            EditText           edtScrollingImagesTwo     = FindViewById <EditText>(Resource.Id.giftScrollingImages2);
            EditText           edtScrollingImagesDescTwo = FindViewById <EditText>(Resource.Id.giftScrollingDesc2);

            imageList.Add(AppendField.GetBuilder()
                          .SetKey("1")
                          .SetLabel(edtScrollingImagesDescOne.Text.Trim().ToString())
                          .SetValue(edtScrollingImagesDescTwo.Text.Trim().ToString())
                          .Build());
            imageList.Add(AppendField.GetBuilder()
                          .SetKey("2")
                          .SetLabel(edtScrollingImagesDescTwo.Text.Trim().ToString())
                          .SetValue(edtScrollingImagesTwo.Text.Trim().ToString())
                          .Build());
            passBuilder.AddImageList(imageList);

            //UrlList
            EditText edtGiftUrlLabel    = FindViewById <EditText>(Resource.Id.giftUrlLable);
            EditText edtGiftUrlValue    = FindViewById <EditText>(Resource.Id.giftUrlValue);
            EditText edtGiftUrlLabelOne = FindViewById <EditText>(Resource.Id.giftUrlLable1);
            EditText edtGiftUrlValueOne = FindViewById <EditText>(Resource.Id.giftUrlValue1);

            List <AppendField> urlList = new List <AppendField>();

            urlList.Add(AppendField.GetBuilder()
                        .SetKey("1")
                        .SetLabel(edtGiftUrlLabel.Text.Trim().ToString())
                        .SetValue(edtGiftUrlValue.Text.Trim().ToString())
                        .Build());
            urlList.Add(AppendField.GetBuilder()
                        .SetKey("2")
                        .SetLabel(edtGiftUrlLabelOne.Text.Trim().ToString())
                        .SetValue(edtGiftUrlValueOne.Text.Trim().ToString())
                        .Build());
            passBuilder.AddUrlList(urlList);

            //14 Nearby stores
            EditText    edtGiftNearbyStoresUrl  = FindViewById <EditText>(Resource.Id.giftNearbyStoresUrl);
            EditText    edtGiftNearbyStoresName = FindViewById <EditText>(Resource.Id.giftNearbyStoresName);
            AppendField nearbyAppendField       = AppendField.GetBuilder()
                                                  .SetKey(WalletPassConstant.PassAppendFieldKeyNearbyLocations)
                                                  .SetLabel(edtGiftNearbyStoresName.Text.Trim().ToString())
                                                  .SetValue(edtGiftNearbyStoresUrl.Text.Trim().ToString())
                                                  .Build();

            appendFields.Add(nearbyAppendField);

            //15 Main page
            EditText edtGiftMainPageUrl  = FindViewById <EditText>(Resource.Id.giftMainPageUrl);
            EditText edtGiftMainPageName = FindViewById <EditText>(Resource.Id.giftMainPageName);

            AppendField mainPageAppendField = AppendField.GetBuilder()
                                              .SetKey(WalletPassConstant.PassAppendFieldKeyMainpage)
                                              .SetLabel(edtGiftMainPageName.Text.Trim().ToString())
                                              .SetValue(edtGiftMainPageUrl.Text.Trim().ToString())
                                              .Build();

            appendFields.Add(mainPageAppendField);
            //16 Hotline
            EditText    edtGiftHotlinePone = FindViewById <EditText>(Resource.Id.giftHotlinePone);
            EditText    edtGiftHotlineName = FindViewById <EditText>(Resource.Id.giftHotlineName);
            AppendField hotlineAppendField = AppendField.GetBuilder()
                                             .SetKey(WalletPassConstant.PassAppendFieldKeyHotline)
                                             .SetLabel(edtGiftHotlineName.Text.Trim().ToString())
                                             .SetValue(edtGiftHotlinePone.Text.Trim().ToString())
                                             .Build();
            //Public constant
            //Time check
            long start = 0;
            long end   = 0;
            Date date  = new Date();

            if (TextUtils.IsEmpty(startTime))
            {
                Toast.MakeText(this, "Please select Starttime", ToastLength.Long).Show();
                return;
            }
            else
            {
                start = BasisTimesUtils.GetLongtimeOfYMD(startTime);
            }

            if (TextUtils.IsEmpty(endTime))
            {
                Toast.MakeText(this, "Please select EndTime", ToastLength.Long).Show();
                return;
            }
            else
            {
                end = BasisTimesUtils.GetLongtimeOfYMD(endTime);
            }

            if (end <= start || end <= date.Time)
            {
                Toast.MakeText(this, "Please check (EndTime > StartTime)&& (EndTime > Current Time)", ToastLength.Long).Show();
                return;
            }
            //serial Number
            EditText organizationPassIdGift = FindViewById <EditText>(Resource.Id.organizationPassIdGift);
            string   organizationPassId     = organizationPassIdGift.Text.Trim().ToString();

            if (TextUtils.IsEmpty(organizationPassId))
            {
                Toast.MakeText(this, "SerialNumber can't be empty.", ToastLength.Long).Show();
                return;
            }

            EditText passTypeId = FindViewById <EditText>(Resource.Id.passTypeIdentifier);
            string   typeId     = passTypeId.Text.Trim().ToString();

            if (TextUtils.IsEmpty(typeId))
            {
                Toast.MakeText(this, "Pass Type can't be empty", ToastLength.Long).Show();
                return;
            }

            EditText edtIssuerIdGift = FindViewById <EditText>(Resource.Id.issuerIdGift);
            string   issuerId        = edtIssuerIdGift.Text.Trim().ToString();

            if (TextUtils.IsEmpty(issuerId))
            {
                Toast.MakeText(this, "Issuer id can't be empty.", ToastLength.Long).Show();
                return;
            }

            //State
            string state = WalletPassConstant.PassStateActive;

            switch (dataList[index])
            {
            case "ACTIVE":
                state = WalletPassConstant.PassStateActive;
                break;

            case "COMPLETED":
                state = WalletPassConstant.PassStateCompleted;
                break;

            case "EXPIRED":
                state = WalletPassConstant.PassStateExpired;
                break;

            case "INACTIVE":
                state = WalletPassConstant.PassStateInactive;
                break;

            default:
                break;
            }

            appendFields.Add(hotlineAppendField);
            //PassStyleIdentifier
            EditText edtPassStyleIdentifier = FindViewById <EditText>(Resource.Id.passStyleIdentifierGift);

            passBuilder.SetOrganizationPassId(edtGiftCardNumber.Text.Trim().ToString());
            passBuilder.SetPassStyleIdentifier(edtPassStyleIdentifier.Text.Trim().ToString());
            passBuilder.SetPassTypeIdentifier(typeId);
            passBuilder.SetSerialNumber(organizationPassId);
            passBuilder.SetStatus(PassStatus.GetBuilder().SetState(state).SetEffectTime(format.Format(new Date(start))).SetExpireTime(format.Format(new Date(end))).Build());
            passBuilder.AddAppendFields(appendFields);
            passBuilder.AddCommonFields(commonFields);
            PassObject passObject = passBuilder.Build();

            Log.Info("GiftCardActivity", "passObject: " + passObject.ToJson());
            Intent intent = new Intent(this, typeof(PassTestActivity));

            intent.PutExtra("passObject", passObject.ToJson());
            intent.PutExtra("passId", organizationPassId);
            intent.PutExtra("issuerId", issuerId);
            intent.PutExtra("typeId", typeId);
            StartActivity(intent);
        }