public void Update(SystemProfileCategory category, SystemProfileKey key, string value) { var iRnt = 0; iRnt = DBHelper.GetInstance(mContext).ExecuteSql(string.Format("update _systemprofile set _value='{0}' where _category='{1}' and _key='{2}'", value, category, key)); if (iRnt == 0) { throw new FinanceException(FinanceResult.RECORD_NOT_EXIST); } }
public long GetLong(SystemProfileCategory category, SystemProfileKey key) { long result = 0; if (!long.TryParse(GetString(category, key), out result)) { throw new FinanceException(FinanceResult.IMPERFECT_DATA); } return(result); }
public int GetInt(SystemProfileCategory category, SystemProfileKey key) { int result = 0; if (!int.TryParse(GetString(category, key), out result)) { throw new FinanceException(FinanceResult.IMPERFECT_DATA); } return(result); }
public SystemProfile Find(SystemProfileCategory category, SystemProfileKey key) { var dt = DBHelper.GetInstance(mContext).ExecuteDt(string.Format("select * from _systemprofile where _category='{0}' and _key='{1}'", category, key)); if (dt == null || dt.Rows.Count == 0) { throw new FinanceException(FinanceResult.RECORD_NOT_EXIST); } var rsp = EntityConvertor <SystemProfile> .ToEntity(dt.Rows[0]); return(rsp); }
public void Update(dynamic tranc, SystemProfileCategory category, SystemProfileKey key, object value) { var sql = string.Format("update _systemprofile set _value='{0}' where _category='{1}' and _key='{2}'", value, category, key); DBHelper.GetInstance(mContext).ExecuteSql(tranc, sql); }
public string GetString(SystemProfileCategory category, SystemProfileKey key) { return(Find(category, key).value); }