Beispiel #1
0
        private void btStatistics_Click(object sender, RoutedEventArgs e)
        {
            StatisicsWindow1 ToStatisicsWindow1 = new StatisicsWindow1(listDataGlobal);

            ToStatisicsWindow1.Show();

            LoadSelectedBoatService loadSelectedBoatService = new LoadSelectedBoatService(listDataGlobal.id);

            tbBoatName.Text = loadSelectedBoatService.ResponseMessage["BoatName"];
        }
Beispiel #2
0
        void Boats_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            boatClicked            = true;
            btStatistics.IsEnabled = true;
            btModify.IsEnabled     = true;
            ListViewItem Chosen = ((ListViewItem)sender);

            listDataGlobal = (ListData)Chosen.DataContext;
            LoadSelectedBoatService loadSelectedBoatService = new LoadSelectedBoatService(listDataGlobal.id);

            tbBoatName.Text        = loadSelectedBoatService.ResponseMessage["BoatName"];
            tbBoatPrice.Text       = loadSelectedBoatService.ResponseMessage["DailyPrice"];
            tbBoatConsumption.Text = loadSelectedBoatService.ResponseMessage["Consumption"];
            tbBoatType.Text        = loadSelectedBoatService.ResponseMessage["BoatType"];
            tbBoatManpower.Text    = loadSelectedBoatService.ResponseMessage["MaxPerson"];
            tbBoatSpeed.Text       = loadSelectedBoatService.ResponseMessage["MaxSpeed"];
            tbBoatWidth.Text       = loadSelectedBoatService.ResponseMessage["BoatWidth"];
            tbBoatLenght.Text      = loadSelectedBoatService.ResponseMessage["BoatLength"];
            tbBoatYear.Text        = loadSelectedBoatService.ResponseMessage["YearOfManufacture"];
            tbBoatDept.Text        = loadSelectedBoatService.ResponseMessage["DiveDepth"];
            tbBoatPlace.Text       = loadSelectedBoatService.ResponseMessage["WhereIsNowTheBoat"];
            imgBoatPicture.Source  = LoadImage(loadSelectedBoatService.ResponseMessage["BoatImage"]);
            imgBoatPicture.Tag     = loadSelectedBoatService.ResponseMessage["BoatImage"];

            tbIsLoan.Visibility          = Visibility.Visible;
            tbBoatPlace.Visibility       = Visibility.Visible;
            tbBoatDept.Visibility        = Visibility.Visible;
            tbBoatYear.Visibility        = Visibility.Visible;
            tbBoatSpeed.Visibility       = Visibility.Visible;
            tbBoatConsumption.Visibility = Visibility.Visible;
            tbBoatPrice.Visibility       = Visibility.Visible;
            lbBoatPlace.Visibility       = Visibility.Visible;
            lbBoatDept.Visibility        = Visibility.Visible;
            lbBoatYear.Visibility        = Visibility.Visible;
            lbBoatSpeed.Visibility       = Visibility.Visible;
            lbBoatConsumption.Visibility = Visibility.Visible;
            lbBoatPrice.Visibility       = Visibility.Visible;
            lbDepth.Visibility           = Visibility.Visible;
            lbSpeed.Visibility           = Visibility.Visible;
            lbConsumption.Visibility     = Visibility.Visible;
            lbPrice.Visibility           = Visibility.Visible;
            tbIsLoan.Visibility          = Visibility.Visible;

            lbIsLoan.Visibility = Visibility.Visible;

            lbBoatManpower.Content = "Max. létszám:";
            lbManpower.Content     = "Ft/nap";
            btStatistics.IsEnabled = true;
            tbIsLoan.IsChecked     = Convert.ToBoolean(loadSelectedBoatService.ResponseMessage["IsLoan"]);
        }
Beispiel #3
0
        // esemeny, amely akkor kovetkezik be, ha a UserControlban masik elemet valasztottunk
        // ekkor toltodik fel a SelectedBoatIndex a megfelelo ertekkel
        private void SelectionChanged(object sender, RoutedEventArgs e)
        {
            // kivalasztott hajo entity
            BoatsEntity selectedBoat = LoadBookableBoatsService.BookableBoats[SelectedBoatIndex];

            this.selectedBoat = selectedBoat;

            tbOwnerName.Text      = selectedBoat.FKOwner.MemberName;
            tbOwnerEmail.Text     = selectedBoat.FKOwner.Email;
            tbOwnerResidency.Text = selectedBoat.FKOwner.Country + ", " + selectedBoat.FKOwner.City + ", " + selectedBoat.FKOwner.Street + " " + selectedBoat.FKOwner.HouseNumber + ".";

            LoadUserDataService loadUserDataService = new LoadUserDataService(whoBorrowsEmail);

            imgOwnerPicture.Tag = loadUserDataService.ResponseMessage["MemberImage"];
            var uri    = new Uri(Convert.ToString(imgOwnerPicture.Tag), UriKind.Absolute);
            var bitmap = new BitmapImage(uri);

            imgOwnerPicture.Source = bitmap;


            tbBoatName.Text        = selectedBoat.BoatName;
            tbBoatPrice.Text       = selectedBoat.DailyPrice.ToString();
            tbBoatConsumption.Text = selectedBoat.Consumption.ToString();
            tbBoatType.Text        = selectedBoat.BoatType;
            tbBoatManpower.Text    = selectedBoat.MaxPerson.ToString();
            tbBoatSpeed.Text       = selectedBoat.MaxSpeed.ToString();
            tbBoatWidth.Text       = selectedBoat.BoatWidth.ToString();
            tbBoatLenght.Text      = selectedBoat.BoatLength.ToString();
            tbBoatYear.Text        = selectedBoat.YearOfManufacture.ToString();
            tbBoatDept.Text        = selectedBoat.DiveDepth.ToString();
            tbBoatPlace.Text       = selectedBoat.WhereIsNowTheBoat;

            LoadSelectedBoatService loadSelectedBoatService = new LoadSelectedBoatService(selectedBoat.BoatId.ToString());


            imgBoatPicture.Source = LoadImage(loadSelectedBoatService.ResponseMessage["BoatImage"]);
            imgBoatPicture.Tag    = loadSelectedBoatService.ResponseMessage["BoatImage"];

            //imgBoatPicture = Image;

            e.Handled = true;
        }
