Exemple #1
0
        public IHttpActionResult Puttbl_UserCheckInOut(string id, tbl_UserCheckInOut tbl_UserCheckInOut)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemple #2
0
        public IHttpActionResult Posttbl_UserCheckInOut(tbl_UserCheckInOut tbl_UserCheckInOut)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tbl_UserCheckInOut.Add(tbl_UserCheckInOut);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (tbl_UserCheckInOutExists(tbl_UserCheckInOut.UserCheckInOut_ID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = tbl_UserCheckInOut.UserCheckInOut_ID }, tbl_UserCheckInOut));
        }
Exemple #3
0
        public IHttpActionResult Gettbl_UserCheckInOut(string id)
        {
            tbl_UserCheckInOut tbl_UserCheckInOut = db.tbl_UserCheckInOut.Find(id);

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

            return(Ok(tbl_UserCheckInOut));
        }
Exemple #4
0
        public IHttpActionResult Deletetbl_UserCheckInOut(string id)
        {
            tbl_UserCheckInOut tbl_UserCheckInOut = db.tbl_UserCheckInOut.Find(id);

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

            db.tbl_UserCheckInOut.Remove(tbl_UserCheckInOut);
            db.SaveChanges();

            return(Ok(tbl_UserCheckInOut));
        }