示例#1
0
        //internal static void MoveFocusToNextControlOnEnter(object sender, KeyEventArgs e) {
        //    if (e.Key != Key.Enter) return;
        //    var tRequest = new TraversalRequest(FocusNavigationDirection.Next);
        //    var keyboardFocus = Keyboard.FocusedElement as UIElement;

        //    if (keyboardFocus != null) {
        //        keyboardFocus.MoveFocus(tRequest);
        //    }
        //    e.Handled = true;
        //}

        internal static Nfmb SearchMember()
        {
            var members     = Nfmb.GetList();
            var searchItems =
                members.Select(
                    member =>
                    new SearchItem(member.ID, member.MemberName)
            {
                ItemCode = member.MemberCode
            }).
                ToList();

            var searchByCodeWindow = new SearchByCodeWindow(searchItems);

            searchByCodeWindow.ShowDialog();


            if (searchByCodeWindow.DialogResult == false)
            {
                return(null);
            }

            var searchItem = new Nfmb();

            searchItem.Find(searchByCodeWindow.SelectedItem.ItemId);
            return(searchItem);
        }
        private void Read(object sender, RoutedEventArgs e)
        {
            List <Nfmb>       members     = Nfmb.GetList();
            List <SearchItem> searchItems =
                members.Select(
                    member =>
                    new SearchItem(member.ID, member.MemberName)
            {
                ItemCode = member.MemberCode
            }).ToList();

            var searchByCodeWindow = new SearchByCodeWindow(searchItems);

            searchByCodeWindow.ShowDialog();
            if (searchByCodeWindow.DialogResult != true)
            {
                return;
            }

            _member.Find(searchByCodeWindow.SelectedItem.ItemId);
            RefreshDisplay();
        }