Ejemplo n.º 1
0
        public IHttpActionResult Puttb_EmpAdvance(int id, tb_EmpAdvance tb_EmpAdvance)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 2
0
        public IHttpActionResult Gettb_EmpAdvance(int id)
        {
            tb_EmpAdvance tb_EmpAdvance = db.tb_EmpAdvance.Find(id);

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

            return(Ok(tb_EmpAdvance));
        }
Ejemplo n.º 3
0
        public IHttpActionResult Posttb_EmpAdvance(tb_EmpAdvance tb_EmpAdvance)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tb_EmpAdvance.Add(tb_EmpAdvance);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tb_EmpAdvance.ID }, tb_EmpAdvance));
        }
Ejemplo n.º 4
0
        public IHttpActionResult Deletetb_EmpAdvance(int id)
        {
            tb_EmpAdvance tb_EmpAdvance = db.tb_EmpAdvance.Find(id);

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

            db.tb_EmpAdvance.Remove(tb_EmpAdvance);
            db.SaveChanges();

            return(Ok(tb_EmpAdvance));
        }