Beispiel #1
0
        public string AddBookRead(int id, string resume, DateTime start, DateTime end)
        {
            string  response;
            Conexao conexao = new Conexao();

            conexao.Conectar();
            try
            {
                ExecutaSP executaSP = new ExecutaSP("BOOK_SP_INS_BOOK_READ", conexao.VoltaConexaoAberta());
                executaSP.addParam("@ID", id);
                executaSP.addParam("@RESUME", resume);
                executaSP.addParam("@START", start);
                executaSP.addParam("@END", end);

                executaSP.Executa();
                executaSP.Confirma();

                response = "Ok";
                return(response);
            }
            catch (Exception ex)
            {
                response = ex.ToString();
                return(response);
            }
        }
Beispiel #2
0
        public void UpdBook(Book book, BookRead bookRead)
        {
            Conexao conexao = new Conexao();

            conexao.Conectar();

            ExecutaSP executa = new ExecutaSP("BOOK_SP_UPD_BOOK", conexao.VoltaConexaoAberta());

            try
            {
                executa.addParam("@ID", book.Id);
                executa.addParam("@NAME", book.Name);
                executa.addParam("@INDICATION", book.Indication);
                executa.addParam("@SAGA", book.Saga);
                executa.addParam("@RESUME", bookRead.Resume);
                executa.addParam("@DATESTART", bookRead.DateStart);
                executa.addParam("@DATEEND", bookRead.DateEnd);


                executa.Executa();
                executa.Confirma();
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #3
0
        public void AddBook(Book book)
        {
            Conexao conexao = new Conexao();

            conexao.Conectar();

            ExecutaSP executa = new ExecutaSP("BOOK_SP_INS_BOOK", conexao.VoltaConexaoAberta());

            try
            {
                executa.addParam("@NAME", book.Name);
                executa.addParam("@IDAUT", book.IdAuthor);
                executa.addParam("@IDGEN", book.IdGenre);
                executa.addParam("@INDICATION", book.Indication);
                executa.addParam("@SAGA", book.Saga.ToString());
                executa.addParam("@DATE", book.DateCreate);

                executa.Executa();
                executa.Confirma();
            }
            catch (Exception ex)
            {
            }
        }