コード例 #1
0
        /// <summary>
        /// Show the query window
        /// </summary>
        /// <param name="queries"></param>
        public void ShowQueryWindow(Queries queries)
        {
            TraceLog.WriteLine(new StackFrame().GetMethod().Name, "I see there are " + queries.Count() + " queries here.");
            var query = new QueryDialog(queries);

            query.ShowDialog();
        }
コード例 #2
0
 private async void QueryBtn_Click(object sender, RoutedEventArgs e)
 {
     if (QuerySno.Text != "")
     {
         var datalist = conn.Query <Student>("select *from Student where Sno = ?", QuerySno.Text);
         if (datalist.Count != 0)
         {
             StuViewModel.StudentDatas.Clear();
             foreach (var item in datalist)
             {
                 StuViewModel.StudentDatas.Add(new StudentData()
                 {
                     Sname = "姓名:" + item.Sname, Sno = "学号:" + item.Sno, Sex = "性别:" + item.Sex, Age = "年龄:" + item.Age.ToString(), Password = "******" + item.Password
                 });
             }
             QueryDialog.Hide();
             PopupNotice popupNotice = new PopupNotice("查找成功");
             popupNotice.ShowAPopup();
         }
         else
         {
             MessageDialog AboutDialog = new MessageDialog("该学生不存在!", "提示");
             await AboutDialog.ShowAsync();
         }
     }
     else
     {
         MessageDialog AboutDialog = new MessageDialog("请输入待查询学生的学号!", "提示");
         await AboutDialog.ShowAsync();
     }
 }
コード例 #3
0
ファイル: BaseCommands.cs プロジェクト: rad9k/MinusZero2
        public static IVertex Query(IVertex baseVertex, IVertex inputVertex)
        {
            QueryDialog d = new QueryDialog(baseVertex.Get("To:"));

            MinusZero.Instance.DefaultShow.ShowContentFloating(d);

            return(null);
        }
コード例 #4
0
        public override void Execute(object parameter)
        {
            var repository       = RepositoryManager.GetRepository(RepositoryManager.Folders);
            var folderRepository = repository.Entries.FirstOrDefault();

            if (folderRepository == null)
            {
                return;
            }

            var databaseUri = DatabaseUri.Empty;
            var query       = string.Empty;
            var name        = "Folder";

            do
            {
                var dialog = new QueryDialog(query, databaseUri, name);
                if (AppHost.Shell.ShowDialog(dialog) != true)
                {
                    return;
                }

                name        = dialog.QueryName;
                databaseUri = dialog.DatabaseUri ?? DatabaseUri.Empty;
                query       = dialog.Query;

                if (LibraryManager.Libraries.Any(w => string.Compare(w.Name, name, StringComparison.InvariantCultureIgnoreCase) == 0))
                {
                    AppHost.MessageBox(string.Format("A folder with the name '{0}' already exists.\n\nPlease choose another name.", name), "Information", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    break;
                }
            }while (true);

            var fileName = IO.File.GetSafeFileName(name + ".xml");

            fileName = Path.Combine(folderRepository.Path, fileName);

            var folder = new QueryLibrary(fileName, name)
            {
                DatabaseUri = databaseUri,
                Query       = query
            };

            folder.Save();
            folder.Initialize();

            LibraryManager.Add(folder);

            folder.IsExpanded = true;
            folder.Refresh();
        }
コード例 #5
0
        public override void Execute(object parameter)
        {
            var context = parameter as ContentTreeContext;

            if (context == null)
            {
                return;
            }

            var item = context.SelectedItems.FirstOrDefault() as LibraryTreeViewItem;

            if (item == null)
            {
                return;
            }

            var library = item.Library as QueryLibrary;

            if (library == null)
            {
                return;
            }

            var dialog = new QueryDialog(library.Query, library.DatabaseUri, library.Name)
            {
                IsQueryNameVisible = false
            };

            if (AppHost.Shell.ShowDialog(dialog) != true)
            {
                return;
            }

            library.Query       = dialog.Query;
            library.DatabaseUri = dialog.DatabaseUri ?? DatabaseUri.Empty;
            library.Save();
            library.Refresh();
            library.IsExpanded = true;
        }
コード例 #6
0
ファイル: ServiceProvider.cs プロジェクト: joecastro/Sheepish
        internal static void ShowQueryDialog()
        {
            ViewModel.ShowingEditDialog = true;

            var dialog = new QueryDialog();
            dialog.Owner = Application.Current.MainWindow;
            dialog.Closed += (sender, e) =>
            {
                RequestRefresh();
                ViewModel.ShowingEditDialog = false;
                _UpdateSettings();
            };
            // Focus tricks we're playing with the status window wreak havoc when trying to actually display a window,
            // so force the window to really be shown.
            dialog.SourceInitialized += (sender, e) => NativeMethods.SetForegroundWindow(new WindowInteropHelper(dialog).Handle);
            Application.Current.Dispatcher.Invoke((Action)(() => dialog.Show()));
        }
コード例 #7
0
 private void CloseBtn2_Click_1(object sender, RoutedEventArgs e)
 {
     QueryDialog.Hide();
 }
コード例 #8
0
 private async void QueryStudent_Click(object sender, RoutedEventArgs e)
 {
     await QueryDialog.ShowAsync();
 }