コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Guid PayGroupId = new Guid("ff8488d6-9b30-44cd-be47-3ac3bf80b917");
        Guid PayGroupId = new Guid("ff8488d6-9b30-44cd-be47-3ac3bf80b917");
        var  list       = EntryList.GetEntryList(PayGroupId, Guid.Empty, "").ToList();

        foreach (var entry in list)
        {
            EntryPayment entryPayment = null;
            entryPayment = EntryPaymentList.GetEntryPaymentList().FirstOrDefault(x => x.EntryId == entry.Id);
            if (entryPayment == null)
            {
                entryPayment         = EntryPayment.NewEntryPayment();
                entryPayment.EntryId = entry.Id;
            }

            entryPayment.PayCompany     = entry.PayCompany;
            entryPayment.PayAddress1    = entry.PayAddress1;
            entryPayment.PayAddress2    = entry.PayAddress2;
            entryPayment.PayCity        = entry.PayCity;
            entryPayment.PayPostal      = entry.PayPostal;
            entryPayment.PayCountry     = entry.PayCountry;
            entryPayment.PayFirstname   = entry.PayFirstname;
            entryPayment.PayLastname    = entry.PayLastname;
            entryPayment.PayContact     = entry.PayContact;
            entryPayment.PaymentMethod  = entry.PaymentMethod;
            entryPayment.PayGroupId     = entry.PayGroupId;
            entryPayment.Amount         = entry.Amount;
            entryPayment.Fee            = entry.Fee;
            entryPayment.Tax            = entry.Tax;
            entryPayment.GrandAmount    = entry.GrandAmount;
            entryPayment.AmountReceived = entry.AmountReceived;
            entryPayment.Invoice        = entry.Invoice;
            entryPayment.Save();
        }

        //Registration reg = Registration.GetRegistration(new Guid("a48596b5-513e-4a1a-aa19-24160144db5b"));
        GeneralFunction.CompleteNewEntrySubmissionPayPal(PayGroupId);//ff8488d6-9b30-44cd-be47-3ac3bf80b917
    }
コード例 #2
0
 private void FieldCompleted(object sender, EventArgs e)
 {
     if (sender == EntryRecepient)
     {
         if (!ValidationHelper.ValidateTextField(EntryRecipientPhoneNumber.Text))
         {
             EntryRecipientPhoneNumber.Focus();
         }
     }
     else if (sender == EntryPayment)
     {
         if (!ValidationHelper.ValidateNumber(EntryCollateral.Text))
         {
             EntryCollateral.Focus();
         }
     }
     else if (sender == EntryCollateral)
     {
         if (!ValidationHelper.ValidateNumber(EntryPayment.Text))
         {
             EntryPayment.Focus();
         }
     }
 }
