public IHttpActionResult PutTrunsaction(int id, Trunsaction trunsaction)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult GetTrunsaction(int id)
        {
            Trunsaction trunsaction = db.Trunsactions.Find(id);

            if (trunsaction == null)
            {
                return(NotFound());
            }

            return(Ok(trunsaction));
        }
        public IHttpActionResult PostTrunsaction(Trunsaction trunsaction)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Trunsactions.Add(trunsaction);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = trunsaction.id }, trunsaction));
        }
        public IHttpActionResult DeleteTrunsaction(int id)
        {
            Trunsaction trunsaction = db.Trunsactions.Find(id);

            if (trunsaction == null)
            {
                return(NotFound());
            }

            db.Trunsactions.Remove(trunsaction);
            db.SaveChanges();

            return(Ok(trunsaction));
        }