Esempio n. 1
0
        public void BicycleMode()
        {
            TBikeDAL MyDAL = new TBikeDAL();

            DetermineItemStatus();
            DataTable ResultTable = MyDAL.SelectAllBicycleByDynamic(TBBicycleID.Text, TBBikeName2.Text, TBCurrentRenter.Text, TBBikeColor.Text, TBBikeStatus.Text, TBBikeType2.Text);

            Column1.Header   = "Bicycle ID";
            Column1.Binding  = new Binding("BicycleID");
            Column2.Header   = "Bicycle Name";
            Column2.Binding  = new Binding("BicycleName");
            Column3.Header   = "Bicycle Type";
            Column3.Binding  = new Binding("BicycleType");
            Column4.Header   = "Bicycle Status";
            Column4.Binding  = new Binding("BicycleStatusInFull");
            Column5.Header   = "Current Renter";
            Column5.Binding  = new Binding("CurrentRenter");
            Column6.Header   = "Color";
            Column6.Binding  = new Binding("Color");
            Column7.Header   = "Total Rents";
            Column7.Binding  = new Binding("TotalRents");
            Column8.Header   = "Price (RM)";
            Column8.Binding  = new Binding("Price");
            Column9.Header   = "Condition";
            Column9.Binding  = new Binding("Condition");
            Column10.Header  = "CreatedBy";
            Column10.Binding = new Binding("CreatedBy");
            TBIkeUtility.TranslateRecordStatusDescription(new List <string> {
                "BicycleStatus"
            }, ref ResultTable);
            dataGrid1.ItemsSource         = ResultTable.DefaultView;
            dataGrid1.IsReadOnly          = true;
            dataGrid1.AutoGenerateColumns = false;
        }
Esempio n. 2
0
        public void SnackMode()
        {
            TBikeDAL MyDAL = new TBikeDAL();

            DetermineItemStatus();
            DataTable ResultTable = MyDAL.SelectAllSnackByDynamic(TBSnackID.Text, TBSnackName.Text, TBSnackStatus.Text, TBSnackType.Text);

            Column1.Header  = "Snack ID";
            Column1.Binding = new Binding("SnackID");
            Column2.Header  = "Snack Name";
            Column2.Binding = new Binding("SnackName");
            Column3.Header  = "Snack Type";
            Column3.Binding = new Binding("SnackType");
            Column4.Header  = "Snack Status";
            Column4.Binding = new Binding("SnackStatusInFull");
            Column5.Header  = "Snack Quantity";
            Column5.Binding = new Binding("Quantity");
            Column6.Header  = "Snack Price";
            Column6.Binding = new Binding("Price");
            Column7.Header  = "";
            Column8.Header  = "";
            Column9.Header  = "";
            Column10.Header = "";
            TBIkeUtility.TranslateRecordStatusDescription(new List <string> {
                "SnackStatus"
            }, ref ResultTable);
            dataGrid1.ItemsSource         = ResultTable.DefaultView;
            dataGrid1.IsReadOnly          = true;
            dataGrid1.AutoGenerateColumns = false;
        }
Esempio n. 3
0
        public void ServiceMode()
        {
            TBikeDAL MyDAL = new TBikeDAL();

            DetermineItemStatus();
            DataTable ResultTable = MyDAL.SelAllServiceByDynamic(TBServiceId.Text, TBServiceStatus.Text, TBServiceRemark.Text, TBServiceStatus.Text);

            Column1.Header  = "Service ID";
            Column1.Binding = new Binding("ServiceID");
            Column2.Header  = "Employee Name";
            Column2.Binding = new Binding("BicycleID");
            Column3.Header  = "Service Start-Time";
            Column3.Binding = new Binding("ServiceStart");
            Column4.Header  = "Service End-Time";
            Column4.Binding = new Binding("ServiceEnd");
            Column5.Header  = "Service Status";
            Column5.Binding = new Binding("StatusInFull");
            Column6.Header  = "Service Remark";
            Column6.Binding = new Binding("Remark");
            Column7.Header  = "";
            Column8.Header  = "";
            Column9.Header  = "";
            Column10.Header = "";

            TBIkeUtility.TranslateRecordStatusDescription(new List <string> {
                "Status"
            }, ref ResultTable);
            dataGrid1.ItemsSource         = ResultTable.DefaultView;
            dataGrid1.IsReadOnly          = true;
            dataGrid1.AutoGenerateColumns = false;
        }
