コード例 #1
0
ファイル: EditPageCommands.cs プロジェクト: geji5239/Geji2015
        private void OnGetTable(object parameter)
        {
            var editField             = parameter as EditField;
            SelectDataTableWindow win = new SelectDataTableWindow((group, table) =>
            {
                editField.ForeignGroup = group;
                editField.ForeignTable = table;
            });

            win.ShowDialog();
        }
コード例 #2
0
        private void btnGetTable_Click(object sender, RoutedEventArgs e)
        {
            SelectDataTableWindow win = new SelectDataTableWindow((group, table) =>
            {
                if (DataContext != null && DataContext is Page && (DataContext as Page).Config is MvcEditPage)
                {
                    var page         = (DataContext as Page).Config as MvcEditPage;
                    var source       = page.EditSource;
                    source.GroupName = group;
                    source.TableName = table;
                    if (System.Windows.MessageBox.Show("数据表已更改,重新刷新列吗?", "刷新列", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                    {
                        page.EditSource.Fields.Clear();
                        page.ImportTable();
                    }
                }
            });

            win.ShowDialog();
        }