示例#1
0
        public List <ft_categoriaModel> insCategoria(ft_categoriaModel _Entidad)
        {
            List <ft_categoriaModel> _list = new List <ft_categoriaModel>();

            SqlParameter[] parametros =
            {
                new SqlParameter("@cat_descripcion", SqlDbType.VarChar, 4000)
                {
                    Value = _Entidad.cat_descripcion
                },
                new SqlParameter("@usu_id",          SqlDbType.Int)
                {
                    Value = _Entidad.usu_id
                },
                new SqlParameter("@cat_cargo_abono", SqlDbType.Int)
                {
                    Value = _Entidad.cat_cargo_abono
                }
            };
            try
            {
                using (var reader = base.ExecuteReader(CommandType.StoredProcedure, "InsCategoria", parametros))
                {
                    var dataTable = new DataTable();
                    dataTable.Load(reader);
                    _list = dataTable.ToList <ft_categoriaModel>();
                }
                return(_list);
            }
            catch
            { throw; }
            finally { parametros = null; }
        }
示例#2
0
        public List <ft_categoriaModel> delCategoria(ft_categoriaModel _Entidad)
        {
            List <ft_categoriaModel> _list = new List <ft_categoriaModel>();

            SqlParameter[] parametros =
            {
                new SqlParameter("@cat_id", SqlDbType.Int)
                {
                    Value = _Entidad.cat_id
                }
            };
            try
            {
                using (var reader = base.ExecuteReader(CommandType.StoredProcedure, "delCategoria", parametros))
                {
                    var dataTable = new DataTable();
                    dataTable.Load(reader);
                    _list = dataTable.ToList <ft_categoriaModel>();
                }
                return(_list);
            }
            catch
            { throw; }
            finally { parametros = null; }
        }
示例#3
0
 public List <ft_categoriaModel> delCategoria(int ncat_id)
 {
     try
     {
         ft_categoriaModel ft_CategoriaModel = new ft_categoriaModel();
         ft_CategoriaModel.cat_id = ncat_id;
         CategoriasDAL categoriasDAL = new CategoriasDAL();
         return(categoriasDAL.delCategoria(ft_CategoriaModel));
     }
     catch
     { throw; }
 }
示例#4
0
 public List <ft_categoriaModel> GetCategorias(int nusu_id, int ncat_id)
 {
     try
     {
         CategoriasDAL     _DAL = new CategoriasDAL();
         ft_categoriaModel ft_CategoriaModel = new ft_categoriaModel();
         ft_CategoriaModel.usu_id = nusu_id;
         ft_CategoriaModel.cat_id = ncat_id;
         return(_DAL.GETCategorias(ft_CategoriaModel));
     }
     catch
     { throw; }
 }
示例#5
0
 public List <ft_categoriaModel> InsCategoria(int ncargo_abono, int ncat_id, int nusu_id, string scat_descripcion)
 {
     try
     {
         ft_categoriaModel ft_CategoriaModel = new ft_categoriaModel();
         ft_CategoriaModel.usu_id          = nusu_id;
         ft_CategoriaModel.cat_cargo_abono = ncargo_abono;
         ft_CategoriaModel.cat_descripcion = scat_descripcion;
         CategoriasDAL categoriasDAL = new CategoriasDAL();
         return(categoriasDAL.insCategoria(ft_CategoriaModel));
     }
     catch
     { throw; }
 }