/// <summary> /// 对现货资金表添加一条增量数据,同时提交数据到数据库和内存 /// </summary> /// <param name="deltaInfo"></param> /// <returns></returns> public bool AddDelta(HK_CapitalAccount_DeltaInfo deltaInfo) { deltaInfo.DeltaTime = DateTime.Now; MemoryLog.WriteHKCapitalInfo(deltaInfo); return(AddChange(deltaInfo)); }
/// <summary> /// 先提交数据到数据库,成功后要调用AddDeltaToMemory方法 /// </summary> /// <param name="deltaInfo"></param> /// <param name="db"></param> /// <param name="transaction"></param> public void AddDeltaToDB(HK_CapitalAccount_DeltaInfo deltaInfo, Database db, DbTransaction transaction) { deltaInfo.DeltaTime = DateTime.Now; MemoryLog.WriteHKCapitalInfo(deltaInfo); AddChangeToDB(deltaInfo, db, transaction); }
/// <summary> /// 先要检查再添加 /// </summary> /// <param name="func"></param> /// <param name="deltaInfo"></param> /// <param name="db"></param> /// <param name="transaction"></param> /// <returns></returns> public bool CheckAndAddDelta(Func <HK_CapitalAccountInfo, HK_CapitalAccount_DeltaInfo, bool> func, HK_CapitalAccount_DeltaInfo deltaInfo, Database db, DbTransaction transaction) { deltaInfo.DeltaTime = DateTime.Now; bool isSuccess = CheckAndAddChange(func, deltaInfo, db, transaction); if (isSuccess) { MemoryLog.WriteHKCapitalInfo(deltaInfo); } return(isSuccess); }