Esempio n. 1
0
        private void _export(ServerType mode, string subPath, FileType fileType = FileType.Detect)
        {
            string path;

            try {
                path = fileType == FileType.Sql ? PathRequest.FolderExtractSql() : PathRequest.FolderExtractDb();

                if (path != null)
                {
                    _asyncOperation.SetAndRunOperation(new GrfThread(() => _internalExport(mode, path, subPath, fileType), this, 200, null, false, true));
                }
            }
            catch (Exception err) {
                ErrorHandler.HandleException(err);
            }
        }
Esempio n. 2
0
        private void _clientDbExport(FileType fileType)
        {
            try {
                if (_isClientSyncConvert())
                {
                    if (_delayedReloadDatabase)
                    {
                        if (!ReloadDatabase())
                        {
                            return;
                        }
                        _asyncOperation.WaitUntilFinished();
                    }

                    string path = this.Dispatch(p => PathRequest.FolderExtractDb());

                    if (path == null)
                    {
                        return;
                    }

                    Progress = -1;
                    this.Dispatch(p => p._mainTabControl.IsEnabled = false);
                    var db = _clientDatabase.GetDb <int>(ServerDbs.CItems);
                    DbIOClientItems.WriterSub(null, db, path, fileType);
                    OpeningService.FileOrFolder(path);
                }
                else
                {
                    ErrorHandler.HandleException("You must synchronize the client databases first. Go in the settings page.");
                }
            }
            catch (Exception err) {
                ErrorHandler.HandleException(err);
            }
            finally {
                Progress = 100;
                this.Dispatch(p => p._mainTabControl.IsEnabled = true);
            }
        }