Exemple #1
0
        public BE.NivelRegla ObtenerNivelReglaPorId(int idNivelRegla)
        {
            var dtNivelRegla = _accesoBaseDeDatos.Seleccionar(new BE.NivelRegla()
            {
                Id = idNivelRegla
            }, true);

            if (dtNivelRegla.Rows.Count == 0)
            {
                return(null);
            }

            var row         = dtNivelRegla.Rows[0];
            var aNivelRegla = new BE.NivelRegla
            {
                Id = Convert.ToInt32(row["Id"]),
                //NombreNivel  = row["NombreNivel"].ToString().Trim(),
                Categoria = new BE.Categoria()
                {
                    Id = Convert.ToInt32(row["IdCategoria"])
                },
                TipoArbitro = new BE.TipoArbitro()
                {
                    Id = Convert.ToInt32(row["IdTipoArbitro"])
                },
            };

            return(aNivelRegla);
        }
Exemple #2
0
        public List <BE.NivelRegla> Leer()
        {
            var ls = new List <BE.NivelRegla>();

            BE.NivelRegla beNivelRegla = new BE.NivelRegla();

            var dt = _accesoBaseDeDatos.Seleccionar(new BE.NivelRegla(), false);

            foreach (DataRow row in dt.Rows)
            {
                var aNivelRegla = new BE.NivelRegla
                {
                    Id = Convert.ToInt32(row["Id"]),
                    //NombreNivel  = row["NombreNivel"].ToString().Trim(),
                    Categoria = new BE.Categoria()
                    {
                        Id = Convert.ToInt32(row["IdCategoria"])
                    },
                    TipoArbitro = new BE.TipoArbitro()
                    {
                        Id = Convert.ToInt32(row["IdTipoArbitro"])
                    },
                };

                ls.Add(aNivelRegla);
            }

            return(ls);
        }
Exemple #3
0
        public BE.NivelRegla ObtnerNivelReglaPorId(int idNivelRegla)
        {
            BLL.Categoria   bllCategoria   = new BLL.Categoria();
            BLL.TipoArbitro bllTipoArbitro = new BLL.TipoArbitro();
            BE.NivelRegla   beNivelRegla   = _dalManagerNivelRegla.ObtenerNivelReglaPorId(idNivelRegla);

            beNivelRegla.Categoria   = bllCategoria.ObtnerCategoriaPorId(beNivelRegla.Categoria.Id);
            beNivelRegla.TipoArbitro = bllTipoArbitro.ObtnerTipoArbitroPorId(beNivelRegla.TipoArbitro.Id);

            return(beNivelRegla);
        }
Exemple #4
0
        /// <summary>
        /// Agrega un nuevo NivelRegla al sistema.
        /// </summary>
        /// <param name="pNivelRegla">NivelRegla a agregar.</param>
        /// <returns></returns>
        public Resultado Agregar(BE.NivelRegla pNivelRegla)
        {
            var resultado = _dalManagerNivelRegla.Insertar(pNivelRegla);

            if (resultado == ResultadoBd.OK)
            {
                return(new Resultado(false, "Ok"));
            }

            return(new Resultado(false, "No se dio de alta el NivelRegla."));
        }
Exemple #5
0
        /// <summary>
        /// Quita un NivelRegla.
        /// </summary>
        /// <param name="pNivelRegla">NivelRegla a quitar.</param>
        /// <returns></returns>
        public Resultado Quitar(BE.NivelRegla pNivelRegla)
        {
            ResultadoBd resultado = _dalManagerNivelRegla.Borrar(pNivelRegla);

            if (resultado == ResultadoBd.OK)
            {
                return(new Resultado(false, "Ok"));
            }


            return(new Resultado(false, "No se pudo borrar el NivelRegla."));
        }
Exemple #6
0
        /// <summary>
        /// Edita un NivelRegla.
        /// </summary>
        /// <param name="pNivelRegla">NivelRegla a editar.</param>
        /// <returns></returns>
        public Resultado Editar(BE.NivelRegla pNivelRegla)
        {
            ResultadoBd resultado = _dalManagerNivelRegla.Actualizar(pNivelRegla);

            if (resultado == ResultadoBd.OK)
            {
                return(new Resultado(false, "Ok"));
            }


            return(new Resultado(false, "No se pudo editar el NivelRegla."));
        }
Exemple #7
0
        public List <BE.NivelRegla> ObtenerReglasPorNivelId(int idNivel)
        {
            var ls   = new List <BE.NivelRegla>();
            var pars = new IDbDataParameter[1];

            pars[0] = _accesoBaseDeDatos.CrearParametro("@IdNivel", idNivel);

            string query = @"Select *
                             from NivelRegla nr
                             where nr.IdNivel =  @IdNivel";

            var dt = _accesoBaseDeDatos.Seleccionar(query, pars);

            if (dt.Rows.Count == 0)
            {
                return(null);
            }

            foreach (DataRow row in dt.Rows)
            {
                var aNivelRegla = new BE.NivelRegla
                {
                    Id = Convert.ToInt32(row["Id"]),
                    //NombreNivel  = row["NombreNivel"].ToString().Trim(),
                    Categoria = new BE.Categoria()
                    {
                        Id = Convert.ToInt32(row["IdCategoria"])
                    },
                    TipoArbitro = new BE.TipoArbitro()
                    {
                        Id = Convert.ToInt32(row["IdTipoArbitro"])
                    },
                };

                ls.Add(aNivelRegla);
            }

            return(ls);
        }
Exemple #8
0
 /// <summary>
 /// Borra un NivelRegla.
 /// </summary>
 /// <param name="pNivelRegla">NivelRegla.</param>
 /// <returns></returns>
 public ResultadoBd Borrar(BE.NivelRegla pNivelRegla)
 {
     return(_accesoBaseDeDatos.Borrar(pNivelRegla));
 }
Exemple #9
0
 /// <summary>
 /// Actualiza un NivelRegla.
 /// </summary>
 /// <param name="pNivelRegla">NivelRegla.</param>
 /// <returns></returns>
 public ResultadoBd Actualizar(BE.NivelRegla pNivelRegla)
 {
     return(_accesoBaseDeDatos.Actualizar(pNivelRegla));
 }
Exemple #10
0
 /// <summary>
 /// Inserta un NivelRegla.
 /// </summary>
 /// <param name="pNivelRegla">NivelRegla.</param>
 /// <returns></returns>
 public ResultadoBd Insertar(BE.NivelRegla pNivelRegla)
 {
     return(_accesoBaseDeDatos.Insertar(pNivelRegla));
 }