Example #1
0
        //INSERT
        public static bool insertItemAlunoPAE(ItensAlunoPAE item, out string mensagemErro)
        {
            mensagemErro = "";

            try
            {
                Command       cmd = new Command();
                StringBuilder sql = new StringBuilder();

                sql.AppendLine("INSERT INTO ITENS_ALUNOS_PAE");
                sql.AppendLine("(CODIGO_PEDIDO, CODIGO_ALUNO, SEQUENCIA, CODIGO_PRODUTO)");
                sql.AppendLine("VALUES");
                sql.AppendLine("(" + item.codigoPedido + "," + item.aluno.Codigo + "," + item.sequencia + "," + item.codigoProduto + ")");

                cmd.CommandText = sql.ToString();

                int retorno = cmd.Execute();

                if (retorno > 0)
                {
                    return(true);
                }
                else
                {
                    mensagemErro = "Não foi possível cadastrar o item. Contate o suporte!";
                    return(false);
                }
            }
            catch (Exception ex)
            {
                mensagemErro = "Não foi possível cadastrar o item. Contate o suporte!";
                Uteis.GravarLogErro(ex.TargetSite.Name, ex.Message);
                return(false);
            }
        }
Example #2
0
 public bool insertItemAlunoPAE(ItensAlunoPAE item, out string mensagemErro)
 {
     try
     {
         return(ItensAlunoPAEDAL.insertItemAlunoPAE(item, out mensagemErro));
     }
     catch (Exception ex)
     {
         mensagemErro = ex.Message;
         return(false);
     }
 }