private void loadItemStock() { string keywords = cmbPartCode.Text; if (!string.IsNullOrEmpty(keywords)) { float stock = dalItem.getStockQty(keywords); /////////////////////////////////////////////////////////////////////////////////////////////////////////// ////pending load data from database float plannedUse = 0; float requiredQty = ableQty == null ? 0 : Convert.ToSingle(ableQty); txtStock.Text = stock.ToString(); txtPlannedUse.Text = plannedUse.ToString(); txtAvailable.Text = (stock - plannedUse).ToString(); txtRequiredQty.Text = requiredQty.ToString(); txtShort.Text = (stock - plannedUse - requiredQty).ToString(); if (stock - plannedUse - requiredQty < 0) { txtShort.ForeColor = Color.Red; } else { txtShort.Text = "0"; txtShort.ForeColor = Color.Black; } } }