Пример #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);
        }
Пример #2
0
 public static List <Regalo> ObtenerTodos_PorParticipante(int id)
 {
     return(Regalo_Datos.Obtener_Regalos_PorParticipante(id));
 }
Пример #3
0
 public int ultimo()
 {
     return(Regalo_Datos.ObtenerUltimo());
 }
Пример #4
0
 public static Regalo ObtenerPorId(int id)
 {
     return(Regalo_Datos.ObtenerPorId(id));
 }
Пример #5
0
 public static List <Regalo> ObtenerTodos()
 {
     return(Regalo_Datos.ObtenerTodos());
 }