/// <summary> /// 获取本机信息 /// </summary> /// <returns></returns> public static string GetPDAInfo(Enum_DicKey dicKey) { string number = null; string sql = "select detail from c2lp_dictionary where name = '" + dicKey.ToString() + "';"; try { object result = _SqlHelp.ExecuteScalar(sql, System.Data.CommandType.Text); if (result != null) { number = result.ToString(); } } catch { return(null); } return(number); }
/// <summary> /// 设置本机信息 /// </summary> public static void SetPDAInfo(Enum_DicKey dicKey, object value) { if (value == null) { return; } string sql = "delete from c2lp_dictionary where name='" + dicKey.ToString() + "';"; try { //_SqlHelp.ExecuteNonQuery(sql, System.Data.CommandType.Text); sql += "insert into c2lp_dictionary values('" + dicKey.ToString() + "','" + value + "')"; _SqlHelp.ExecuteNonQuery(sql, System.Data.CommandType.Text); } catch (Exception ex) { throw ex; } }
void Common_ValueChangeEvent(Enum_DicKey key, object value) { if (value == null) { return; } switch (key) { case Enum_DicKey.pdaNumber: value = value.ToString() == string.Empty ? _numberTitle : value; SetControlText(btnNumber, Common._PDANumber, true); break; case Enum_DicKey.storageName: value = value.ToString() == string.Empty ? _storageTitle : value; SetControlText(btnStorage, Common._StorageName, true); break; case Enum_DicKey.destination: value = value.ToString() == string.Empty ? _destinationTitle : value; SetControlText(btnDestination, Common._Destination, true); break; case Enum_DicKey.lastSyncTime: if (value.ToString() != string.Empty) { SetControlText(lblLastSyncTime, Common._LastSyncTime, false); } break; case Enum_DicKey.pdaId: break; default: break; } }