public ActionResult DeleteConfirmed(int id)
        {
            LinhaMovel linhaMovel = db.LinhasMoveis.Find(id);

            db.LinhasMoveis.Remove(linhaMovel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        // GET: LinhasMoveis/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LinhaMovel linhaMovel = db.LinhasMoveis.Find(id);

            if (linhaMovel == null)
            {
                return(HttpNotFound());
            }
            return(View(linhaMovel));
        }
 public ActionResult Edit([Bind(Include = "Id,LocalSiteId,FuncionarioUPI,DataAssociacao,DataLiberacao,MotivoLiberacao,TermoResponsabilidade,LinhaNo,ChipId,CodigoDddId,TipoLinhaId,TipoPlanoMovelId,StatusLinhaId")] LinhaMovel linhaMovel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(linhaMovel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FuncionarioUPI   = new SelectList(db.Funcionarios, "UPI", "Nome", linhaMovel.FuncionarioUPI);
     ViewBag.LocalSiteId      = new SelectList(db.LocalSites, "Id", "Nome", linhaMovel.LocalSiteId);
     ViewBag.CodigoDddId      = new SelectList(db.CodigosDdd, "Id", "DddCodigo", linhaMovel.CodigoDddId);
     ViewBag.StatusLinhaId    = new SelectList(db.StatusLinhas, "Id", "Descricao", linhaMovel.StatusLinhaId);
     ViewBag.TipoLinhaId      = new SelectList(db.TiposLinhas, "Id", "Descricao", linhaMovel.TipoLinhaId);
     ViewBag.TipoPlanoMovelId = new SelectList(db.TiposPlanosMoveis, "Id", "Descricao", linhaMovel.TipoPlanoMovelId);
     return(View(linhaMovel));
 }
        // GET: LinhasMoveis/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LinhaMovel linhaMovel = db.LinhasMoveis.Find(id);

            if (linhaMovel == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FuncionarioUPI   = new SelectList(db.Funcionarios, "UPI", "Nome", linhaMovel.FuncionarioUPI);
            ViewBag.LocalSiteId      = new SelectList(db.LocalSites, "Id", "Nome", linhaMovel.LocalSiteId);
            ViewBag.CodigoDddId      = new SelectList(db.CodigosDdd, "Id", "DddCodigo", linhaMovel.CodigoDddId);
            ViewBag.StatusLinhaId    = new SelectList(db.StatusLinhas, "Id", "Descricao", linhaMovel.StatusLinhaId);
            ViewBag.TipoLinhaId      = new SelectList(db.TiposLinhas, "Id", "Descricao", linhaMovel.TipoLinhaId);
            ViewBag.TipoPlanoMovelId = new SelectList(db.TiposPlanosMoveis, "Id", "Descricao", linhaMovel.TipoPlanoMovelId);
            return(View(linhaMovel));
        }