private void SendDataToDB()
        {
            //create instance of alarm profile creator
            AlarmProfileCreator creator = new AlarmProfileCreator(_realmProvider);

            //create validator instance
            AlarnProfileImportItemValidator validator = new AlarnProfileImportItemValidator();

            //for every parsed profile from file
            foreach (var item in _parsedProfiles)
            {
                //check correctness of parsed data
                if (CheckCorrectnessOfData(item, validator))
                {
                    //check if alarm already defined
                    if (!CheckIfProfileWithThisNameExistts(item.AlarmProfileDefinition))
                    {
                        SaveProfileToDB(creator, item);
                    }
                    else
                    {
                        OnSingleImportDone(false, item.AlarmProfileDefinition.ProfileName, $"Alarm urgency profile with name '{item.AlarmProfileDefinition.ProfileName}' is already defined in DB.", false);
                    }
                }
                else
                {
                    OnSingleImportDone(false, item.AlarmProfileDefinition.ProfileName, $"Alarm urgency profile with name '{item.AlarmProfileDefinition.ProfileName}' cannot be imported.", false);
                }
            }

            OnSingleImportDone(true, "Import finished", "Importing of all alarm urgency profiles from file finished", true);
        }
 private bool CheckCorrectnessOfData(FullAlarmProfileDefinition item,
                                     AlarnProfileImportItemValidator validator)
 {
     return(validator.Validate(item).NoErrors);
 }