public string GenerateNewTransaction_Interest_Snapshot(WalletEntities newWalletEntities, string Tran_ID, decimal Interest_Amount, string AccID, decimal totalamount, string remarks) { try { var Tran_interest = new Transaction_Interest_Snapshot(); Tran_interest.ID = Guid.NewGuid().ToString(); Tran_interest.Account_ID = AccID; Tran_interest.Tran_ID = Tran_ID; Tran_interest.Interest_Amount = ConvertUtility.RoundToTwoDecimalPlaces(Interest_Amount); Tran_interest.Total_Amount = ConvertUtility.RoundToTwoDecimalPlaces(totalamount); Tran_interest.Createdate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); Tran_interest.Remark = remarks; Tran_interest.CheckSumInterest = BuildCheckSum_SnapshotInterest(Tran_interest); using (var eWalletTransactionUnitOfWork = new WalletTransactionUow(newWalletEntities)) { eWalletTransactionUnitOfWork.BeginTransaction().DoInsert(Tran_interest).EndTransaction(); } return(Tran_interest.ID); } catch (Exception ex) { var logWallet = new LogWallet(); logWallet.Log(MethodBase.GetCurrentMethod(), Tran_ID, ex, ""); return(""); } }
public string BuildCheckSum_SnapshotInterest(Transaction_Interest_Snapshot InterestTran) { string checkSum = SecurityLogic.GetSha1Hash(InterestTran.ID + "|" + InterestTran.Account_ID + "|" + InterestTran.Createdate.ToString("yyyy-MM-dd HH:mm:ss") + "|" + InterestTran.Total_Amount + "|" + InterestTran.Interest_Amount + "|" + EwalletConstant.WebserverKey); return(checkSum); }