Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
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;
            }
        }