Esempio n. 1
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));
        }
Esempio n. 2
0
        public ServiceResult DeleteFinanceAccountTransactionBy(string uuid)
        {
            if (string.IsNullOrWhiteSpace(uuid))
            {
                return(ServiceResponse.Error("Invalid id."));
            }

            FinanceAccountTransactionsManager fm = new FinanceAccountTransactionsManager(Globals.DBConnectionKey, Request.Headers?.Authorization?.Parameter);
            FinanceAccountTransaction         c  = (FinanceAccountTransaction)fm.GetBy(uuid);

            if (c == null)
            {
                return(ServiceResponse.Error("Invalid uuid"));
            }

            return(fm.Delete(c));
        }