Beispiel #1
0
        /* Defines a new quote when a user tries to buy */
        private void button5_Click(object sender, EventArgs e)
        {
            String input = bunifuMaterialTextbox9.Text;
            double quote = -1;

            try
            {
                quote = Convert.ToDouble(input);
            }catch (FormatException)
            {
                this.put_message_buy_error("Please select a valid quote");
                return;
            }

            double currentQuote = this.client.GetQuote();

            if (quote < currentQuote)
            {
                this.put_message_buy_error("Defined quote is smaller than the current quote (" + currentQuote + ")");
            }
            else
            {
                this.panelNewBuyOrder.Visible    = true;
                this.panelBuyProgress.Visible    = false;
                this.panelDefineQuoteBuy.Visible = false;
                client.AddQuote(quote, Common.Order.OrderType.Purchase);
                this.status = Status.NONE;
                this.put_message_buy_success("Order Successufully created");
                this.inicialize_purchase();
            }
        }