// POST api/PurchaseOrderDescription
        public HttpResponseMessage PostPurchaseOrderDescription(PurchaseOrderDescription purchaseorderdescription)
        {
            if (ModelState.IsValid)
            {
                //db.PurchaseOrderDescriptions.Add(purchaseorderdescription);
                purchaseorderdescription.InsertBy = loginUser.UserID;
                db.Entry(purchaseorderdescription).State = purchaseorderdescription.PurchaseOrderDescriptionID == 0 ?
                   EntityState.Added : EntityState.Modified;
                db.SaveChanges();

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, purchaseorderdescription);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = purchaseorderdescription.PurchaseOrderDescriptionID }));
                return response;
            }
            else
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }
        }
        // PUT api/PurchaseOrderDescription/5
        public HttpResponseMessage PutPurchaseOrderDescription(long id, PurchaseOrderDescription purchaseorderdescription)
        {
            if (!ModelState.IsValid)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }

            if (id != purchaseorderdescription.PurchaseOrderDescriptionID)
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
            purchaseorderdescription.UpdateBy = loginUser.UserID;

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

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                return Request.CreateErrorResponse(HttpStatusCode.NotFound, ex);
            }

            return Request.CreateResponse(HttpStatusCode.OK);
        }