示例#1
0
        private IBLLActionResult ValidateCustomer(Customer c)
        {
            var result = new BLLActionResult();

            if (c == null)
            {
                result.AddError("Nie podano danych gościa.");
            }
            else
            {
                if (c.FirstName == "")
                {
                    result.AddError("Nie podano Imienia.");
                }
                if (c.LastName == "")
                {
                    result.AddError("Nie podano Nazwiska.");
                }
                if (c.Email == "")
                {
                    result.AddError("Nie podano Emaila.");
                }
                if (c.Phone == "")
                {
                    result.AddError("Nie podano Telefonu.");
                }
            }

            return(result);
        }
示例#2
0
        private IBLLActionResult ValidateReservation(Reservation r)
        {
            var result = new BLLActionResult();

            if (r.FromDate >= r.ToDate)
            {
                result.AddError("Niepoprawne daty.");
            }

            return(result);
        }