Esempio n. 4
0
        public void PopulateSnackGrd()
        {
            TBikeDAL  MyDAL       = new TBikeDAL();
            DataTable ResultTable = MyDAL.ShowAllSnackTable();

            SdColumn1.Header   = "Snack ID";
            SdColumn1.Binding  = new Binding("SnackID");
            SdColumn2.Header   = "Snack Name";
            SdColumn2.Binding  = new Binding("SnackName");
            SdColumn3.Header   = "Type";
            SdColumn3.Binding  = new Binding("SnackType");
            SdColumn4.Header   = "Status";
            SdColumn4.Binding  = new Binding("SnackStatusInFull");
            SdColumn5.Header   = "Quantity";
            SdColumn5.Binding  = new Binding("Quantity");
            SdColumn6.Header   = "Price";
            SdColumn6.Binding  = new Binding("Price");
            SdColumn7.Header   = "Created By";
            SdColumn7.Binding  = new Binding("CreatedBy");
            SdColumn8.Header   = "Created At";
            SdColumn8.Binding  = new Binding("CreatedAt");
            SdColumn9.Header   = "Last Updated By";
            SdColumn9.Binding  = new Binding("LastUpdatedBy");
            SdColumn10.Header  = "Last Updated At";
            SdColumn10.Binding = new Binding("LastUpdatedAt");
            TBIkeUtility.TranslateRecordStatusDescription(new List <string> {
                "SnackStatus"
            }, ref ResultTable);

            SnackGrd.ItemsSource         = ResultTable.DefaultView;
            SnackGrd.AutoGenerateColumns = false;
        }
Esempio n. 5
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;
            }
        }
Esempio n. 6
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;
        }
Esempio n. 7
0
        public void PopulateBookGrd()
        {
            TBikeDAL  MyDAL       = new TBikeDAL();
            DataTable ResultTable = MyDAL.ShowAllBikeTable();

            dColumn1.Header   = "Bicycle ID";
            dColumn1.Binding  = new Binding("BicycleID");
            dColumn2.Header   = "Bicycle Name";
            dColumn2.Binding  = new Binding("BicycleName");
            dColumn3.Header   = "Bicycle Type";
            dColumn3.Binding  = new Binding("BicycleType");
            dColumn4.Header   = "Bicycle Status";
            dColumn4.Binding  = new Binding("BicycleStatusInFull");
            dColumn5.Header   = "Current Renter";
            dColumn5.Binding  = new Binding("CurrentRenter");
            dColumn6.Header   = "Total Rents";
            dColumn6.Binding  = new Binding("TotalRents");
            dColumn7.Header   = "Price";
            dColumn7.Binding  = new Binding("Price");
            dColumn8.Header   = "Color";
            dColumn8.Binding  = new Binding("Color");
            dColumn9.Header   = "Condition";
            dColumn9.Binding  = new Binding("Condition");
            dColumn10.Header  = "Created By";
            dColumn10.Binding = new Binding("CreatedBy");
            dColumn11.Header  = "Created At";
            dColumn11.Binding = new Binding("Created At");
            dColumn12.Header  = "Last Updated By";
            dColumn12.Binding = new Binding("LastUpdatedBy");
            dColumn13.Header  = "Last Updated At";
            dColumn13.Binding = new Binding("Last Updated At");

            TBIkeUtility.TranslateRecordStatusDescription(new List <string> {
                "BicycleStatus"
            }, ref ResultTable);
            BookGrd.ItemsSource         = ResultTable.DefaultView;
            BookGrd.AutoGenerateColumns = false;
        }