public PedidoModel() { CodPedidoCompra = 0; Fornecedor = new FornecedorVO(); DataEmissao = DateTime.Now; PrazoEntrega = new PrazoEntregaVO(); CondicaoFornecimento = String.Empty; Observacao = String.Empty; FormaPgto = new FormaPgtoVO(); TipoRetirada = 0; FuncionarioAprovador = new FuncionarioVO(); FuncionarioComprador = new FuncionarioVO(); DataCadastro = null; DataPrazoEntrega = null; UsuarioInc = null; DataAlteracao = null; UsuarioAlt = null; }
/// <summary> /// Método para executar a proc pr_selecionar_cargo /// Objeto/Parâmetros: (codFormaPgto) /// Se for passado null no valores ele lista todos os dados /// </summary> public List<FormaPgtoVO> Listar(int? codFormaPgto) { OpenCommand("pr_selecionar_formapgto"); try { // Parâmetros de entrada AddInParameter("@CodFormaPgto", DbType.Int32, codFormaPgto); List<FormaPgtoVO> lstFormaPgtoVO = new List<FormaPgtoVO>(); IDataReader dr = ExecuteReader(); try { while (dr.Read()) { FormaPgtoVO formaPgtoVO = new FormaPgtoVO(); formaPgtoVO.CodFormaPgto = GetReaderValue<short?>(dr, "CodFormaPgto"); formaPgtoVO.Descricao = GetReaderValue<string>(dr, "Descricao"); formaPgtoVO.Parcela = GetReaderValue<int>(dr, "Intervalo"); formaPgtoVO.Intervalo = GetReaderValue<int>(dr, "Parcela"); formaPgtoVO.DataCadastro = GetReaderValue<DateTime>(dr, "DataCadastro"); formaPgtoVO.UsuarioInc = GetReaderValue<int>(dr, "UsuarioInc"); formaPgtoVO.DataAlteracao = GetReaderValue<DateTime>(dr, "DataAlteracao"); formaPgtoVO.UsuarioAlt = GetReaderValue<int>(dr, "UsuarioAlt"); lstFormaPgtoVO.Add(formaPgtoVO); } } finally { dr.Close(); } return lstFormaPgtoVO; } finally { CloseCommand(); } }
// ------------------------------------------------------------------------- // #endregion #region Métodos de Inclusão /// <summary> /// Método para incluir um registro na tabela Cargo /// Objeto/Parâmetros: (formaPgtoVo, codUsuarioOperacao) /// Valores: formaPgtoVO.Descricao, /// formaPgtoVO.Parcela, /// formaPgtoVO.Intervalo, /// codUsuarioOperacao /// </summary> public int Incluir(FormaPgtoVO formaPgtoVO, int codUsuarioOperacao) { OpenCommand("pr_incluir_FormaPgto", true); try { // Parâmetros de entrada AddInParameter("@Descricao", DbType.String, formaPgtoVO.Descricao); AddInParameter("@Parcela", DbType.Int32, formaPgtoVO.Parcela); AddInParameter("@Intervalo", DbType.Int32, formaPgtoVO.Intervalo); AddInParameter("@UsuarioInc", DbType.Int32, codUsuarioOperacao); ExecuteNonQuery(); int chaveGerada = GetReturnValue(); return chaveGerada; } finally { CloseCommand(); } }
protected void grdListaResultado_RowCommand(object sender, GridViewCommandEventArgs e) { FormaPgtoVO identFormaPgto = new FormaPgtoVO(); identFormaPgto.CodFormaPgto = Convert.ToInt16(e.CommandArgument); if (e.CommandName == "Excluir") { new Business.FormaPgto().Excluir(identFormaPgto.CodFormaPgto,UsuarioAtivo.CodFuncionario.Value); Pesquisar(); } else if (e.CommandName == "Editar") { hdfTipoAcao.Value = "Editar"; DadosFormaPgto = new Business.FormaPgto().ListarPorCodigo(identFormaPgto.CodFormaPgto)[0]; Master.PosicionarFoco(txtDescricao); mpeIncluirFormaPgto.Show(); } }
public string[] GetCondicoesPgto(string prefixText) { FormaPgtoVO identFormaPgtoVo = new FormaPgtoVO(); //Todo: Depois do tratamento na procedure, remover a linha abaixo identFormaPgtoVo.Descricao = prefixText; List<FormaPgtoVO> lstFormaPgtoVo = new FormaPgto().ListarPorDescricao(prefixText); List<string> items = new List<string>(); foreach (FormaPgtoVO item in lstFormaPgtoVo) { items.Add(AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem( item.Descricao, item.CodFormaPgto.ToString())); } return items.ToArray(); }
// ------------------------------------------------------------------------- // /// <summary> /// Método para alterar um registro na tabela Cargo /// Objeto/Parâmetros: (formaPgtoVO, codUsuarioOperacao) /// Valores: formaPgtoVO.CodFormaPgto, /// formaPgtoVO.Descricao, /// formaPgtoVO.Parcela, /// codUsuarioOperacao /// </summary> public void Alterar(FormaPgtoVO formaPgtoVO, int codUsuarioOperacao) { new FormaPgtoData().Alterar(formaPgtoVO, codUsuarioOperacao); }
// ------------------------------------------------------------------------- // #endregion #region Métodos de Inclusão /// <summary> /// Método para incluir um registro na tabela Cargo /// Objeto/Parâmetros: (formaPgtoVo, codUsuarioOperacao) /// Valores: formaPgtoVO.Descricao, /// formaPgtoVO.Parcela, /// formaPgtoVO.Intervalo, /// codUsuarioOperacao /// </summary> public int Incluir(FormaPgtoVO formaPgtoVO, int codUsuarioOperacao) { return new FormaPgtoData().Incluir(formaPgtoVO, codUsuarioOperacao); }
// ------------------------------------------------------------------------- // /// <summary> /// Método para alterar um registro na tabela Cargo /// Objeto/Parâmetros: (formaPgtoVO, codUsuarioOperacao) /// Valores: formaPgtoVO.CodFormaPgto, /// formaPgtoVO.Descricao, /// formaPgtoVO.Parcela, /// codUsuarioOperacao /// </summary> public void Alterar(FormaPgtoVO formaPgtoVO, int codUsuarioOperacao) { OpenCommand("pr_alterar_FormaPgto"); try { // Parâmetros de entrada AddInParameter("@CodFormaPgto", DbType.Int16, formaPgtoVO.CodFormaPgto); AddInParameter("@Descricao", DbType.String, formaPgtoVO.Descricao); AddInParameter("@Parcela", DbType.Int32, formaPgtoVO.Parcela); AddInParameter("@Intervalo", DbType.Int32, formaPgtoVO.Intervalo); AddInParameter("@UsuarioAlt", DbType.Int32, codUsuarioOperacao); ExecuteNonQuery(); } finally { CloseCommand(); } }