public IHttpActionResult PostReturnNoteItem(ReturnNoteItem returnNoteItem)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ReturnNoteItems.Add(returnNoteItem);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (ReturnNoteItemExists(returnNoteItem.ReturnNoteItemID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = returnNoteItem.ReturnNoteItemID }, returnNoteItem));
        }
        public IHttpActionResult PutReturnNoteItem(string id, ReturnNoteItem returnNoteItem)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult GetReturnNoteItem(string id)
        {
            ReturnNoteItem returnNoteItem = db.ReturnNoteItems.Find(id);

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

            return(Ok(returnNoteItem));
        }
        public IHttpActionResult DeleteReturnNoteItem(string id)
        {
            ReturnNoteItem returnNoteItem = db.ReturnNoteItems.Find(id);

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

            db.ReturnNoteItems.Remove(returnNoteItem);
            db.SaveChanges();

            return(Ok(returnNoteItem));
        }