public IHttpActionResult PutTransaction(int id, Transaction transaction)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != transaction.TransactionId)
            {
                return(BadRequest());
            }

            db.Entry(transaction).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TransactionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public HttpResponseMessage SaveTransaction(Transaction transaction)
        {
            int result = 0;

            try
            {
                dbContext.Transactions.Add(transaction);
                dbContext.SaveChanges();

                result = 1;
            }
            catch (Exception e)
            {
                result = 0;
            }

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }