public IHttpActionResult PutShiftLeaders(int id, ShiftLeaders shiftLeaders)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != shiftLeaders.Id)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            ShiftLeaders shiftLeaders = db.ShiftLeaders.Find(id);

            db.ShiftLeaders.Remove(shiftLeaders);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public IHttpActionResult PostShiftLeaders(ShiftLeaders shiftLeaders)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ShiftLeaders.Add(shiftLeaders);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = shiftLeaders.Id }, shiftLeaders));
        }
 public ActionResult Edit([Bind(Include = "Id,IdShiftLeader,IdCelula,Activo")] ShiftLeaders shiftLeaders)
 {
     if (ModelState.IsValid)
     {
         db.Entry(shiftLeaders).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdCelula      = new SelectList(db.BussinesUnits, "Id", "Nombre", shiftLeaders.IdCelula);
     ViewBag.IdShiftLeader = new SelectList(db.Personas, "Id", "Nombre", shiftLeaders.IdShiftLeader);
     return(View(shiftLeaders));
 }
        public IHttpActionResult DeleteShiftLeaders(int id)
        {
            ShiftLeaders shiftLeaders = db.ShiftLeaders.Find(id);

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

            db.ShiftLeaders.Remove(shiftLeaders);
            db.SaveChanges();

            return(Ok(shiftLeaders));
        }
        // GET: Seguridad/ShiftLeaders/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ShiftLeaders shiftLeaders = db.ShiftLeaders.Find(id);

            if (shiftLeaders == null)
            {
                return(HttpNotFound());
            }
            return(View(shiftLeaders));
        }
        // GET: Seguridad/ShiftLeaders/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ShiftLeaders shiftLeaders = db.ShiftLeaders.Find(id);

            if (shiftLeaders == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IdCelula      = new SelectList(db.BussinesUnits, "Id", "Nombre", shiftLeaders.IdCelula);
            ViewBag.IdShiftLeader = new SelectList(db.Personas, "Id", "Nombre", shiftLeaders.IdShiftLeader);
            return(View(shiftLeaders));
        }