private void AddTransactions(StringBuilder contentBuilder, Hashtable transactions)
{
string app_id;
//string client_ip;
string timestamp;
Hashtable obj;
Hashtable usage;
foreach (DictionaryEntry entri in transactions)
{
app_id = null;
//client_ip = null;
timestamp = null;
obj = null;
usage = null;
obj = (Hashtable)entri.Value;
app_id = (string)obj["app_id"];
string user_key = (string)obj["user_key"];
//client_ip = (string)obj["client_ip"];
timestamp = (string)obj["timestamp"];
usage = (Hashtable)obj["usage"];
//if ((app_id == null) || (app_id.Length <= 0)) throw new ApiException("argument error: undefined transaction, app_id is missing in one record");
if ((usage == null) || (usage.Count <= 0)) throw new ApiException("argument error: undefined transaction, usage is missing in one record");
if ((timestamp!=null) && (timestamp.Length <=0)) timestamp=null;
if ((app_id!=null) && (app_id.Length>0)) {
contentBuilder.AppendFormat("&transactions[{0}][{1}]={2}",entri.Key,"app_id",app_id);
}
if ((user_key!=null) && (user_key.Length>0)) {
contentBuilder.AppendFormat("&transactions[{0}][{1}]={2}", entri.Key, "user_key", user_key);
}
if(timestamp != null)
{
contentBuilder.AppendFormat("&transactions[{0}][{1}]={2}", entri.Key, "timestamp", timestamp);
}
foreach (DictionaryEntry entri_usage in usage)
{
contentBuilder.AppendFormat("&transactions[{0}][{1}][{2}]={3}",entri.Key,"usage",entri_usage.Key,entri_usage.Value);
}
}
}