/// <summary> /// Prenche um controle ComboBox com os tipos de pagamentos /// </summary> /// <param name="pComboBox">ComboBox a ser preenchido</param> /// <param name="pItemTodos">Indica se serár exibido todos ou selecione como primeiro index.</param> public static void PreencherDropDownFormasPagamentos(ComboBox pComboBox, bool pItemTodos) { TipoPagamentoCTRL tipoPagamentoCTRL = new TipoPagamentoCTRL(); List <TipoPagamentoOT> tipoPagamentoList = (List <TipoPagamentoOT>)tipoPagamentoCTRL.ConsultarTodos().ListaObjetos; if (tipoPagamentoList != null) { TipoPagamentoOT novoItem = new TipoPagamentoOT(); if (pItemTodos) { novoItem.Nome = " -- TODOS -- "; novoItem.Codigo = -1; } else { novoItem.Nome = " -- SELECIONE -- "; novoItem.Codigo = -2; } tipoPagamentoList.Insert(0, novoItem); pComboBox.DataSource = tipoPagamentoList; pComboBox.DisplayMember = "Nome"; pComboBox.ValueMember = "CodigoFP"; } }
public override ResultadoOperacao ConsultarTodos() { this._tipoPagamentoOT = new TipoPagamentoOT(); base.ResultadoOperacao = this._tipoPagamentoN.Consultar(this._tipoPagamentoOT); base.ResultadoOperacao.TipoOperacao = Enumeradores.TipoOperacao.Consulta; return(base.ResultadoOperacao); }
/// <summary> /// Construtor a classe /// </summary> /// <param name="pTipoPagamentoOT">Objeto de transferência TipoPagamentoOT</param> public TipoPagamentoCTRL(TipoPagamentoOT pTipoPagamentoOT) { this._tipoPagamentoOT = pTipoPagamentoOT; this._tipoPagamentoN = new TipoPagamentoN(); }