Exemple #1
0
        private async void btnPayApplicationTransferFee_Click(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(txtAssetID.Text))
            {
                MessageBox.Show("Please specify the AssetId", "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtAssetID.Focus();
                return;
            }

            if (string.IsNullOrEmpty(txtBuyerAddress.Text))
            {
                MessageBox.Show("Please specify the Buyer Address", "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtBuyerAddress.Focus();
                return;
            }

            lblState.Text = "Please wait....";
            propertyBuyer = new PropertyBuyer(txtBuyerAddress.Text.Trim(),
                                              txtBuyerAddress.Text.Trim());
            receiptResponse = await propertyBuyer.PayTransferFee(payee.GetPayee(),
                                                                 txtAssetID.Text.Trim());

            if (receiptResponse != null && receiptResponse.success)
            {
                OutputResponseInformation(receiptResponse);
                lblState.Text = PaidApplicationTransferFee;
                btnPayApplicationTransferFee.Enabled = false;
                btnTransferOwnership.Enabled         = true;
            }
        }
Exemple #2
0
        /// <summary>
        /// The SaleRegistry Console Client Demonstrating the overall
        /// Workflow or Process of obtaining the ownership of the property.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            try
            {
                string assetId = UniqueIdHelper.GenerateId();

                Payee          payee          = new Payee();
                Supervisor     supervisor     = new Supervisor(assetId);
                PropertyBuyer  propertyBuyer  = new PropertyBuyer();
                PropertySeller propertySeller = new PropertySeller();

                System.Console.WriteLine("Initiating the " +
                                         "Sale Deed Application Process");

                supervisor.InitApplication().Wait();
                supervisor.StartTheReviewProcess().Wait();
                supervisor.CompleteTheReviewProcess().Wait();

                propertyBuyer.PayTransferFee(payee.GetPayee(), assetId).Wait();
                supervisor.TransferOwnership(propertySeller.GetOwnerAddress(),
                                             propertyBuyer.GetBuyerAddress()).Wait();

                System.Console.WriteLine("Completed executing the " +
                                         "Sale Deed Application Process");
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.ToString());
            }

            System.Console.ReadLine();
        }
        public async Task <IHttpActionResult> PutPropertyBuyer(int id, PropertyBuyer propertyBuyer)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != propertyBuyer.ID)
            {
                return(BadRequest());
            }

            db.Entry(propertyBuyer).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PropertyBuyerExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GetPropertyBuyer(int id)
        {
            PropertyBuyer propertyBuyer = await db.PropertyBuyer.FindAsync(id);

            if (propertyBuyer == null)
            {
                return(NotFound());
            }

            return(Ok(propertyBuyer));
        }
        public async Task <IHttpActionResult> PostPropertyBuyer(PropertyBuyer propertyBuyer)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.PropertyBuyer.Add(propertyBuyer);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = propertyBuyer.ID }, propertyBuyer));
        }
        public async Task <IHttpActionResult> DeletePropertyBuyer(int id)
        {
            PropertyBuyer propertyBuyer = await db.PropertyBuyer.FindAsync(id);

            if (propertyBuyer == null)
            {
                return(NotFound());
            }

            db.PropertyBuyer.Remove(propertyBuyer);
            await db.SaveChangesAsync();

            return(Ok(propertyBuyer));
        }
        private decimal GetForeignBuyerDuty(decimal propertyDutiableAmount, PropertyBuyer buyer)
        {
            decimal buyersInterestValue = buyer.Shares * propertyDutiableAmount;

            return((buyer.IsForeignBuyer) ? buyersInterestValue * foreignerDutyPercentage / 100 : 0);
        }
        private decimal GetFirstHomeOwnerGrant(PropertySaleInformation propertySaleInformation, PropertyBuyer buyer)
        {
            // https://firsthomeowners.initiatives.qld.gov.au/eligibility.php
            if (propertySaleInformation.PurchasePrice < 750000 &&
                propertySaleInformation.PropertyType == PropertyType.NewHome)
            {
                if (BuyerFirstHomeDutyApplies(buyer))
                {
                    return(15000M);
                }
            }

            return(0M);
        }
 private bool BuyerVacantLandApplies(PropertyBuyer buyer, PropertyType propertyType)
 {
     return(buyer.IntendedUse == IntendedPropertyUse.PrimaryResidence && buyer.FirstHomeBuyer && propertyType == PropertyType.VacantLand);
 }
 private bool BuyerHomeDutyDeductionApplies(PropertyBuyer buyer)
 {
     return(buyer.IntendedUse == IntendedPropertyUse.PrimaryResidence);
 }
 private bool BuyerHomeDutyApplies(PropertyBuyer buyer)
 {
     return(buyer.IntendedUse == IntendedPropertyUse.PrimaryResidence && !buyer.FirstHomeBuyer);
 }