private JavaScriptObject DeviceTypeCodeInfoToJson(DeviceTypeCode uni) { JavaScriptObject obj2 = new JavaScriptObject(); obj2["ID"] = uni.Id; obj2["K"] = uni.k; //obj2["定额方式ID"] = uni.ModeId; obj2["V"] = uni.v; return(obj2); }
public static void LoadDeviceTypeCodeInfos() { ModelHandler <DeviceTypeCode> modelHandler = new ModelHandler <DeviceTypeCode>(); _DeviceTypeCodeInfos.Clear(); DataTable table = new DataTable(); string strSql = "select * from DeviceTypeCode"; table = DbHelperSQL.Query(strSql).Tables[0]; for (int i = 0; i < table.Rows.Count; i++) { DeviceTypeCode deviceTypeCode = modelHandler.FillModel(table.Rows[i]); if (!_DeviceTypeCodeInfos.ContainsKey(deviceTypeCode.Id)) { _DeviceTypeCodeInfos.Add(deviceTypeCode.Id, deviceTypeCode); } else { _DeviceTypeCodeInfos[deviceTypeCode.Id] = deviceTypeCode; } } }