yangle
2022-12-09 526f787a2dfb97f6492912a73376b5a5551a432c
Kanban/Sc_CJKB.cs
@@ -76,7 +76,7 @@
                string sSql = "";
                string sWhere = "";
                ClsIni oIni = new ClsIni();
                string sID = ClsIni.ReadIni("Dept", "DeptID", Pub_Class.ClsPub.AppPath + @"\" + "HXErp.ini");
                string sID = ClsIni.ReadIni("Dept", "DeptID", Pub_Class.ClsPub.AppPath + @"\" + "HXErp_SY.ini");
                sDeptID = sID;
                //过滤条件
                //if (frmCondition.SqlStr.Trim().Length == 0)
@@ -101,17 +101,12 @@
                //-----------预警状态
                //开工时间小于当天时间,但是任务单状态还是 待生产,系统自动黄色警示;
                //完工时间小于当天时间,但是任务单还是待生产或者在执行的,系统自动红色警示;
                //int HBDateCol = Fun_GetCol("开工时间");
                //int HEDateCol = Fun_GetCol("完工时间");
                //int HStatusCol = Fun_GetCol("生产状态");
                //int HEDateCol = Fun_GetCol("计划完工日期");
                //DateTime oNow = DateTime.Today.Date;
                //for (int i = 0; i < grdMain.Rows.Count; i++)
                //{
                //    if (DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HBDateCol].Value) < oNow && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HStatusCol].Value) == "待生产")
                //    {
                //        grdMain.Rows[i].DefaultCellStyle.ForeColor = Color.Yellow;
                //    }
                //    if (DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HEDateCol].Value) < oNow && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HStatusCol].Value) == "待生产")
                //    if (DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HEDateCol].Value) < oNow)
                //    {
                //        grdMain.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
                //    }
@@ -282,7 +277,16 @@
                    grdMain.DataSource = null;
                    grdMain.DataSource = DSet.Tables[0].DefaultView;
                //int HEDateCol = Fun_GetCol("计划完工日期");
                //DateTime oNow = DateTime.Today.Date;
                //for (int i = 0; i < grdMain.Rows.Count; i++)
                //{
                //    if (DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HEDateCol].Value) < oNow)
                //    {
                //        grdMain.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
                //    }
                //}
                ////-----------预警状态 小于等于 显示 红色, 小于7 橙色,小于等于14 黄色 
                //int HYJDateCol = Fun_GetCol("预警状态(天)");
@@ -447,6 +451,15 @@
                HQty = 0;
                timer1.Enabled = true;
            }
            //int HEDateCol = Fun_GetCol("计划完工日期");
            //DateTime oNow = DateTime.Today.Date;
            //for (int i = 0; i < grdMain.Rows.Count; i++)
            //{
            //    if (DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HEDateCol].Value) < oNow)
            //    {
            //        grdMain.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
            //    }
            //}
        }
        private void toolStripButton1_Click(object sender, EventArgs e)
@@ -489,21 +502,30 @@
            //-----------预警状态
            //开工时间小于当天时间,但是任务单状态还是 待生产,系统自动黄色警示;
            //完工时间小于当天时间,但是任务单还是待生产或者在执行的,系统自动红色警示;
            int HBDateCol = Fun_GetCol("开工时间");
            int HEDateCol = Fun_GetCol("完工时间");
            int HStatusCol = Fun_GetCol("生产状态");
            DateTime oNow = DateTime.Today.Date;
            for (int i = 0; i < grdMain.Rows.Count; i++)
            {
                if (DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HBDateCol].Value) < oNow && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HStatusCol].Value) == "待生产")
                {
                    grdMain.Rows[i].DefaultCellStyle.ForeColor = Color.Yellow;
                }
                if (DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HEDateCol].Value) < oNow && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HStatusCol].Value) == "待生产")
                {
                    grdMain.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
                }
            }
            //int HBDateCol = Fun_GetCol("开工时间");
            //int HEDateCol = Fun_GetCol("完工时间");
            //int HStatusCol = Fun_GetCol("生产状态");
            //DateTime oNow = DateTime.Today.Date;
            //for (int i = 0; i < grdMain.Rows.Count; i++)
            //{
            //    if (DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HBDateCol].Value) < oNow && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HStatusCol].Value) == "待生产")
            //    {
            //        grdMain.Rows[i].DefaultCellStyle.ForeColor = Color.Yellow;
            //    }
            //    if (DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HEDateCol].Value) < oNow && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HStatusCol].Value) == "待生产")
            //    {
            //        grdMain.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
            //    }
            //}
            //int HEDateCol = Fun_GetCol("计划完工日期");
            //DateTime oNow = DateTime.Today.Date;
            //for (int i = 0; i < grdMain.Rows.Count; i++)
            //{
            //    if (DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HEDateCol].Value) < oNow)
            //    {
            //        grdMain.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
            //    }
            //}
        }