protected void MoOutgoingStatus() { string sqlstr = "usp_ShowMoStatus"; int tb_type = 2; string mo_id = txtMo.Text.Trim().ToUpper(); string goods_id = txtItem.Text.Trim(); SqlParameter[] parameters = { new SqlParameter("@tb_type", tb_type), new SqlParameter("@mo_id", mo_id), new SqlParameter("@goods_id", goods_id) }; DataSet dsOut = sh.ExecutePrdReturnDataSet(sqlstr, parameters); DataTable tbOut = dsOut.Tables[0]; if (tbOut.Rows.Count == 0) { tbOut.Rows.Add(); } gvMoOut.DataSource = tbOut.DefaultView; gvMoOut.DataBind(); for (int i = 0; i < gvMoOut.Rows.Count; i++) { if (gvMoOut.Rows[i].Cells[2].Text == "收貨") { gvMoOut.Rows[i].BackColor = System.Drawing.Color.Yellow; } else if (gvMoOut.Rows[i].Cells[2].Text == "返電") { gvMoOut.Rows[i].BackColor = System.Drawing.Color.FromArgb(0xCC, 0x00, 0x00); } } DataTable tbMoQc = dsOut.Tables[1]; if (tbMoQc.Rows.Count == 0) { tbMoQc.Rows.Add(); } gvMoQc.DataSource = tbMoQc.DefaultView; gvMoQc.DataBind(); }