private void ObtainProfilesDefinitions()
        {
            //create profiles reader instance
            AlarmProfileReader reader = new AlarmProfileReader(_realmProvider);

            //for every identity to export
            foreach (var item in _profilesIDlidt)
            {
                //get single profile definition
                AlarmProfileDefinition definition = reader.GetAlarmProfileDefinition(item);

                //translate DB alarm profile definition into export model
                AlarmProfileDefinitionExportModel exportModel = new AlarmProfileDefinitionExportModel()
                {
                    Identity       = definition.Identity,
                    CreatedBy      = definition.CreatedBy,
                    ModifiedBy     = definition.ModifiedBy,
                    ProfileName    = definition.ProfileName,
                    ProfileComment = definition.ProfileComment,
                };

                //create object of export list
                FullAlarmProfileDefinition fullDefinition = new FullAlarmProfileDefinition()
                {
                    AlarmProfileDefinition = exportModel,
                    NoErrors = true,
                };

                //add new full definition to list
                _profilesDefinitionsList.Add(fullDefinition);
            }
        }
        private bool CheckIfProfileWithThisNameExistts(AlarmProfileDefinitionExportModel item)
        {
            //create instance of alarm profile reader
            AlarmProfileReader reader = new AlarmProfileReader(_realmProvider);
            int identity = reader.GetIdOfAlarmProfileOfName(item.ProfileName);

            return(identity > 0);
        }
        private bool CheckProfileDefinition(AlarmProfileDefinitionExportModel profileDefinition)
        {
            bool profileOk = profileDefinition.Identity >= 1;
            if (profileOk) profileOk = profileDefinition.CreatedBy != null && profileDefinition.CreatedBy != "";
            if (profileOk) profileOk = profileDefinition.ModifiedBy != null && profileDefinition.ModifiedBy != "";
            if (profileOk) profileOk = profileDefinition.ProfileName != null && profileDefinition.ProfileName != "";
            if (profileOk) profileOk = profileDefinition.ProfileComment != null;

            return profileOk;
        }