using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using fatd_faturamento.DAL.Persistencia;
using fatd_faturamento.BLL.RegraNegocio;
using fatd_faturamento.ENTIDADE;


namespace fatd_faturamento.BLL.Repositorio
{
    public class repositorioConsumiPalm
    {
        public void Insert(entidadeConsumiPalm objConsumiPalm)
        {
            dalConsumiPalm dalConsumiPalm = null;

            try
            {
                dalConsumiPalm = new dalConsumiPalm();

                dalConsumiPalm.Insert(objConsumiPalm);
            }
            catch (Exception)
            {
                throw;
            }
        }

        public IList<entidadeConsumiPalm> Select(entidadeConsumiPalm objConsumiPalm)
        {
            dalConsumiPalm dalConsumiPalm = null;

            var lstConsumiPalm = new List<entidadeConsumiPalm>();

            regraNegocioGlobal regranegocioGlobal = null;

            DataTable dt = null;

            try
            {
                dalConsumiPalm = new dalConsumiPalm();

                dt = dalConsumiPalm.Select(objConsumiPalm);

                regranegocioGlobal = new regraNegocioGlobal();

                lstConsumiPalm = regraNegocioGlobal.ConvertDataTable<entidadeConsumiPalm>(dt);

                return lstConsumiPalm;
            }
            catch (Exception)
            {
                throw;
            }
        }

        public IList<entidadeConsumiPalm> Select_1(entidadeConsumiPalm objConsumiPalm)
        {
            dalConsumiPalm dalConsumiPalm = null;

            var lstConsumiPalm = new List<entidadeConsumiPalm>();

            regraNegocioGlobal regranegocioGlobal = null;

            DataTable dt = null;

            try
            {
                dalConsumiPalm = new dalConsumiPalm();

                dt = dalConsumiPalm.Select_1(objConsumiPalm);

                regranegocioGlobal = new regraNegocioGlobal();

                lstConsumiPalm = regraNegocioGlobal.ConvertDataTable<entidadeConsumiPalm>(dt);

                return lstConsumiPalm;
            }
            catch (Exception)
            {
                throw;
            }
        }

        public DataTable Select_2(entidadeConsumiPalm objConsumiPalm)
        {
            dalConsumiPalm dalConsumiPalm = null;
            DataTable dt = null;

            try
            {
                dalConsumiPalm = new dalConsumiPalm();
                dt = dalConsumiPalm.Select_1(objConsumiPalm);

                return dt;
            }
            catch (Exception)
            {
                throw;
            }
        }

        public void Delete(entidadeConsumiPalm objConsumiPalm)
        {
            dalConsumiPalm dalConsumiPalm = null;

            try
            {
                dalConsumiPalm = new dalConsumiPalm();

                dalConsumiPalm.Delete(objConsumiPalm);
            }
            catch (Exception)
            {
                throw;
            }
        }

    }
}
