Ejemplo n.º 1
0
        public void DragDrop_CopyDatabase(AppObject draggingObject)
        {
            var conn = this.FindServerConnection();

            if (draggingObject is DatabaseAppObject)
            {
                try
                {
                    IDatabaseSource dsource = ((DatabaseAppObject)draggingObject).FindDatabaseConnection();
                    var             dbprops = new DatabaseProperties();
                    dbprops.Name = dsource.DatabaseName;
                    DatabasePropertiesForm.Run(dbprops, new GenericDatabaseSource(conn, conn.Connection, null), false);
                    //string newname = InputBox.Run(Texts.Get("s_name_of_new_database"), dsource.DatabaseName);
                    //if (newname == null) return;
                    if (ArrayTool.Contains(conn.Databases, dbprops.Name))
                    {
                        StdDialog.ShowError(Texts.Get("s_database_allready_exists"));
                        return;
                    }
                    IDatabaseSource newdb = conn.CreateDatabase(dbprops.Name, dbprops.SpecificData);
                    CopyDbWizard.Run(dsource.CloneSource(), newdb.CloneSource());
                    //CopyDbProcess.StartProcess(dsource.CloneSource(), newdb.CloneSource(), null);
                }
                catch (Exception e)
                {
                    Errors.Report(e);
                }
            }
        }
Ejemplo n.º 2
0
        public void RunImportDataArchive()
        {
            var            dbconn = this.FindDatabaseConnection(ConnPack);
            OpenFileDialog dlg    = new OpenFileDialog();

            dlg.Filter = String.Format("{0} (*.dbk)|*.dbk", Texts.Get("s_data_archives"));
            if (dlg.ShowDialogEx() == DialogResult.OK)
            {
                DataArchiveReader dar = new DataArchiveReader(dlg.FileName);
                CopyDbWizard.Run(dar, dbconn.CloneSource());
            }
        }
Ejemplo n.º 3
0
        public void DragDrop_CreateDataArchive(AppObject appobj)
        {
            var dobj = appobj as DatabaseAppObject;

            if (dobj == null)
            {
                return;
            }
            string dbname = dobj.DatabaseName;
            string fn     = System.IO.Path.Combine(Folder.FolderDiskPath, (dbname ?? "") + ".dbk");

            CopyDbWizard.Run(dobj.FindDatabaseConnection(ConnPack).CloneSource(),
                             new DataArchiveWriter {
                FilePlace = FilePlaceAddonType.PlaceFromVirtualFile(fn)
            }
                             );
        }
Ejemplo n.º 4
0
        public void DragDrop_CopyDatabase(AppObject appobj)
        {
            var dbconn = this.FindDatabaseConnection(ConnPack);

            if (appobj is DatabaseAppObject)
            {
                try
                {
                    IDatabaseSource dsource = ((DatabaseAppObject)appobj).FindDatabaseConnection(ConnPack);
                    CopyDbWizard.Run(dsource.CloneSource(), dbconn.CloneSource());
                }
                catch (Exception e)
                {
                    Errors.Report(e);
                }
            }
        }