Exemplo n.º 1
0
        public void Guardar(Regalo regalo)
        {
            if (regalo == null)
            {
                throw new ArgumentException("No se a creado Un Regalo");
            }
            if (regalo.Id < 0)
            {
                throw new ArgumentException("El ID tiene que ser mayor a Cero");
            }
            if (regalo.Nombre.Equals(" "))
            {
                throw new ArgumentException("Ingrese el Nombre");
            }
            if (regalo.Cantida <= 0)
            {
                throw new ArgumentException("La cantidad tiene que ser mayor que Cero");
            }
            if (regalo.Descripcion.Equals(" "))
            {
                throw new ArgumentException("Ingrese una descripción");
            }


            datos = new Regalo_Datos();

            datos.Guardar(regalo);
        }
Exemplo n.º 2
0
 public static List <Regalo> ObtenerTodos_PorParticipante(int id)
 {
     return(Regalo_Datos.Obtener_Regalos_PorParticipante(id));
 }
Exemplo n.º 3
0
 public int ultimo()
 {
     return(Regalo_Datos.ObtenerUltimo());
 }
Exemplo n.º 4
0
 public static Regalo ObtenerPorId(int id)
 {
     return(Regalo_Datos.ObtenerPorId(id));
 }
Exemplo n.º 5
0
 public static List <Regalo> ObtenerTodos()
 {
     return(Regalo_Datos.ObtenerTodos());
 }