Beispiel #1
0
        /// <summary>
        ///     Import Collection
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ImportCollectionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var strTitle   = "Import Collection";
            var strMessage = "Are you sure to Import Collection?";

            if (!GuiConfig.IsUseDefaultLanguage)
            {
                strTitle   = GuiConfig.GetText(TextType.DropData);
                strMessage = GuiConfig.GetText(TextType.DropDataConfirm);
            }
            if (!MyMessageBox.ShowConfirm(strTitle, strMessage))
            {
                return;
            }
            if (!MongoPathCheck())
            {
                return;
            }
            var mongoImportExport = MongoImportExportInfo.GetImportExportInfo();
            var importCol         = new OpenFileDialog();

            if (importCol.ShowDialog() == DialogResult.OK)
            {
                mongoImportExport.FileName = importCol.FileName;
            }
            mongoImportExport.Direct = MongoImportExportInfo.ImprotExport.Import;
            var dosCommand = MongoImportExportInfo.GetMongoImportExportCommandLine(mongoImportExport);

            RunCommand(dosCommand);
        }
        /// <summary>
        ///     ExportImport Collection
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ExportCollectionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!MongoPathCheck())
            {
                return;
            }
            var mongoImportExport = MongoImportExportInfo.GetImportExportInfo();
            var exportCol         = new SaveFileDialog
            {
                Filter          = Utility.TxtFilter,
                CheckFileExists = false
            };

            //if the file not exist,the server will create a new one
            if (exportCol.ShowDialog() == DialogResult.OK)
            {
                mongoImportExport.FileName = exportCol.FileName;
            }
            else
            {
                return;
            }
            mongoImportExport.Direct = MongoImportExportInfo.ImprotExport.Export;
            var dosCommand = MongoImportExportInfo.GetMongoImportExportCommandLine(mongoImportExport);

            RunCommand(dosCommand);
        }