Beispiel #4
0
        public void LoadData(string email)
        {
            this.email = email;
            MembersDaoImpl      Members      = new MembersDaoImpl();
            RentRequestsDaoImpl RentRequests = new RentRequestsDaoImpl();
            BoatsDaoImpl        Boats        = new BoatsDaoImpl();

            int vaneuj = 0;

            foreach (var Hajok in Boats.GetAllBoatsByOwner(Members.getMemberByEmail(email)))
            {
                foreach (var Requests in RentRequests.GetAllRentRequestsByBoatToBorrow(Hajok))
                {
                    if (Requests.HowManyPersonWillTravel > 0)
                    {
                        vaneuj++;
                    }
                }
            }


            if (vaneuj != 0)
            {
                foreach (var Hajok in Boats.GetAllBoatsByOwner(Members.getMemberByEmail(email)))
                {
                    foreach (var Requests in RentRequests.GetAllRentRequestsByBoatToBorrow(Hajok))
                    {
                        if (Requests.HowManyPersonWillTravel > 0)
                        {
                            GlobalRequest             = Requests;
                            lbNotification.Visibility = Visibility.Hidden;
                            btAccept.Visibility       = Visibility.Visible;
                            btDecline.Visibility      = Visibility.Visible;
                            cv1.Visibility            = Visibility.Visible;
                            cv2.Visibility            = Visibility.Visible;
                            cv3.Visibility            = Visibility.Visible;
                            tbRenterEmail.Text        = Requests.WhoBorrows.Email;
                            tbRenterName.Text         = Requests.WhoBorrows.MemberName;
                            tbRenterResidency.Text    = Requests.WhoBorrows.City;
                            tbStartPlace.Text         = Requests.FromWhere;
                            tbEndPlace.Text           = Requests.ToWhere;
                            tbPeople.Text             = Requests.HowManyPersonWillTravel.ToString();

                            tbBoatName.Text = Requests.ToWhere;


                            dpEnd.Text        = Requests.EndDate.ToString();
                            dpEnd.IsEnabled   = false;
                            dpStart.Text      = Requests.StartingDate.ToString();
                            dpStart.IsEnabled = false;

                            tbBoatName.Text        = Hajok.BoatName;
                            tbBoatPlace.Text       = Hajok.WhereIsNowTheBoat;
                            tbBoatDept.Text        = Hajok.DiveDepth.ToString();
                            tbBoatPrice.Text       = Hajok.DailyPrice.ToString();
                            tbBoatConsumption.Text = Hajok.Consumption.ToString();
                            tbBoatType.Text        = Hajok.BoatType;
                            tbBoatManpower.Text    = Hajok.MaxPerson.ToString();
                            tbBoatSpeed.Text       = Hajok.MaxSpeed.ToString();
                            tbBoatWidth.Text       = Hajok.BoatWidth.ToString();
                            tbBoatLenght.Text      = Hajok.BoatLength.ToString();
                            tbBoatYear.Text        = Hajok.YearOfManufacture.ToString();


                            LoadUserDataService loadUserDataService = new LoadUserDataService(email);

                            imgRenterPicture.Tag = loadUserDataService.ResponseMessage["MemberImage"];
                            var uri    = new Uri(Convert.ToString(imgRenterPicture.Tag), UriKind.Absolute);
                            var bitmap = new BitmapImage(uri);
                            imgRenterPicture.Source = bitmap;

                            LoadSelectedBoatService loadSelectedBoatService = new LoadSelectedBoatService(Convert.ToString(Requests.BoatToBorrow.BoatId));
                            imgBoatPicture.Source = LoadImage(loadSelectedBoatService.ResponseMessage["BoatImage"]);
                            imgBoatPicture.Tag    = loadSelectedBoatService.ResponseMessage["BoatImage"];
                        }
                    }
                }
            }
            else
            {
                btAccept.Visibility       = Visibility.Hidden;
                btDecline.Visibility      = Visibility.Hidden;
                cv1.Visibility            = Visibility.Hidden;
                cv2.Visibility            = Visibility.Hidden;
                cv3.Visibility            = Visibility.Hidden;
                lbNotification.Visibility = Visibility.Visible;
            }
        }