Ejemplo n.º 1
0
        private void ButtonReturnBike_Click(object sender, RoutedEventArgs e)
        {
            var deleterecord = App._bikebookingdatastorage;

            deleterecord.Remove(deletebikebookingdatastorage as ManageBooking);
            StorageClass.StoreXML <List <ManageBooking> >("BikeBookingManager.xml", deleterecord);
            DisplayRentedBike();

            var updateItem = (from biker in App._bikedatastorage
                              select biker);

            updateItem
            .Where(exp => exp.RentedBike == exp.RentedBike)
            .ToList().ForEach(exp =>
            {
                exp.RentedBike    -= 1;
                exp.AvailableBike += 1;
            });
            StorageClass.StoreXML <List <ManageBike> >("BikeManager.xml", App._bikedatastorage);

            DisplayAvailableBike();

            TextboxSearch.Visibility  = Visibility.Visible;
            LabelboxSearch.Visibility = Visibility.Visible;
        }
Ejemplo n.º 2
0
        public void btnNextPage_Click(object sender, RoutedEventArgs e)
        {
            if (dtpckStartDate.Text != "" && dtpckEndDate.Text != "")
            {
                if (_curretnselections != null)
                {
                    var updateDatesinList = (from bik in _curretnselections
                                             select bik);
                    updateDatesinList
                    .Where(bik => bik.endDate == null & bik.startDate == null)
                    .ToList().ForEach(bik =>
                    {
                        bik.startDate = dtpckStartDate.Text;
                        bik.endDate   = dtpckEndDate.Text;
                    });
                    grdSelectBike.Visibility     = Visibility.Collapsed;
                    grdCustomerDetail.Visibility = Visibility.Visible;
                    var bikesDetail = (from biker in App._bikebookingdatastorage
                                       where biker.CustomerId == CustomerId
                                       select biker);

                    ManageBooking datastore = new ManageBooking
                    {
                        CustomerId    = CustomerId,
                        Deposit       = (from bik in _curretnselections select bik.totalDeposit).LastOrDefault(),
                        TypeCity      = (from bik in _curretnselections select bik.TypeCity).LastOrDefault(),
                        TypeMountain  = (from bik in _curretnselections select bik.TypeMountain).LastOrDefault(),
                        TypeRacing    = (from bik in _curretnselections select bik.TypeRacing).LastOrDefault(),
                        TypeEBike     = (from bik in _curretnselections select bik.TypeEBike).LastOrDefault(),
                        ReturnDeposit = (from bik in _curretnselections select bik.totalDeposit).LastOrDefault(),
                        //ReturnDeposit = 30,
                        EndDate   = dtpckEndDate.Text,
                        Quantity  = (from bik in _curretnselections select bik.totalQuantitty).LastOrDefault(),
                        Rent      = (from bik in _curretnselections select bik.totalRent).LastOrDefault(),
                        StartDate = dtpckStartDate.Text,
                        //Address = "Hermann Str 5",
                        TotalAmount = (from bik in _curretnselections select bik.totalDeposit).LastOrDefault() + (from bik in _curretnselections select bik.totalRent).LastOrDefault()
                    };
                    App._bikebookingdatastorage.Add(datastore);
                    StorageClass.StoreXML <List <ManageBooking> >("BikeBookingManager.xml", App._bikebookingdatastorage);
                    DisplayRentedBike();
                }
            }
            else
            {
                MessageBox.Show("Please Select Start Date and End Date.", "Error!!", MessageBoxButton.OKCancel);
            }
        }
Ejemplo n.º 3
0
        private void ButtonOrderNow_Click(object sender, RoutedEventArgs e)
        {
            var bikesDetails = (from biker in App._bikebookingdatastorage
                                where biker.CustomerId == CustomerId
                                select biker);

            bikesDetails.Where(bike => bike.CustomerId == CustomerId)
            .ToList().ForEach(bike =>
            {
                bike.Email    = Email.Text;
                bike.FullName = FullName.Text;
                bike.Address  = Address.Text;
                bike.ZipCode  = ZipCode.Text;
                bike.CityName = City.Text;
                bike.Phone    = Phone.Text;

                MessageBox.Show("Your Booking is Saved!", "Alert!!!");
                Email.Text                   = "";
                FullName.Text                = "";
                Address.Text                 = "";
                ZipCode.Text                 = "";
                City.Text                    = "";
                Phone.Text                   = "";
                txtboxTotalAmount.Text       = "";
                _curretnselections           = new List <CurrentOrder>();
                datgridBikeOrder.ItemsSource = null;
            });
            StorageClass.StoreXML <List <ManageBooking> >("BikeBookingManager.xml", App._bikebookingdatastorage);
            var updateItem = (from biker in App._bikedatastorage
                              select biker);

            updateItem
            .Where(exp => exp.RentedBike == exp.RentedBike)
            .ToList().ForEach(exp =>
            {
                exp.RentedBike    += 1;
                exp.AvailableBike -= 1;
            });
            StorageClass.StoreXML <List <ManageBike> >("BikeManager.xml", App._bikedatastorage);
        }