Example #1
0
        public object Post(UserAddTransactionRequestTep request)
        {
            var        context = TepWebContext.GetWebContext(PagePrivileges.AdminOnly);
            WebUserTep result;

            try {
                context.Open();
                context.LogInfo(this, string.Format("/transaction/user POST Identifier='{0}', Balance='{1}'", request.Identifier, request.Balance));

                UserTep user = UserTep.FromIdentifier(context, request.Identifier);
                user.AddAccountingTransaction(request.Balance, (TransactionKind)request.Kind);

                result = new WebUserTep(context, user);
                context.Close();
            } catch (Exception e) {
                context.LogError(this, e.Message, e);
                context.Close();
                throw e;
            }
            return(result);
        }