Exemple #1
0
        public IHttpActionResult Puttb_EmpPromotion(int id, tb_EmpPromotion tb_EmpPromotion)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemple #2
0
        public IHttpActionResult Gettb_EmpPromotion(int id)
        {
            tb_EmpPromotion tb_EmpPromotion = db.tb_EmpPromotion.Find(id);

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

            return(Ok(tb_EmpPromotion));
        }
Exemple #3
0
        public IHttpActionResult Posttb_EmpPromotion(tb_EmpPromotion tb_EmpPromotion)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tb_EmpPromotion.Add(tb_EmpPromotion);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tb_EmpPromotion.ID }, tb_EmpPromotion));
        }
Exemple #4
0
        public IHttpActionResult Deletetb_EmpPromotion(int id)
        {
            tb_EmpPromotion tb_EmpPromotion = db.tb_EmpPromotion.Find(id);

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

            db.tb_EmpPromotion.Remove(tb_EmpPromotion);
            db.SaveChanges();

            return(Ok(tb_EmpPromotion));
        }