private void otherDevSave(System.Collections.Generic.List <System.Collections.Hashtable> list) { foreach (System.Collections.Hashtable current in list) { string str_ip = (string)current["ip"]; string text = (string)current["devNm"]; string str_type = (string)current["type"]; string text2 = (string)current["devID"]; int i_usage = 0; System.Collections.Generic.List <Branch> list2 = new System.Collections.Generic.List <Branch>(); System.Collections.Generic.List <string> branchList = InSnergyService.GetBranchList(text2); foreach (string current2 in branchList) { System.Collections.Generic.List <SubMeter> list3 = new System.Collections.Generic.List <SubMeter>(); Branch item = new Branch(text2, current2, "", "", list3); list2.Add(item); System.Collections.Generic.List <string> meterList = InSnergyService.GetMeterList(text2, current2); foreach (string current3 in meterList) { SubMeter item2 = new SubMeter(text2, current2, current3, "", 0f, i_usage); list3.Add(item2); } } InSnergyGateway inSnergyGateway = new InSnergyGateway(text2, text, str_type, str_ip, list2); if (inSnergyGateway.Insert() > 0) { string valuePair = ValuePairs.getValuePair("Username"); if (!string.IsNullOrEmpty(valuePair)) { LogAPI.writeEventLog("0432010", new string[] { text, valuePair }); } else { LogAPI.writeEventLog("0432010", new string[] { text }); } InSnergyService.Manage(text2); } } }