예제 #1
0
        public AccountServiceResponse InnerExecute(Func <IAccountDealService, AccountServiceResponse> func)
        {
            try
            {
                var database = new Database("ecard");
                using (var instance = new DatabaseInstance(database))
                {
                    instance.BeginTransaction();
                    IAccountDealService accountDealService = GetAccountDealService(instance);

                    AccountServiceResponse rsp = func(accountDealService);
                    if (rsp.Code == ResponseCode.Success)
                    {
                        instance.Commit();
                    }
                    return(rsp);
                }
            }
            catch (Exception ex)
            {
                Log.Error("error", ex);
                return(new AccountServiceResponse(ResponseCode.SystemError)
                {
                    CodeText = ex.Message
                });
            }
        }
예제 #2
0
 public I8638Context(IAccountDealService accountDealService)
 {
     _accountDealService = accountDealService;
 }