Example #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);
        }
Example #2
0
        private IBLLActionResult ValidateReservation(Reservation r)
        {
            var result = new BLLActionResult();

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

            return(result);
        }