private void BtnWeekly_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         DateTime moment = DateTime.Now;
         DateTime fromDate = moment;
         DateTime toDate = moment.AddDays(-7);
         BookingValiadtions bo = new BookingValiadtions();
         DataTable dt = bo.PrintReport_BLL(fromDate, toDate);
         if (dt != null)
         {
             
             MessageBox.Show("The Report is generated");
             dgReport.ItemsSource = dt.DefaultView;
         }
         else
         {
             MessageBox.Show("Report cannot be generated");
         }
     }
     catch (BookingException be)
     {
         MessageBox.Show(be.Message);
     }
 }
 private void Btn_Book_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         string  custId  = MainWindow.id;
         Booking booking = new Booking();
         booking.TaxiID             = int.Parse(txt_TaxiID.Text.ToString());
         booking.StartDate          = DateTime.Parse(txtSHrs.Text.ToString() + ":" + txtSMins.Text.ToString());
         booking.EndDate            = DateTime.Parse(txtEhrs.Text.ToString() + ":" + txtEMins.Text.ToString());
         booking.BookingDate        = DateTime.Parse(dpBookingDate.Text.ToString());
         booking.TripDate           = DateTime.Parse(dpTripDate.Text.ToString());
         booking.SourceAddress      = txtSAddress.Text;
         booking.DestinationAddress = txtDAddress.Text;
         BookingValiadtions bv = new BookingValiadtions();
         if (bv.BookingTaxi_BLL(booking, custId) != 0)
         {
             MessageBox.Show("Booking success");
         }
         else
         {
             throw new BookingException("Booking failed");
         }
     }
     catch (BookingException be)
     {
         MessageBox.Show(be.Message);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            BookingValiadtions bookingValiadtions = new BookingValiadtions();
            string             custId             = MainWindow.id;

            DataTable dt = bookingValiadtions.BookStatus(custId);

            dg_view.ItemsSource = dt.DefaultView;
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //int EmpID = MainWindow.id;
            //BookingValiadtions bv = new BookingValiadtions();
            //dg_CheckBooking.ItemsSource=bv.CheckBooking(EmpID).DefaultView;
            BookingValiadtions bookingValiadtions = new BookingValiadtions();
            string             custId             = MainWindow.id;

            DataTable dt = bookingValiadtions.CheckBooking(custId);

            dg_CheckBooking.ItemsSource = dt.DefaultView;
        }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         BookingValiadtions bookingValiadtions = new BookingValiadtions();
         dg_driverHistory.ItemsSource = bookingValiadtions.DriverHistory_BLL(MainWindow.id).DefaultView;
     }
     catch (BookingException be)
     {
         MessageBox.Show(be.Message);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 6
0
        private void Btn_CheckBooking_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                BookingValiadtions bookingValiadtions = new BookingValiadtions();
                string             custId             = MainWindow.id;

                DataTable dt = bookingValiadtions.CheckBooking_BLL(custId);
                dg_CheckBooking.ItemsSource = dt.DefaultView;
            }
            catch (BookingException be)
            {
                MessageBox.Show(be.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 7
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                BookingValiadtions bookingValiadtions = new BookingValiadtions();
                string             custId             = MainWindow.id;

                DataTable dt = bookingValiadtions.BookStatus(custId);
                dg_view.ItemsSource = dt.DefaultView;
            }
            catch (BookingException be)
            {
                MessageBox.Show(be.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         BookingValiadtions bd = new BookingValiadtions();
         DataTable          dt = bd.DisplayTaxi_BLL();
         if (dt != null)
         {
             dgTaxi.ItemsSource = dt.DefaultView;
         }
         else
         {
             MessageBox.Show("Error loading taxi details");
         }
     }
     catch (BookingException te)
     {
         MessageBox.Show(te.Message);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }