| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | |
| | | UtilityHelper.SetupGridSummary(gvMx1, "quantity", "okRkqty"); |
| | | UtilityHelper.SetupGridSummary(gvMxL1, "quantity", "okRkqty"); |
| | | |
| | | |
| | | // 检查数据加载后再设置颜色 |
| | | this.Load += (s, e) => { |
| | | System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); |
| | | timer.Interval = 1000; // 1秒后执行,确保数据已加载 |
| | | timer.Tick += (sender, args) => { |
| | | timer.Stop(); |
| | | timer.Dispose(); |
| | | |
| | | // 使用新的简化格式设置检验结果颜色 |
| | | UtilityHelper.SetSimpleGridColor(gvMxL1, "jyjg", "contains不合格", "Cell", Color.Red); |
| | | UtilityHelper.SetSimpleGridColor(gvMxL1, "jyjg", "contains合格", "Cell", Color.Green); |
| | | UtilityHelper.SetSimpleGridColor(gvMxL1, "jyjg", "contains免检", "Cell", Color.Green); |
| | | |
| | | UtilityHelper.SetSimpleGridColor(gvMxL2, "jyjg", "contains不合格", "Cell", Color.Red); |
| | | UtilityHelper.SetSimpleGridColor(gvMxL2, "jyjg", "contains合格", "Cell", Color.Green); |
| | | UtilityHelper.SetSimpleGridColor(gvMxL2, "jyjg", "contains免检", "Cell", Color.Green); |
| | | |
| | | UtilityHelper.SetSimpleGridColor(gvMx1, "jyjg", "contains不合格", "Cell", Color.Red); |
| | | UtilityHelper.SetSimpleGridColor(gvMx1, "jyjg", "contains合格", "Cell", Color.Green); |
| | | UtilityHelper.SetSimpleGridColor(gvMx1, "jyjg", "contains免检", "Cell", Color.Green); |
| | | |
| | | UtilityHelper.SetSimpleGridColor(gvMx3, "jyjg", "contains不合格", "Cell", Color.Red); |
| | | UtilityHelper.SetSimpleGridColor(gvMx3, "jyjg", "contains合格", "Cell", Color.Green); |
| | | UtilityHelper.SetSimpleGridColor(gvMx3, "jyjg", "contains免检", "Cell", Color.Green); |
| | | |
| | | // 字段运算示例:当收货数量(quantity)大于已入库数量(okRkqty)时,整行显示橙色 |
| | | UtilityHelper.SetSimpleGridColor(gvMx1, "", "quantity-okRkqty>0", "Row", Color.Orange); |
| | | |
| | | // 字段运算示例:当可打印数量(kQty)小于等于0时,整行显示灰色 |
| | | UtilityHelper.SetSimpleGridColor(gvMx1, "", "kQty<=0", "Row", Color.Gray); |
| | | }; |
| | | timer.Start(); |
| | | }; |
| | | |
| | | } |
| | | private void GridView1_ColumnFilterChanged(object sender, EventArgs e) |