コード例 #1
0
        public async void ModifyUserInfoCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var user       = this.User;
            var userWindow = new UserWindow.UserWindow(ref user)
            {
                Owner = this
            };

            userWindow.ShowDialog();

            if (!userWindow.NameChanged)
            {
                return;
            }

            try
            {
                var bookName    = this.LaboratoryBookName;
                var columnNames = await Task.Run(() =>
                {
                    return(User.GetColumnNames(bookName));
                });

                var searchText = TbxSearch.Text;

                await SetLists();

                this.LaboratoryDataTable = await Task.Run(() =>
                {
                    return(User.SearchInLaboratoryBook(
                               LaboratoryBookName,
                               LaboratoryBookPermission,
                               columnNames.ToArray(),
                               searchText));
                });



                this.LaboratoryDataTable.RowChanged  += LaboratoryDataTableRowChanged;
                this.LaboratoryDataTable.RowDeleting += LaboratoryDataTableRowDeleting;

                //this.DgLaboratoryBook.PreviewKeyDown += DgLaboratoryBookPreviewKeyDown;

                //this.DgLaboratoryBook.CellEditEnding += DgLaboratoryBook_CellEditEnding;
            }
            catch (Exception exception)
            {
                MessageBox.Show
                (
                    exception.Message,
                    "Search error",
                    MessageBoxButton.OK,
                    MessageBoxImage.Error
                );
            }
        }
コード例 #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.wndwUserWindow = ((LaboratoryBook.UserWindow.UserWindow)(target));
                return;

            case 2:

            #line 19 "..\..\..\UserWindow\UserWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CloseCommand_CanExecute);

            #line default
            #line hidden

            #line 20 "..\..\..\UserWindow\UserWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CloseCommand_Executed);

            #line default
            #line hidden
                return;

            case 3:

            #line 23 "..\..\..\UserWindow\UserWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.ChangeNameoseCommand_CanExecute);

            #line default
            #line hidden

            #line 24 "..\..\..\UserWindow\UserWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ChangeNameCommand_Executed);

            #line default
            #line hidden
                return;

            case 4:

            #line 27 "..\..\..\UserWindow\UserWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.ChangePassowrdCommand_CanExecute);

            #line default
            #line hidden

            #line 28 "..\..\..\UserWindow\UserWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ChangePassowrdCommand_Executed);

            #line default
            #line hidden
                return;

            case 5:
                this.TbkUserName = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 6:
                this.TbkStatus = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 7:
                this.PbxOldPassword = ((System.Windows.Controls.PasswordBox)(target));
                return;

            case 8:
                this.PbxNewPassword = ((System.Windows.Controls.PasswordBox)(target));
                return;

            case 9:
                this.PbxRepeatPassword = ((System.Windows.Controls.PasswordBox)(target));
                return;
            }
            this._contentLoaded = true;
        }