コード例 #3
0
    public Entry onEntryData(Entry entry, decimal subtotal)
    {
        entry.PayCompany    = txtCompany.Text.Trim();
        entry.PayAddress1   = txtAddress1.Text.Trim();
        entry.PayAddress2   = txtAddress2.Text.Trim();
        entry.PayCity       = txtCity.Text.Trim();
        entry.PayPostal     = txtPostal.Text.Trim();
        entry.PayCountry    = ddlCountry.SelectedValue;
        entry.PayFirstname  = txtFirstname.Text.Trim();
        entry.PayLastname   = txtLastname.Text.Trim();
        entry.PayContact    = GeneralFunction.CreateContact(txtContactCountryCode.Text.Trim(), txtContactAreaCode.Text.Trim(), txtContactNumber.Text.Trim());
        entry.PaymentMethod = rblPayment.SelectedValue;

        // do not adjust amounts or paygroupid if in admin mode
        //if (!isAdminEdit)
        {
            Registration reg = Registration.GetRegistration(entry.RegistrationId);
            entry.Amount = GeneralFunction.CalculateEntryPrice(entry, reg);
            entry.Fee    = 0;
            entry.Tax    = 0;

            // add the fees and tax to only the first entry in the invoice group
            if (counter == 0)
            {
                if (rblPayment.SelectedValue == PaymentType.PayPal)
                {
                    entry.Fee = GeneralFunction.CalculateCreditFees(subtotal);
                }
                if (rblPayment.SelectedValue == PaymentType.BankTransfer)
                {
                    entry.Fee = GeneralFunction.CalculateBankTransferFees();
                }

                //entry.Tax = 0;
                if (ddlCountry.SelectedValue.ToLower() == "singapore")
                {
                    entry.Tax = GeneralFunction.CalculateTax(subtotal + entry.Fee);
                }
            }


            entry.GrandAmount = entry.Amount + entry.Fee + entry.Tax;


            // To solve pending payment issue from paypal - only if paygroupId is empty will assign new paygroupId or else it will have same paygroupId for the entire process
            // update the pay group id to be the same
            if (entry.PayGroupId == Guid.Empty)
            {
                entry.PayGroupId = payGroupId;
            }
            else
            {
                payGroupId = entry.PayGroupId;
            }
        }

        //entry.PayStatus = StatusPaymentEntry.NotPaid;
        //entry.Status = StatusEntry.PaymentPending;

        if (rblPayment.SelectedValue != PaymentType.PayPal)
        {
            entry.Save();
        }

        //If admin then need save
        if (isAdminEdit)
        {
            entry.Save();
        }


        {
            EntryPayment entryPayment = null;
            entryPayment = EntryPaymentList.GetEntryPaymentList().FirstOrDefault(x => x.EntryId == entry.Id);
            if (entryPayment == null)
            {
                entryPayment         = EntryPayment.NewEntryPayment();
                entryPayment.EntryId = entry.Id;
            }

            entryPayment.PayCompany     = entry.PayCompany;
            entryPayment.PayAddress1    = entry.PayAddress1;
            entryPayment.PayAddress2    = entry.PayAddress2;
            entryPayment.PayCity        = entry.PayCity;
            entryPayment.PayPostal      = entry.PayPostal;
            entryPayment.PayCountry     = entry.PayCountry;
            entryPayment.PayFirstname   = entry.PayFirstname;
            entryPayment.PayLastname    = entry.PayLastname;
            entryPayment.PayContact     = entry.PayContact;
            entryPayment.PaymentMethod  = entry.PaymentMethod;
            entryPayment.PayGroupId     = entry.PayGroupId;
            entryPayment.Amount         = entry.Amount;
            entryPayment.Fee            = entry.Fee;
            entryPayment.Invoice        = entry.Invoice;
            entryPayment.Tax            = entry.Tax;
            entryPayment.GrandAmount    = entry.GrandAmount;
            entryPayment.AmountReceived = entry.AmountReceived;
            entryPayment.Save();
        }

        return(entry);
    }
コード例 #4
0
        protected override bool IsValid()
        {
            if (!ValidationHelper.ValidateTextField(EntryRecepient.Text))
            {
                EntryRecepient.FocusField();
                Scroll();
                return(false);
            }
            else if (!ValidationHelper.ValidateTextField(ViewModel.LauncherFullPhoneNumber))
            {
                EntryLauncherPhoneNumber.Focus();
                Scroll();
                return(false);
            }
            else if (!ValidationHelper.ValidateTextField(ViewModel.RecipientFullPhoneNumber))
            {
                EntryRecipientPhoneNumber.Focus();
                Scroll();
                return(false);
            }
            else if (!ValidationHelper.ValidateTextField(ViewModel.FromLocationGPS))
            {
                EventHandler handleHandler = (s, e) => {
                    var picker = new LocationPickerPage(LocationPickerType.From);
                    picker.eventHandler = DidSelectLocationHandler;
                    Navigation.PushAsync(picker, true);
                };

                ShowErrorMessage(AppResources.LocationsNotSet, false, handleHandler);

                return(false);
            }
            else if (!ValidationHelper.ValidateTextField(ViewModel.ToLocationGPS))
            {
                EventHandler handleHandler = (s, e) => {
                    var picker = new LocationPickerPage(LocationPickerType.To);
                    picker.eventHandler = DidSelectLocationHandler;
                    Navigation.PushAsync(picker, true);
                };

                ShowErrorMessage(AppResources.LocationsNotSet, false, handleHandler);

                return(false);
            }
            else if (PhotoSource == null)
            {
                EventHandler handleHandler = (s, e) => {
                    OnTakePhoto(PhotoButton, null);
                };

                ShowErrorMessage(AppResources.SelectPackagePhoto, false, handleHandler);

                return(false);
            }
            else if (!ValidationHelper.ValidateTextField(EntryDeadline.Text))
            {
                EventHandler handleHandler = (s, e) => { 
 EntryDeadline.Focus(); 
 }; 

                ShowErrorMessage(AppResources.SelectDeadlineDate, false, handleHandler); 

                return(false);
            }
            else if (!ValidationHelper.ValidateNumber(EntryPayment.Text))
            {
                EntryPayment.Focus();

                return(false);
            }
            else if (!ValidationHelper.ValidateNumber(EntryCollateral.Text))
            {
                EntryCollateral.Focus();

                return(false);
            }
            else if (!ValidationHelper.ValidateTextField(EntryDescription.Text))
            {
                EntryDescription.Focus();
                Scroll();

                return(false);
            }


            return(true);
        }