Beispiel #1
0
        public virtual bool enableAllAlarmReport(Boolean isEnable)
        {
            bool isSuccess = true;

            try
            {
                using (DBConnection_EF con = DBConnection_EF.GetUContext())
                {
                    alarmRptCondDao.deleteAllRptCond(con);
                    List <AlarmMap> alarmMaps = loadAlarmMaps();
                    foreach (AlarmMap alarmMap in alarmMaps)
                    {
                        ALARMRPTCOND cond = new ALARMRPTCOND()
                        {
                            ALAM_CODE  = alarmMap.ALARM_ID,
                            EQPT_ID    = alarmMap.EQPT_REAL_ID,
                            ENABLE_FLG = (isEnable ? SCAppConstants.YES_FLAG : SCAppConstants.NO_FLAG)
                        };
                        alarmRptCondDao.insertRptCond(con, cond);
                    }
                }
            }
            catch (Exception ex)
            {
                isSuccess = true;
                logger.Error(ex, "Exception");
            }
            return(isSuccess);
        }
Beispiel #2
0
        public bool enableAlarmReport(string alarm_id, Boolean isEnable)
        {
            bool isSuccess = true;

            try
            {
                string enable_flag = (isEnable ? SCAppConstants.YES_FLAG : SCAppConstants.NO_FLAG);

                using (DBConnection_EF con = DBConnection_EF.GetUContext())
                {
                    ALARMRPTCOND cond = null;
                    cond = alarmRptCondDao.getRptCond(con, alarm_id);
                    if (cond != null)
                    {
                        cond.ENABLE_FLG = enable_flag;
                        alarmRptCondDao.insertRptCond(con, cond);
                    }
                    else
                    {
                        cond = new ALARMRPTCOND()
                        {
                            ALAM_CODE  = alarm_id,
                            ENABLE_FLG = enable_flag
                        };
                        alarmRptCondDao.insertRptCond(con, cond);
                    }
                }
            }
            catch (Exception ex)
            {
                isSuccess = true;
                logger.Error(ex, "Exception");
            }
            return(isSuccess);
        }