grid 根據判斷文字框顯示紅色
{
strOBMNG = ((TextBox)d1.FindControl("txtOBMNG")).Text; //訂單殘量
strOutQty = ((TextBox)d1.FindControl("txtOutQty")).Text; //預計出庫數量
if (strOBMNG == "")
{
strOBMNG = "0";
}
if (strOutQty == "")
{
strOutQty = "0";
}
if (Convert.ToDecimal(strOutQty) > Convert.ToDecimal(strOBMNG))
{
d1.Cells[4].BackColor = System.Drawing.Color.Red; //變顏色
Response.Write("<script>alert('出庫數量大於庫存數量!')</script>");
return;
}
}