コード例 #1
0
        public bool UpdateAllCheckSumWalletAccountByUserID(string pUserID)
        {
            var lstWalletAccount = new List <Wallet_Account>();
            var userLogic        = new WalletUserLogic(true);

            try
            {
                var logWallet = new LogWallet();
                WalletTransactionUow WalletTransactionUnitOfWork = null;
                using (WalletTransactionUnitOfWork = new WalletTransactionUow(new WalletEntities()))
                {
                    lstWalletAccount = WalletTransactionUnitOfWork.GetWalletAccountByUserID(pUserID);
                    var flg = false;
                    foreach (Wallet_Account walletAcc in lstWalletAccount)
                    {
                        //if (walletAcc.ChecksumAvailable2 == walletAcc.ChecksumAvailable1)
                        //{
                        walletAcc.ChecksumAvailable1 = BuildCheckSumAvailable1(walletAcc);
                        walletAcc.ChecksumAvailable2 = BuildCheckSumAvailable2(walletAcc);
                        walletAcc.ChecksumTotal1     = BuildCheckSumTotal1(walletAcc);
                        walletAcc.ChecksumTotal2     = BuildCheckSumTotal2(walletAcc);
                        flg = true;
                        //}
                    }
                    if (flg)
                    {
                        WalletTransactionUnitOfWork.DoUpdateMany(lstWalletAccount);
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                var logWallet = new LogWallet();
                Task.Factory.StartNew(() => logWallet.Log(MethodBase.GetCurrentMethod(), "", ex, ""));
                return(false);
            }
        }