Example #1
0
        public static void SetUserTourStatus(int userId, string tourId)
        {
            if (userId <= 0)
            {
                throw new ArgumentException("UserId cannot be equals or less than zero");
            }

            if (string.IsNullOrEmpty(tourId))
            {
                throw new ArgumentException("TourId cannot be null or empty");
            }

            TourDSTableAdapters.QueriesTableAdapter adapter = new TourDSTableAdapters.QueriesTableAdapter();
            adapter.SetUserTourStatus(userId, tourId);
        }
Example #2
0
        public static bool CheckIfUserViewTour(int userId, string tourId)
        {
            if (userId <= 0)
            {
                throw new ArgumentException("UserId cannot be equals or less than zero");
            }

            if (string.IsNullOrEmpty(tourId))
            {
                throw new ArgumentException("TourId cannot be null or empty");
            }

            bool?status = false;

            TourDSTableAdapters.QueriesTableAdapter adapter = new TourDSTableAdapters.QueriesTableAdapter();
            adapter.CheckUserTourStatus(userId, tourId, ref status);

            return(status.Value);
        }