private TaskXmlModify GetTaskXmlModifyWithCustomVariablesResolved(TaskXmlModify taskXmlModifyOriginal) { TaskXmlModify taskXmlModifyResolved = new TaskXmlModify(); int groupId = taskXmlModifyOriginal.TaskGroupId; taskXmlModifyResolved.AttributeKey = Utility.ReplaceVariablesWithValues(taskXmlModifyOriginal.AttributeKey, groupId); taskXmlModifyResolved.AttributeKeyValue = Utility.ReplaceVariablesWithValues(taskXmlModifyOriginal.AttributeKeyValue, groupId); taskXmlModifyResolved.AttributeToChange = Utility.ReplaceVariablesWithValues(taskXmlModifyOriginal.AttributeToChange, groupId); taskXmlModifyResolved.AttributeToChangeValue = Utility.ReplaceVariablesWithValues(taskXmlModifyOriginal.AttributeToChangeValue, groupId); taskXmlModifyResolved.NodeToChange = Utility.ReplaceVariablesWithValues(taskXmlModifyOriginal.NodeToChange, groupId); taskXmlModifyResolved.XmlPathAndFileName = Utility.ReplaceVariablesWithValues(taskXmlModifyOriginal.XmlPathAndFileName, groupId); return taskXmlModifyResolved; }
/// <summary> /// /// </summary> /// <param name="taskXmlModify"></param> public static void Save( TaskXmlModify taskXmlModify ) { ConvertNullPropertiesToEmptyStrings( taskXmlModify ); Data.SaveObject<TaskXmlModify>( taskXmlModify ); }
private static void ConvertNullPropertiesToEmptyStrings( TaskXmlModify taskXmlModify ) { // Two of the properties can be null, but the DB doesn't allow nulls, so make them an empty string. if( taskXmlModify.AttributeKey == null ) { taskXmlModify.AttributeKey = string.Empty; } if( taskXmlModify.AttributeKeyValue == null ) { taskXmlModify.AttributeKeyValue = string.Empty; } }