Exemplo n.º 1
0
        //public List<BookingDTO> GetBookings(DateTime FromDate, DateTime ToDate)
        //{
        //    try
        //    {
        //        if (bookingHandler == null)
        //            bookingHandler = new BookingHandler();
        //        return bookingHandler.GetBookings(FromDate, ToDate);
        //    }
        //    catch (Exception exp)
        //    {
        //        throw exp;
        //    }
        //}

        //public List<BookingDTO> GetBookings(DateTime FromDate, DateTime ToDate, ENums.BookingStatusTypes BookingStatusType)
        //{
        //    try
        //    {
        //        if (bookingHandler == null)
        //            bookingHandler = new BookingHandler();
        //        return bookingHandler.GetBookings(FromDate, ToDate, BookingStatusType);
        //    }
        //    catch (Exception exp)
        //    {
        //        throw exp;
        //    }
        //}

        //public List<BookingDTO> GetBookings(DateTime FromDate, DateTime ToDate, ENums.BookingStatusTypes BookingStatusType, int AccomTypeId)
        //{
        //    try
        //    {
        //        if (bookingHandler == null)
        //            bookingHandler = new BookingHandler();
        //        return bookingHandler.GetBookings(FromDate, ToDate, BookingStatusType, AccomTypeId, 0);
        //    }
        //    catch (Exception exp)
        //    {
        //        throw exp;
        //    }
        //}

        //public List<BookingDTO> GetBookings(DateTime FromDate, DateTime ToDate, ENums.BookingStatusTypes BookingStatusType, int AccomTypeId, int AccomId)
        //{
        //    try
        //    {
        //        if (bookingHandler == null)
        //            bookingHandler = new BookingHandler();
        //        return bookingHandler.GetBookings(FromDate, ToDate, BookingStatusType, AccomTypeId, AccomId);
        //    }
        //    catch (Exception exp)
        //    {
        //        throw exp;
        //    }
        //}

        public List <ViewBookingDTO> GetBookings(cdtGetBookingsInput getBookingsInput)
        {
            try
            {
                if (bookingHandler == null)
                {
                    bookingHandler = new BookingHandler();
                }
                return(bookingHandler.GetBookings(getBookingsInput));
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
Exemplo n.º 2
0
 private void SetGridDataSource()
 {
     try
     {
         BookingHandler hh = new BookingHandler();
         DataRange      r  = null;
         if (dateEdit1.DateTime > dateEdit2.DateTime)
         {
             r = new DataRange(dateEdit2.DateTime, dateEdit1.DateTime);
         }
         else
         {
             r = new DataRange(dateEdit1.DateTime, dateEdit2.DateTime);
         }
         IList h = hh.GetBookings(r);
         if (h.Count == 0)
         {
             XtraMessageBox.Show("Nessuna prenotazione trovata", "Messaggio", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             try
             {
                 gridControl1.MainView.SaveLayoutToXml(fileLayout);
             }
             catch (Exception)
             {
                 //non fa nulla
             }
         }
         gridControl1.DataSource = h;
     }
     catch (Exception ex)
     {
         WIN.SCHEDULING_APP.GUI.Utility.ErrorHandler.Show(ex);
     }
 }