Esempio n. 1
0
        public AtendimentoQueixasDTO Adicionar(AtendimentoQueixasDTO dto)
        {
            try
            {
                ComandText = "stp_CLI_ATENDIMENTO_QUEIXAS_ADICIONAR";

                AddParameter("ATENDIMENTO", dto.Atendimento);
                AddParameter("QUEIXA", dto.Queixa);
                AddParameter("DESCRICAO", dto.Descricao);
                AddParameter("TEMPO", dto.Tempo);
                AddParameter("UTILIZADOR", dto.Utilizador);

                ExecuteNonQuery();
                dto.Sucesso = true;
            }
            catch (Exception ex)
            {
                dto.Sucesso      = false;
                dto.MensagemErro = ex.Message.Replace("'", "");
            }
            finally
            {
                FecharConexao();
            }

            return(dto);
        }
Esempio n. 2
0
        public AtendimentoQueixasDTO ObterPorPK(AtendimentoQueixasDTO dto)
        {
            try
            {
                ComandText = "stp_CLI_ATENDIMENTO_QUEIXAS_OBTERPORPK";

                AddParameter("CODIGO", dto.Codigo);

                MySqlDataReader dr = ExecuteReader();

                dto = new AtendimentoQueixasDTO();

                if (dr.Read())
                {
                    dto.Codigo      = int.Parse(dr[0].ToString());
                    dto.Atendimento = int.Parse(dr[1].ToString());
                    dto.Queixa      = dr[2].ToString();
                    dto.Descricao   = dr[3].ToString();
                    dto.Tempo       = dr[4].ToString();
                }
            }
            catch (Exception ex)
            {
                dto.Sucesso      = false;
                dto.MensagemErro = ex.Message.Replace("'", "");
            }
            finally
            {
                FecharConexao();
            }

            return(dto);
        }
Esempio n. 3
0
        public AtendimentoQueixasDTO Eliminar(AtendimentoQueixasDTO dto)
        {
            try
            {
                ComandText = "stp_CLI_ATENDIMENTO_QUEIXAS_EXCLUIR";

                AddParameter("CODIGO", dto.Codigo);

                ExecuteNonQuery();
                dto.Sucesso = true;
            }
            catch (Exception ex)
            {
                dto.Sucesso      = false;
                dto.MensagemErro = ex.Message.Replace("'", "");
            }
            finally
            {
                FecharConexao();
            }

            return(dto);
        }
Esempio n. 4
0
        public List <AtendimentoQueixasDTO> ObterPorFiltro(AtendimentoQueixasDTO dto)
        {
            List <AtendimentoQueixasDTO> listaAtendimentoQueixass = new List <AtendimentoQueixasDTO>();

            try
            {
                ComandText = "stp_CLI_ATENDIMENTO_QUEIXAS_OBTERPORFILTRO";

                AddParameter("ATENDIMENTO", dto.Atendimento);

                MySqlDataReader dr = ExecuteReader();

                while (dr.Read())
                {
                    dto = new AtendimentoQueixasDTO();

                    dto.Codigo      = int.Parse(dr[0].ToString());
                    dto.Atendimento = int.Parse(dr[1].ToString());
                    dto.Queixa      = dr[2].ToString();
                    dto.Descricao   = dr[3].ToString();
                    dto.Tempo       = dr[4].ToString();

                    listaAtendimentoQueixass.Add(dto);
                }
            }
            catch (Exception ex)
            {
                dto.Sucesso      = false;
                dto.MensagemErro = ex.Message.Replace("'", "");
            }
            finally
            {
                FecharConexao();
            }

            return(listaAtendimentoQueixass);
        }
Esempio n. 5
0
 public AtendimentoQueixasDTO ObterPorPK(AtendimentoQueixasDTO dto)
 {
     return(dao.ObterPorPK(dto));
 }
Esempio n. 6
0
 public List <AtendimentoQueixasDTO> ObterPorFiltro(AtendimentoQueixasDTO dto)
 {
     return(dao.ObterPorFiltro(dto));
 }
Esempio n. 7
0
 public AtendimentoQueixasDTO Excluir(AtendimentoQueixasDTO dto)
 {
     return(dao.Eliminar(dto));
 }
Esempio n. 8
0
 public AtendimentoQueixasDTO Salvar(AtendimentoQueixasDTO dto)
 {
     return(dao.Adicionar(dto));
 }