Beispiel #1
0
        public IList <Booking> BookingGetByQueryString(NameValueCollection nvcQueryString, int pageSize, int currentPageIndex, out int count)
        {
            var bookingId = -1;

            try
            {
                if (nvcQueryString["bi"] != null)
                {
                    var resultString = Regex.Match(nvcQueryString["bi"], @"\d+").Value;
                    bookingId = Convert.ToInt32(resultString);
                }
            }
            catch { }

            var tripId = -1;

            try
            {
                if (nvcQueryString["ti"] != null)
                {
                    tripId = Convert.ToInt32(nvcQueryString["ti"]);
                }
            }
            catch { }

            var cruiseId = -1;

            try
            {
                if (nvcQueryString["ci"] != null)
                {
                    cruiseId = Convert.ToInt32(nvcQueryString["ci"]);
                }
            }
            catch { }

            DateTime?startDate = null;

            try
            {
                if (nvcQueryString["sd"] != null)
                {
                    startDate = DateTime.ParseExact(nvcQueryString["sd"], "dd/MM/yyyy", CultureInfo.InvariantCulture);
                }
            }
            catch { }


            int status = -1;

            try
            {
                if (nvcQueryString["s"] != null)
                {
                    status = Convert.ToInt32(nvcQueryString["s"]);
                }
            }
            catch { }

            int agencyId = -1;

            try
            {
                if (nvcQueryString["ai"] != null)
                {
                    agencyId = Convert.ToInt32(nvcQueryString["ai"]);
                }
            }
            catch { }

            string customerName = "";

            if (nvcQueryString["cn"] != null)
            {
                customerName = nvcQueryString["cn"];
            }

            int batchId = -1;

            try
            {
                if (nvcQueryString["batchid"] != null)
                {
                    batchId = Convert.ToInt32(nvcQueryString["batchid"]);
                }
            }
            catch { }

            return(BookingRepository.BookingListBLL_BookingSearchBy(bookingId, tripId, cruiseId, status, startDate, customerName, agencyId
                                                                    , batchId, pageSize, currentPageIndex, out count));
        }