/// <summary>
 /// Create a new PRODUTO_TAXA object.
 /// </summary>
 /// <param name="iD_PRODUTO_TAXA">Initial value of the ID_PRODUTO_TAXA property.</param>
 /// <param name="iD_PRODUTO">Initial value of the ID_PRODUTO property.</param>
 /// <param name="iD_TAXA">Initial value of the ID_TAXA property.</param>
 /// <param name="nUM_VALOR">Initial value of the NUM_VALOR property.</param>
 /// <param name="oRD_PRIORIDADE">Initial value of the ORD_PRIORIDADE property.</param>
 /// <param name="lOGIN_USUARIO">Initial value of the LOGIN_USUARIO property.</param>
 /// <param name="dATA_ATUALIZACAO">Initial value of the DATA_ATUALIZACAO property.</param>
 public static PRODUTO_TAXA CreatePRODUTO_TAXA(global::System.Guid iD_PRODUTO_TAXA, global::System.Guid iD_PRODUTO, global::System.Guid iD_TAXA, global::System.Decimal nUM_VALOR, global::System.Int16 oRD_PRIORIDADE, global::System.String lOGIN_USUARIO, global::System.DateTime dATA_ATUALIZACAO)
 {
     PRODUTO_TAXA pRODUTO_TAXA = new PRODUTO_TAXA();
     pRODUTO_TAXA.ID_PRODUTO_TAXA = iD_PRODUTO_TAXA;
     pRODUTO_TAXA.ID_PRODUTO = iD_PRODUTO;
     pRODUTO_TAXA.ID_TAXA = iD_TAXA;
     pRODUTO_TAXA.NUM_VALOR = nUM_VALOR;
     pRODUTO_TAXA.ORD_PRIORIDADE = oRD_PRIORIDADE;
     pRODUTO_TAXA.LOGIN_USUARIO = lOGIN_USUARIO;
     pRODUTO_TAXA.DATA_ATUALIZACAO = dATA_ATUALIZACAO;
     return pRODUTO_TAXA;
 }
Beispiel #2
0
        /// <summary>
        /// Método para salvar o taxa do produto
        /// </summary>
        /// <param name="Taxas">Objeto com os dados do taxa</param>
        /// <returns>Contrato.RetornoTaxa</returns>
        internal static Contrato.RetornoTaxa SalvarTaxaProduto(Dados.PRODUTO Produto, string UsuarioLogado, Contrato.Taxa Taxa)
        {
            // Objeto que recebe o retorno do método
            Contrato.RetornoTaxa retTaxa = new Contrato.RetornoTaxa();

            // Verifica se as informações do taxa foram informadas
            string strValidacao = ValidarTaxaPreenchida(Taxa);

            // Se existe algum erro
            if (strValidacao.Length > 0)
            {
                retTaxa.Codigo = Contrato.Constantes.COD_FILTRO_VAZIO;
                retTaxa.Mensagem = strValidacao;
            }
            else
            {
                // Cria a taxa para o produto
                Dados.PRODUTO_TAXA tProdutoTaxa = new Dados.PRODUTO_TAXA()
                                    {
                                        ID_PRODUTO_TAXA = Guid.NewGuid(),
                                        ID_PRODUTO = Produto.ID_PRODUTO,
                                        ID_TAXA = Taxa.Id,
                                        NUM_VALOR = Taxa.Valor,
                                        ORD_PRIORIDADE = Taxa.Prioridade,
                                        LOGIN_USUARIO = UsuarioLogado,
                                        DATA_ATUALIZACAO = DateTime.Now
                                    };

                Produto.T_PRODUTO_TAXA.Add(tProdutoTaxa);

                // Preenche o objeto de retorno
                retTaxa.Codigo = Contrato.Constantes.COD_RETORNO_SUCESSO;
            }

            // retorna dos dados
            return retTaxa;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the T_PRODUTO_TAXA EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToT_PRODUTO_TAXA(PRODUTO_TAXA pRODUTO_TAXA)
 {
     base.AddObject("T_PRODUTO_TAXA", pRODUTO_TAXA);
 }