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 UpdateTransaction(Transaction transaction)
        {
            int result = 0;

            try
            {
                dbContext.Transactions.Attach(transaction);
                dbContext.Entry(transaction).State = System.Data.Entity.EntityState.Modified;
                dbContext.SaveChanges();

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

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