Exemple #1
0
        public void Update(Domain.Entities.Personal.Livro livro)
        {
            try
            {
                if (livro == null)
                {
                    throw new ArgumentException("Livro invalido");
                }

                OpenConnection();

                var parameter = new DynamicParameters();
                parameter.Add("LivroId", livro.LivrosId, DbType.Int64);
                parameter.Add("Titulo", livro.Titulo, DbType.String);
                parameter.Add("Editora", livro.Editora, DbType.String);
                parameter.Add("Escritor", livro.Escritor, DbType.String);
                parameter.Add("LastUpdatedBy", livro.LastUpdatedBy, DbType.Int64);
                parameter.Add("LastUpdatedDate", livro.LastUpdatedDate, DbType.DateTime);

                _connectionPersonal.Execute(
                    sql: "Livro_Update",
                    param: parameter,
                    commandType: CommandType.StoredProcedure);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                CloseConnection();
            }
        }
Exemple #2
0
        public void Update(Domain.Entities.Personal.Livro livro)
        {
            try
            {
                if (livro == null)
                {
                    throw new ArgumentException("Livro invalido");
                }

                _repo.Update(livro);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
        public int Add(Domain.Entities.Personal.Livro livro)
        {
            try
            {
                if (livro == null)
                {
                    throw new ArgumentException("Livro invalido");
                }

                var livroId = _repo.Add(livro);
                return(livroId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }