Пример #1
0
        public List<FormaPagamentoDTO> GetAll()
        {
            List<FormaPagamentoDTO> paymntMehtodList = new List<FormaPagamentoDTO>();

            FbCommand command = new FbCommand("SELECT * FROM IFORMAPAGTO", firebirdConnection);
            FbDataReader dataReader = command.ExecuteReader();
            while (dataReader.Read())
            {
                FormaPagamentoDTO paymntMehtod = new FormaPagamentoDTO();
                paymntMehtod.codigo = GetStringValue(dataReader, "CDFORMAPAGTO");
                paymntMehtod.nome = GetStringValue(dataReader, "NMFORMAPAGTO");
                paymntMehtod.atualizadoEm = ConvertDateTime(GetStringValue(dataReader, "ATUALIZADO"));
                paymntMehtod.boleto = GetBooleanValue(dataReader, "TFBOLETO");
                paymntMehtod.ECFbaixaRec = GetBooleanValue(dataReader, "TFECFBAIXAREC");
                paymntMehtod.parcelar = GetBooleanValue(dataReader, "TFPARCELAR");
                paymntMehtod.formaPagamentoECF = GetStringValue(dataReader, "CDFORMAPAGTOECF");

                paymntMehtodList.Add(paymntMehtod);
            }
            dataReader.Close();

            return paymntMehtodList;
        }
        public void Delete(FormaPagamentoDTO obj)
        {
            var filter = Builders <FormaPagamentoDTO> .Filter.Eq(f => f.Id, obj.Id);

            mongoDBContext.FormasPagamento.DeleteOne(filter);
        }
        public void Update(FormaPagamentoDTO obj)
        {
            var filter = Builders <FormaPagamentoDTO> .Filter.Eq(f => f.Id, obj.Id);

            mongoDBContext.FormasPagamento.ReplaceOne(filter, obj);
        }
 public void Add(FormaPagamentoDTO obj)
 {
     mongoDBContext.FormasPagamento.InsertOne(obj);
 }