コード例 #1
0
        protected void txtQuantity_TextChanged(object sender, EventArgs e)
        {
            int     stock_quantiy = stock.StockQuantity(ddlStock.SelectedItem.Value.ToString());
            decimal txtqnt        = Convert.ToDecimal(txtQuantity.Text.Trim().ToString());

            if (txtqnt > stock_quantiy)
            {
                QuantityMax.Text = "qunatity is high, reenter max " + stock_quantiy.ToString();
                txtQuantity.Text = "";;
                txtQuantity.Focus();
            }
            else
            {
                QuantityMax.Text = "";

                if (Convert.ToInt32(ddlStock.SelectedValue.ToString()) != -1)
                {
                    Decimal SaleRetAmount = stock.GetStockSalePrice(Convert.ToInt32(ddlStock.SelectedValue.ToString()));
                    SaleRetAmount    *= Convert.ToInt32(txtQuantity.Text.ToString());
                    txtAmount.Text    = SaleRetAmount.ToString();
                    txtAmount.Enabled = false;
                    string discount = "0";
                    txtDiscount.Text = discount.ToString();
                }
            }
        }
コード例 #2
0
 protected void txtQuantity_TextChanged(object sender, EventArgs e)
 {
     if (Convert.ToInt32(ddlStock.SelectedValue.ToString()) != -1)
     {
         Decimal SaleRetAmount = stock.GetStockSalePrice(Convert.ToInt32(ddlStock.SelectedValue.ToString()));
         SaleRetAmount    *= Convert.ToInt32(txtQuantity.Text.ToString());
         txtAmount.Text    = SaleRetAmount.ToString();
         txtAmount.Enabled = false;
     }
 }