private async Task<ScriptManualIntervention> CreateScriptManualIntervention( ManualIntervention manualIntervention) { string target; if (manualIntervention.IsGroup) { var groupData = await this.userRepo.GetGroupAsync(manualIntervention.UserId); target = groupData.Name; } else { var userData = await this.userRepo.GetUserAsync(manualIntervention.UserId); target = userData.Name; } return new ScriptManualIntervention { DisplayName = manualIntervention.DisplayName, Sequence = manualIntervention.Sequence, Enabled = manualIntervention.Enabled, InterventionText = manualIntervention.Text, Target = target, IsTargetGroup = manualIntervention.IsGroup }; }
private static ReleaseAction ParseManualIntervention(XElement node) { var idElement = node.Attribute("Recipient").Value; var splitId = idElement.Split(':'); var parsedManualIntervention = new ManualIntervention { DisplayName = node.Attribute("DisplayName").Value, DisplayNameIsMeaningful = true, ItemType = BlockType.ManualIntervention, Text = node.Attribute("Details").Value, IsGroup = int.Parse(splitId[0]) == 2, UserId = int.Parse(splitId[1]) }; FireActionParsedEvent(parsedManualIntervention); return parsedManualIntervention; }