Ejemplo n.º 1
0
        public void AddCheckins(Checkin checkin)
        {
            if (checkin == null)
            {
                throw new ArgumentException("Impossibile eseguire il checkin: checkin nullo");
            }

            if (checkin.Customer == null)
            {
                throw new ArgumentException("Impossibile eseguire il checkin: ospite nullo");
            }

            if (checkin.Data == DateTime.MinValue)
            {
                throw new ArgumentException("Impossibile eseguire il checkin: Data nulla");
            }

            CheckCustomer(checkin.Customer);


            checkin.Assignment = this;


            _checkins.Add(checkin);
        }
Ejemplo n.º 2
0
 public ArrivedPerson(Checkin checkin)
 {
     if (checkin == null)
     {
         throw new ArgumentException("Checkin nullo");
     }
     _checkin = checkin;
 }
Ejemplo n.º 3
0
        private object ItemErrors(Checkin checkin)
        {
            StringBuilder b = new StringBuilder();

            foreach (string item in checkin.ValidationErrors)
            {
                b.AppendLine(item);
            }
            return(b.ToString());
        }
Ejemplo n.º 4
0
        public Checkin AddCheckins(DateTime date, Customer customer)
        {
            if (customer == null)
            {
                throw new ArgumentException("Impossibile eseguire il checkin: ospite nullo");
            }

            if (date == DateTime.MinValue)
            {
                throw new ArgumentException("Impossibile eseguire il checkin: Data nulla");
            }

            CheckCustomer(customer);

            Checkin c = new Checkin();

            c.Assignment = this;
            c.Data       = date;
            c.Customer   = customer;

            _checkins.Add(c);

            return(c);
        }