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(); } } }
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; } }