Exemplo n.º 1
0
        public MessageReport CreateAlarm(tblAlarm alarm)
        {
            var result = new MessageReport();

            try
            {
                _tblAlarmRepository.Add(alarm);
                _UnitOfWorkEv.Commit();
                result.isSuccess = true;
            }
            catch (Exception ex)
            {
                result.isSuccess = false;
                result.Message   = ex.Message;
            }
            return(result);
        }
Exemplo n.º 2
0
        //public AlarmObject( )
        //{

        //}
        public AlarmObject(tblAlarm tocopy)
        {
            AlarmGroups = new List <IAlarmGroup>();
            FillAlarmGroups();
            ID        = tocopy.ID;
            VarNameID = tocopy.VarNameID;
            StatusBit = (AlarmStatusBit)tocopy.StatusBit;
            Type      = (AlarmGroupType)tocopy.Type;
            //AlarmGroupID = tocopy.AlarmGroupID;

            this._IAlarmGroup  = InitAlarmGroup(tocopy.AlarmGroupID);
            EnableTagID        = tocopy.EnableTagID;
            EnableTagDirection = tocopy.EnableTagDirection;
            EnableTagDelayOn   = tocopy.EnableTagDelayOn;
            EnableTagDirection = tocopy.EnableTagDirection;
            EnableTagDelayOn   = tocopy.EnableTagDelayOn;
            EnableTagDealyOff  = tocopy.EnableTagDealyOff;
            DelayOn            = tocopy.DelayOn;
            DelayOff           = tocopy.DelayOff;
            SourceAlarmTagID   = tocopy.SourceAlarmTagID;
            FirstOutGroupID    = tocopy.FirstOutGroupID;
            hysteresis         = tocopy.hysteresis;
            UpperLevelGroupID  = tocopy.UpperLevelGroupID;
        }