예제 #1
0
        public TelefoneTipoTransfer Incluir(TelefoneTipoTransfer telefoneTipoTransfer)
        {
            TelefoneTipoData     telefoneTipoData;
            TelefoneTipoTransfer telefoneTipo;

            try {
                telefoneTipoData = new TelefoneTipoData(_contexto);
                telefoneTipo     = new TelefoneTipoTransfer(telefoneTipoTransfer);

                telefoneTipoData.Incluir(telefoneTipoTransfer.TelefoneTipo);

                _contexto.SaveChanges();

                telefoneTipo.TelefoneTipo = new TelefoneTipoEntity(telefoneTipoTransfer.TelefoneTipo);
                telefoneTipo.Validacao    = true;
                telefoneTipo.Erro         = false;
            } catch (Exception ex) {
                telefoneTipo = new TelefoneTipoTransfer();

                telefoneTipo.Validacao = false;
                telefoneTipo.Erro      = true;
                telefoneTipo.IncluirMensagem("Erro em TelefoneTipoDataModel Incluir [" + ex.Message + "]");
            } finally {
                telefoneTipoData = null;
            }

            return(telefoneTipo);
        }
예제 #2
0
        public TelefoneTipoTransfer Consultar(TelefoneTipoTransfer telefoneTipoTransfer)
        {
            TelefoneTipoData     telefoneTipoData;
            TelefoneTipoTransfer telefoneTipoLista;

            try {
                telefoneTipoData = new TelefoneTipoData(_contexto);

                telefoneTipoLista           = telefoneTipoData.Consultar(telefoneTipoTransfer);
                telefoneTipoLista.Validacao = true;
                telefoneTipoLista.Erro      = false;
            } catch (Exception ex) {
                telefoneTipoLista = new TelefoneTipoTransfer();

                telefoneTipoLista.Validacao = false;
                telefoneTipoLista.Erro      = true;
                telefoneTipoLista.IncluirMensagem("Erro em TelefoneTipoDataModel Consultar [" + ex.Message + "]");
            } finally {
                telefoneTipoData = null;
            }

            return(telefoneTipoLista);
        }
예제 #3
0
        public TelefoneTipoTransfer ConsultarPorId(int id)
        {
            TelefoneTipoData     telefoneTipoData;
            TelefoneTipoTransfer telefoneTipo;

            try {
                telefoneTipoData = new TelefoneTipoData(_contexto);
                telefoneTipo     = new TelefoneTipoTransfer();

                telefoneTipo.TelefoneTipo = telefoneTipoData.ConsultarPorId(id);
                telefoneTipo.Validacao    = true;
                telefoneTipo.Erro         = false;
            } catch (Exception ex) {
                telefoneTipo = new TelefoneTipoTransfer();

                telefoneTipo.Validacao = false;
                telefoneTipo.Erro      = true;
                telefoneTipo.IncluirMensagem("Erro em TelefoneTipoDataModel ConsultarPorId [" + ex.Message + "]");
            } finally {
                telefoneTipoData = null;
            }

            return(telefoneTipo);
        }