王 垚
2022-07-27 4286ee5823987af404e167a7c4aeacbe7def3c36
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,21 +101,15 @@
                //-----------预警状态
                //开工时间小于当天时间,但是任务单状态还是 待生产,系统自动黄色警示;
                //完工时间小于当天时间,但是任务单还是待生产或者在执行的,系统自动红色警示;
                //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;
                    }
                }
                //设置合计列
                string sTotalCol = "";
@@ -282,7 +276,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 +450,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,17 +501,26 @@
            //-----------预警状态
            //开工时间小于当天时间,但是任务单状态还是 待生产,系统自动黄色警示;
            //完工时间小于当天时间,但是任务单还是待生产或者在执行的,系统自动红色警示;
            int HBDateCol = Fun_GetCol("开工时间");
            int HEDateCol = Fun_GetCol("完工时间");
            int HStatusCol = Fun_GetCol("生产状态");
            //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[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;
                }