/// <summary> /// Inserts result step. /// </summary> /// <param name="dto">The DTO object.</param> /// <exception cref="System.ArgumentNullException"></exception> /// <exception cref="System.ArgumentException">The input DTO is null.</exception> public void InsertResultStep(ResultStepDto dto) { if (dto == null) throw new ArgumentNullException(string.Format(CultureInfo.InvariantCulture, Resources.NullArguementException, "dto")); const string CommandText = @" INSERT INTO stepResult ( FieldId, ChoiceFieldGuid ) VALUES ( @fieldId, @choiceFieldGuid )"; using (var cmd = new SqlCommand(CommandText)) { cmd.Parameters.AddWithValue("@fieldId", dto.FieldId); cmd.Parameters.AddWithValue("@choiceFieldGuid", dto.ChoiceFieldGuid); Database.Execute(cmd); } }
/// <summary> /// Deletes result step. /// </summary> /// <param name="dto">The DTO object.</param> /// <exception cref="System.ArgumentNullException"></exception> /// <exception cref="System.ArgumentException">The input DTO is null.</exception> public void DeleteResultStep(ResultStepDto dto) { if (dto == null) throw new ArgumentNullException(string.Format(CultureInfo.InvariantCulture, Resources.NullArguementException, "dto")); const string CommandText = "DELETE FROM stepResult WHERE FieldId = @fieldId"; using (var cmd = new SqlCommand(CommandText)) { cmd.Parameters.AddWithValue("@fieldId", dto.FieldId); Database.Execute(cmd); } }