Exemple #1
0
        public ServiceResult Update(FinanceAccountTransaction fat)
        {
            if (fat == null)
            {
                return(ServiceResponse.Error("Invalid FinanceAccountTransaction sent to server."));
            }

            FinanceAccountTransactionsManager financeManager = new FinanceAccountTransactionsManager(Globals.DBConnectionKey, this.GetAuthToken(Request));
            var res = financeManager.Get(fat.UUID);

            if (res.Code != 200)
            {
                return(res);
            }

            var dbS = (FinanceAccountTransaction)res.Result;

            if (dbS.DateCreated == DateTime.MinValue)
            {
                dbS.DateCreated = DateTime.UtcNow;
            }

            dbS.Name = fat.Name;

            dbS.Image     = fat.Image;
            dbS.Deleted   = fat.Deleted;
            dbS.Status    = fat.Status;
            dbS.SortOrder = fat.SortOrder;
            //FinanceAccountUUID
            //PayToAccountUUID
            // PayFromAccountUUID
            // CreationDate
            // CustomerIp
            //LastPaymentStatusCheck
            //    OrderUUID
            //    Amount
            //  TransactionType
            // TransactionDate
            // PaymentTypeUUID
            // AmountTransferred
            // SelectedPaymentTypeSymbol
            //SelectedPaymentTypeTotal
            //        UserUUID
            //        CustomerEmail
            // CurrencyUUID
            return(financeManager.Update(dbS));
        }
Exemple #2
0
        public ServiceResult Update(FinanceAccountTransaction fat)
        {
            if (fat == null)
            {
                return(ServiceResponse.Error("Invalid FinanceAccountTransaction sent to server."));
            }

            FinanceAccountTransactionsManager financeManager = new FinanceAccountTransactionsManager(Globals.DBConnectionKey, Request.Headers?.Authorization?.Parameter);

            var dbS = (FinanceAccountTransaction)financeManager.GetBy(fat.UUID);

            if (dbS == null)
            {
                return(ServiceResponse.Error("FinanceAccountTransaction was not found."));
            }

            if (dbS.DateCreated == DateTime.MinValue)
            {
                dbS.DateCreated = DateTime.UtcNow;
            }

            dbS.Name = fat.Name;

            dbS.Image     = fat.Image;
            dbS.Deleted   = fat.Deleted;
            dbS.Status    = fat.Status;
            dbS.SortOrder = fat.SortOrder;
            //FinanceAccountUUID
            //PayToAccountUUID
            // PayFromAccountUUID
            // CreationDate
            // CustomerIp
            //LastPaymentStatusCheck
            //    OrderUUID
            //    Amount
            //  TransactionType
            // TransactionDate
            // PaymentTypeUUID
            // AmountTransferred
            // SelectedPaymentTypeSymbol
            //SelectedPaymentTypeTotal
            //        UserUUID
            //        CustomerEmail
            // CurrencyUUID
            return(financeManager.Update(dbS));
        }