// PUT api/LibraryUser/5
        public HttpResponseMessage PutLibraryUser(int id, LibraryUser libraryuser)
        {
            if (!ModelState.IsValid)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }

            if (id != libraryuser.L_id)
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }

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

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

            return Request.CreateResponse(HttpStatusCode.OK);
        }
        // POST api/LibraryUser
        public HttpResponseMessage PostLibraryUser(LibraryUser libraryuser)
        {
            if (ModelState.IsValid)
            {

                libraryuser.L_registerDatetime = DateTime.Now;
                libraryuser.L_isBan = false;
                libraryuser.L_accessRight = "100";

                db.LibraryUsers.Add(libraryuser);
                db.SaveChanges();

                try
                {
                    libraryuser.L_cardID =  DateTime.Now.Year.ToString() + "LS" + libraryuser.L_id.ToString();
                    db.Entry(libraryuser).State = EntityState.Modified;
                    db.SaveChanges();
                }
                catch (DbUpdateConcurrencyException ex)
                {
                    return Request.CreateErrorResponse(HttpStatusCode.NotFound, ex);
                }

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, libraryuser);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = libraryuser.L_id }));
                return response;
            }
            else
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }
        }