Ejemplo n.º 1
0
        private void MenuItem_查看数据表数据_1(object sender, RoutedEventArgs e)
        {
            DBTableNode tableNode = ((FrameworkElement)e.OriginalSource).DataContext as DBTableNode;

            Forms.DataViewer frm = new Forms.DataViewer(tableNode.Table);
            frm.Show();
        }
Ejemplo n.º 2
0
        public void AddTable2Me(DBTableNode tableNode, Point point)
        {
            EJ.TableInModule tInM = new EJ.TableInModule();
            tInM.x        = Math.Max(0, Convert.ToInt32(point.X));
            tInM.y        = Math.Max(0, Convert.ToInt32(point.Y));
            tInM.TableID  = tableNode.Table.id;
            tInM.ModuleID = this.ModuleNode.Module.id;
            try
            {
                var columns = Helper.Client.InvokeSync <EJ.DBColumn[]>("GetColumns", tableNode.Table.id.Value);
                tInM.id = Helper.Client.InvokeSync <int>("UpdateTableInMoudle", tInM);
                tInM.ChangedProperties.Clear();

                UI.Table uiTable = new Table(this);
                uiTable.TableInModule = tInM;
                uiTable.Margin        = new Thickness(point.X, point.Y, 0, 0);
                uiTable.DataSource    = new Table._DataSource()
                {
                    Table   = tableNode.Table,
                    Columns = columns,
                };
                uiTable.DataBind();
                uiTable.MoveCompleted += uiTable_MoveCompleted;
                m_Grid.Children.Add(uiTable);
            }
            catch (Exception ex)
            {
                MessageBox.Show(MainWindow.instance, ex.Message);
            }
        }
Ejemplo n.º 3
0
        void m_Grid_Drop(object sender, System.Windows.DragEventArgs e)
        {
            e.Handled = true;
            Point       point     = e.GetPosition(m_Grid);
            DBTableNode tableNode = e.Data.GetData(typeof(DBTableNode)) as DBTableNode;

            if (tableNode != null)
            {
                AddTable2Me(tableNode, point);
            }
        }
Ejemplo n.º 4
0
        private void MenuItem_删除数据表_Click_1(object sender, RoutedEventArgs e)
        {
            DBTableNode modulenode = (DBTableNode)tree1.SelectedItem;

            modulenode.Delete();
        }
Ejemplo n.º 5
0
        private void MenuItem_设计数据表_Click_1(object sender, RoutedEventArgs e)
        {
            DBTableNode tableNode = ((FrameworkElement)e.OriginalSource).DataContext as DBTableNode;

            tableNode.OnDoubleClick(null, null);
        }