Unfortunately there's no easy way to do this without diving into reflection. I would recommend either accessing the
ArrayList
directly to access each of the values, or a better alternative might be to just create an intermediary class holding all of the values?
public class Data {
public string Value1 { get; set; }
public string Value2 { get; set; }
public int Value3 { get; set; }
}
You can then pass an instance of that object into the methods and have access to all of the relevant fields:
var data = new Data
{
Value1 = ..,
Value2 = ..
};
if (..)
insert_data(data);
else
update_data(ID, data);