void SelectTableWindow_Loaded(object sender, RoutedEventArgs e)
        {
            DocDbObject myData = MyDocDataContext as DocDbObject;

            CoreEA.CoreE  core      = new CoreEA.CoreE(myData.SourceDbType);
            ICoreEAHander myHandler = null;

            myHandler = core.X_Handler;
            try
            {
                myHandler.Open(myData.LoginInfo);
                if (myHandler.IsOpened)
                {
                    tableList = myHandler.GetTableListInDatabase();


                    listControl.ItemsSource = tableList;
                }
            }
            catch (Exception ee)
            {
                ee.HandleMyException();
            }
            finally
            {
                if (myHandler.IsOpened)
                {
                    myHandler.Close();
                }
            }
        }
示例#2
0
        public void Leave()
        {
            DocDbObject myData = (DocDbObject)MyDocDataContext;

            myData.CurExportor = ((ComboBoxItem)cmbTargetType.SelectedItem).Tag as Exportor;
            myData.TargetFile  = myFile.X_FileName;
        }
        public void Leave()
        {
            List <string> tableList = new List <string>();

            foreach (var item in listControl.SelectedItems)
            {
                tableList.Add(item.ToString());
            }

            DocDbObject myData = MyDocDataContext as DocDbObject;

            myData.SelectedTableNameCollection = tableList;
        }
        /// <summary>
        /// Generate the detail schemas
        /// Important method
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void DoDBSchema_Loaded(object sender, RoutedEventArgs e)
        {
            DocDbObject     myData = MyDocDataContext as DocDbObject;
            List <DBObject> dbList = new List <DBObject>();

            CoreEA.CoreE  core      = new CoreEA.CoreE(myData.SourceDbType);
            ICoreEAHander myHandler = null;

            myHandler        = core.X_Handler;
            this.DataContext = null;

            try
            {
                myHandler.Open(myData.LoginInfo);
                if (myHandler.IsOpened)
                {
                    //Just process the selected table .
                    foreach (var table in myData.SelectedTableNameCollection)
                    {
                        BaseTableSchema mySchema = myHandler.GetTableSchemaInfoObject(table);

                        foreach (var column in mySchema.Columns)
                        {
                            dbList.Add(new DBObject()
                            {
                                IsIdentity       = column.IsIdentity,
                                TableName        = table,
                                ColumnName       = column.ColumnName,
                                DbType           = column.ColumnType,
                                Length           = column.CharacterMaxLength,
                                OrdinaryPosition = column.OrdinalPosition,
                                RevisionDate     = DateTime.Now,
                                RevisionNote     = "",
                                Category         = "",
                                Format           = 0,
                                IsPrimaryKey     = mySchema.PrimaryKey.IsContaintPrimaryColumn(column.ColumnName),
                                Description      = "",
                                IsIndex          = (mySchema.Indexes.Where(c => c.ColumnName == column.ColumnName).Count() > 0),
                            });
                        }
                    }

                    this.DataContext = dbList;

                    myData.DbObjectList = dbList;
                }
                else
                {
                    throw new Exception("Can't open such data source");
                }
            }
            catch (Exception ee)
            {
                ee.HandleMyException();
            }
            finally
            {
                if (myHandler.IsOpened)
                {
                    myHandler.Close();
                }
            }
        }
示例#5
0
        public void Leave()
        {
            DocDbObject myData = (DocDbObject)MyDocDataContext;

            myData.SourceDbType = ((DbTypeWrapper)cmbSrcDbType.SelectedItem).MyType;
        }