コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TipoLotacao tipoLotacao = db.TipoLotacaos.Find(id);

            db.TipoLotacaos.Remove(tipoLotacao);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "TipoLotacaoId,Nome,Observacao")] TipoLotacao tipoLotacao)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tipoLotacao).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tipoLotacao));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "TipoLotacaoId,Nome,Observacao")] TipoLotacao tipoLotacao)
        {
            if (ModelState.IsValid)
            {
                db.TipoLotacaos.Add(tipoLotacao);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tipoLotacao));
        }
コード例 #4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TipoLotacao tipoLotacao = db.TipoLotacaos.Find(id);

            if (tipoLotacao == null)
            {
                return(HttpNotFound());
            }
            return(View(tipoLotacao));
        }
コード例 #5
0
        public ActionResult ConfirmarEncaminhamento(int?id)
        {
            try
            {
                Secretaria sec = db.Secretarias.Find(id);
                ViewBag.nomeSec = sec.Nome;
                ViewBag.idSec   = id;



                ViewBag.tipoLotacaoId = TempData["tipoLotacaoId"];
                TipoLotacao lot = db.TipoLotacaos.Find(ViewBag.tipoLotacaoId);
                ViewBag.nomeLot = lot.Nome;



                ViewBag.idTer = TempData["idTer"];
                Terceirizado ter = db.Terceirizadoes.Find(ViewBag.idTer);
                ViewBag.nomeTer         = ter.Nome;
                ViewBag.cpfTer          = ter.Cpf;
                ViewBag.dataAdmissaoTer = ter.DataAdmissao;
                ViewBag.telefoneTer     = ter.Telefone;
                ViewBag.presTer         = ter.PrestadoraServicoId;
                ViewBag.cargoIdTer      = ter.CargoId;
                ViewBag.ocorrenciaIdTer = ter.OcorrenciaId;

                Encaminhamento enc = new Encaminhamento();
                enc.TerceirizadoId = ViewBag.idTer;
                enc.Data           = DateTime.Now;
                ViewBag.DataEnc    = enc.Data;
                enc.TipoLotacaoId  = ViewBag.tipoLotacaoId;
                enc.LotacaoId      = ViewBag.idSec;

                return(View(enc));
            }
            catch (Exception)
            {
                return(View("Index"));
            }
        }
コード例 #6
0
        public ActionResult ImprimirCarta(int?id)
        {
            Encaminhamento enc       = db.Encaminhamentoes.Find(id);
            int            lotacaoId = enc.LotacaoId;

            ViewBag.idTer   = enc.TerceirizadoId;
            ViewBag.dataEnc = enc.Data;

            Terceirizado ter = db.Terceirizadoes.Find(enc.TerceirizadoId);

            ViewBag.nomeTer = ter.Nome;

            TipoLotacao lot = db.TipoLotacaos.Find(enc.TipoLotacaoId);

            ViewBag.tipoLot = lot.Nome;

            if (lot.Nome == "Secretaria")
            {
                Secretaria sec = db.Secretarias.Find(lotacaoId);
                ViewBag.nomeLot = sec.Nome;
            }
            else if (lot.Nome == "Prefeitura Bairro")
            {
                PrefeituraBairro pre = db.PrefeituraBairroes.Find(lotacaoId);
                ViewBag.nomeLot = pre.Nome;
            }
            else if (lot.Nome == "GRE")
            {
                Gre gre = db.Gres.Find(lotacaoId);
                ViewBag.nomeLot = gre.Regional;
            }
            else if (lot.Nome == "Escola")
            {
                Escola escola = db.Escolas.Find(lotacaoId);
                ViewBag.nomeLot = escola.Nome;
            }
            return(View());
        }