void eqpState(int UnitID, string strEqpState) { Label lblTemp = new Label(); try { dgv_UnitState[UnitID - 1, 0].Value = PInfo.funEQPState(strEqpState); switch (strEqpState) { case "1": //Normal dgv_UnitState[UnitID - 1, 0].Style.BackColor = Color.Yellow; dgv_UnitState[UnitID - 1, 0].Style.ForeColor = Color.Black; break; case "2": //Fault dgv_UnitState[UnitID - 1, 0].Style.BackColor = Color.Red; dgv_UnitState[UnitID - 1, 0].Style.ForeColor = Color.White; break; case "3": //PM dgv_UnitState[UnitID - 1, 0].Style.BackColor = Color.Gray; dgv_UnitState[UnitID - 1, 0].Style.ForeColor = Color.White; break; } #region //switch (UnitID) //{ // case 1: //FI01 // lblTemp = lblFL01EQPState; // break; // case 2: //FI02 // lblTemp = lblFL02EQPState; // break; // case 3: //FT01 // lblTemp = lblFT01EQPState; // break; // case 4://AL01 // lblTemp = lblAL01EQPState; // break; // case 5://LM01 // lblTemp = lblLM01EQPState; // break; // case 6://DM01 // lblTemp = lblDM01EQPState; // break; // case 7://IS01 // lblTemp = lblIS01EQPState; // break; // case 8://ST01 // lblTemp = lblST01EQPState; // break; // case 9://FT02 // lblTemp = lblFT02EQPState; // break; //} //switch (strEqpState) //{ // case "1": //Normal // lblTemp.BackColor = Color.Yellow; // lblTemp.ForeColor = Color.Black; // break; // case "2"://Fault // lblTemp.BackColor = Color.Red; // lblTemp.ForeColor = Color.White; // break; // case "3"://PM // lblTemp.BackColor = Color.Gray; // lblTemp.ForeColor = Color.White; // break; //} #endregion } catch (Exception ex) { PInfo.subLog_Set(clsInfo.LogType.CIM, ex.ToString()); } }