private List <AlarmProfilerDayDefinition> GetListOfAlarmDefinitions()
        {
            //create alarm profile urgency reader object
            AlarmProfileReader reader = new AlarmProfileReader(_realmProvider);

            //read all days
            return(reader.GetListOfProfileDays(_alarmProfileID));
        }
Esempio n. 2
0
        private List <AlarmProfilerDayDefinition> GetProfileDetailedData(int identity)
        {
            _logger.Info($"Getting detailed data of the alarm profile with ID = {identity}.");

            AlarmProfileReader reader = new AlarmProfileReader(_realmProvider);

            return(reader.GetListOfProfileDays(identity));
        }
        private void ObtainAlarmDaysDefinitions()
        {
            //create reader instance
            AlarmProfileReader reader = new AlarmProfileReader(_realmProvider);

            //for every full profile definition
            foreach (var item in _profilesDefinitionsList)
            {
                //get days definitions
                List <AlarmProfilerDayDefinition> days = reader.GetListOfProfileDays(item.AlarmProfileDefinition.Identity);

                //translate raalm days into export models
                List <AlarmProfileSingleDayExportModel> daysExportModels = new List <AlarmProfileSingleDayExportModel>();
                foreach (var item2 in days)
                {
                    AlarmProfileSingleDayExportModel exportModel = new AlarmProfileSingleDayExportModel()
                    {
                        Identity          = item2.Identity,
                        AlwaysSend        = item2.AlwaysSend,
                        NeverSend         = item2.NeverSend,
                        SendBetween       = item2.SendBetween,
                        ProfileForeignKey = item2.ProfileForeignKey,
                        DayNumber         = item2.DayNumber,
                        LowerHour         = item2.LowerHour,
                        UpperHour         = item2.UpperHour
                    };

                    daysExportModels.Add(exportModel);
                }



                //assign obtained days
                item.DaysList = daysExportModels;
            }
        }