コード例 #1
0
        private void Submit(object sender, RoutedEventArgs e)
        {
            Button sent = sender as Button;

            if (((String)sent.Name).Equals("cancelButton"))
            {
                NavigationService.GoBack();
                return;
            }

            // only update a rental if it was found in the lookup
            if (rentalFound)
            {
                rental.CheckinTime     = DateTime.Now;
                rental.Resource.Status = Resource.ResourceStatus.RETURNED;

                rentals.updateSingle(rental);
                resources.updateSingle(rental.Resource);

                infoWindow = new InformationWindow("Item Checkin");
                infoWindow.setInfoText("Rental was successfully checked in.");

                infoWindow.ShowDialog();
            }

            NavigationService.GoBack();
        }
コード例 #2
0
ファイル: MainViewModel.cs プロジェクト: handbros/MView
        public void Information()
        {
            Window window = new InformationWindow();

            WindowVisibility = false;
            window.ShowDialog();
            WindowVisibility = true;
        }
コード例 #3
0
        private void InformationButton_Click(object sender, RoutedEventArgs e)
        {
            InformationWindow IW = new InformationWindow();

            IW.Owner = this;
            this.Hide();
            IW.ShowDialog();
            this.Show();
        }
コード例 #4
0
        private static async Task ShowInformationDialogAsync(InformationMessage message)
        {
            if (message is ExceptionMessage)
            {
                Trace.TraceError($"Exception: { message.VM.Details }");
            }

            var window = new InformationWindow()
            {
                VM = message.VM
            };

            await window.ShowDialog(MainWindow);

            message.Process();
        }
コード例 #5
0
        private void resourceId_LostFocus(object sender, RoutedEventArgs e)
        {
            TextBox       sent = sender as TextBox;
            int           id   = -1;
            List <Rental> checkedOut;

            if (sent.Text == "")
            {
                return;
            }

            if (!int.TryParse(sent.Text, out id))
            {
                //display error message
                return;
            }

            checkedOut = rentals.getRentalByResourceId(id);

            if (checkedOut == null || checkedOut.Count < 1)
            {
                infoWindow = new InformationWindow("Rental not found");

                infoWindow.setInfoText("A rental associated to the resource with id " +
                                       id + " was not found");

                infoWindow.ShowDialog();
                return;
            }

            rentalFound = true;

            rental           = checkedOut[0];
            renterName.Text  = rental.Renter.FullName;
            renterEmail.Text = rental.Renter.CpEmail;

            returnButton.Focus();
        }
コード例 #6
0
 private void Information()
 {
     _informationWindow       = new InformationWindow();
     _informationWindow.Owner = Application.Current.MainWindow;
     _informationWindow.ShowDialog();
 }
コード例 #7
0
 public void ShowInformationWindow()
 {
     InformationOpen = new InformationWindow();
     InformationOpen.ShowDialog();
 }
コード例 #8
0
        private void information_button_Click(object sender, RoutedEventArgs e)
        {
            InformationWindow informationwindow = new InformationWindow();

            informationwindow.ShowDialog();
        }
コード例 #9
0
        private void OnClickInformation()
        {
            Window window = new InformationWindow();

            window.ShowDialog();
        }
コード例 #10
0
        private void InformationButtonClick(object sender, RoutedEventArgs e)
        {
            var informationDialog = new InformationWindow();

            informationDialog.ShowDialog();
        }