예제 #1
0
        private void detailGrd_Selected(object sender, RoutedEventArgs e)
        {
            TBikeDAL  MyDAL        = new TBikeDAL();
            int       index        = BookGrd.Items.IndexOf(BookGrd.CurrentItem);
            DataTable BicycleTable = MyDAL.ShowAllBikeTable();

            if (index == -1)
            {
                index = 0;
            }
            else
            {
                string    BicycleName = Convert.ToString(BicycleTable.Rows[index]["BicycleName"]).Trim();
                DataTable ResultTable = MyDAL.SelectAllBookingByDynamic("", BicycleName, "", "", "", "", null);

                TBBicycleID.Text = "Booking Details By: " + Convert.ToString(BicycleTable.Rows[index]["BicycleName"]).Trim();

                Column1.Header   = "Booking ID";
                Column1.Binding  = new Binding("BookingID");
                Column2.Header   = "Bicycle";
                Column2.Binding  = new Binding("BicycleName");
                Column3.Header   = "Bicycle Type";
                Column3.Binding  = new Binding("BicycleType");
                Column4.Header   = "Booking Date";
                Column4.Binding  = new Binding("BookingDate");
                Column5.Header   = "Booking Status";
                Column5.Binding  = new Binding("BookingStatusInFull");
                Column6.Header   = "Booking Start-Time";
                Column6.Binding  = new Binding("StartTime");
                Column7.Header   = "Booking End-Time";
                Column7.Binding  = new Binding("EndTime");
                Column8.Header   = "Deposit";
                Column8.Binding  = new Binding("BookingDeposit");
                Column9.Header   = "Customer Name";
                Column9.Binding  = new Binding("Customer");
                Column10.Header  = "Total Price";
                Column10.Binding = new Binding("TotalPrice");
                Column11.Header  = "Remarks";
                Column11.Binding = new Binding("Remark");
                Column12.Header  = "Created By";
                Column12.Binding = new Binding("CreatedBy");
                Column13.Header  = "Created At";
                Column13.Binding = new Binding("CreatedAt");
                Column14.Header  = "Last Updated By";
                Column14.Binding = new Binding("LastUpdatedBy");
                Column15.Header  = "Last Updated At";
                Column15.Binding = new Binding("LastUpdatedAt");
                TBIkeUtility.TranslateRecordStatusDescription(new List <string> {
                    "BookingStatus"
                }, ref ResultTable);

                detailGrd.ItemsSource         = ResultTable.DefaultView;
                detailGrd.AutoGenerateColumns = false;
            }
        }
예제 #2
0
        public void BookingMode()
        {
            TBikeDAL MyDAL = new TBikeDAL();

            DetermineItemStatus();
            DataTable ResultTable = MyDAL.SelectAllBookingByDynamic(TBBookID.Text, TBBikeName.Text, TBBookingStatus.Text, TBCustomer.Text, TBRemarks.Text, TBBikeType.Text, DPBook.SelectedDate);


            Column1.Header   = "Booking ID";
            Column1.Binding  = new Binding("BookingID");
            Column2.Header   = "Bicycle";
            Column2.Binding  = new Binding("BicycleName");
            Column3.Header   = "Bicycle Type";
            Column3.Binding  = new Binding("BicycleType");
            Column4.Header   = "Booking Date";
            Column4.Binding  = new Binding("BookingDate");
            Column5.Header   = "Booking Status";
            Column5.Binding  = new Binding("BookingStatusInFull");
            Column6.Header   = "Booking Start-Time";
            Column6.Binding  = new Binding("StartTime");
            Column7.Header   = "Booking End-Time";
            Column7.Binding  = new Binding("EndTime");
            Column8.Header   = "Deposit";
            Column8.Binding  = new Binding("BookingDeposit");
            Column9.Header   = "Customer Name";
            Column9.Binding  = new Binding("Customer");
            Column10.Header  = "Total Price";
            Column10.Binding = new Binding("TotalPrice");
            TBIkeUtility.TranslateRecordStatusDescription(new List <string> {
                "BookingStatus"
            }, ref ResultTable);



            dataGrid1.ItemsSource         = ResultTable.DefaultView;
            dataGrid1.AutoGenerateColumns = false;
            dataGrid1.CanUserAddRows      = false;
            dataGrid1.IsReadOnly          = true;
        }