Exemplo n.º 1
0
        public bool Excluir(int id)
        {
            bool existente = _telefoneService.Find(e => e.TelefoneId == id).Any();

            if (existente)
            {
                BeginTransaction();
                var tipoTelefone = _telefoneService.ObterPorId(id);
                tipoTelefone.Delete = true;
                _telefoneService.Atualizar(tipoTelefone);
                Commit();
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        // GET: Telefone/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Telefone telefone = _service.ObterPorId(Convert.ToInt32(id));

            if (telefone == null)
            {
                return(HttpNotFound());
            }
            return(View(telefone));
        }
 public Telefone ObterPorId(Guid id)
 {
     return(_telefoneService.ObterPorId(id));
 }