Exemplo n.º 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);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
 private void radImport_CheckedChanged(object sender, EventArgs e)
 {
     _mongoImportExportCommand.Direct = radExport.Checked
         ? MongoImportExportInfo.ImprotExport.Export
         : MongoImportExportInfo.ImprotExport.Import;
     OnCommandChange(new TextChangeEventArgs(string.Empty,
                                             MongoImportExportInfo.GetMongoImportExportCommandLine(_mongoImportExportCommand)));
 }
Exemplo n.º 4
0
 private void txtFieldList_TextChanged(object sender, EventArgs e)
 {
     _mongoImportExportCommand.FieldList = txtFieldList.Text;
     OnCommandChange(new TextChangeEventArgs(string.Empty,
                                             MongoImportExportInfo.GetMongoImportExportCommandLine(_mongoImportExportCommand)));
 }
Exemplo n.º 5
0
 private void numPort_ValueChanged(object sender, EventArgs e)
 {
     _mongoImportExportCommand.Port = (int)numPort.Value;
     OnCommandChange(new TextChangeEventArgs(string.Empty,
                                             MongoImportExportInfo.GetMongoImportExportCommandLine(_mongoImportExportCommand)));
 }
Exemplo n.º 6
0
 private void txtCollectionName_TextChanged(object sender, EventArgs e)
 {
     _mongoImportExportCommand.CollectionName = txtCollectionName.Text;
     OnCommandChange(new TextChangeEventArgs(string.Empty,
                                             MongoImportExportInfo.GetMongoImportExportCommandLine(_mongoImportExportCommand)));
 }
Exemplo n.º 7
0
 private void ctllogLvT_LoglvChanged(MongodbDosCommand.MongologLevel logLv)
 {
     _mongoImportExportCommand.LogLv = logLv;
     OnCommandChange(new TextChangeEventArgs(string.Empty,
                                             MongoImportExportInfo.GetMongoImportExportCommandLine(_mongoImportExportCommand)));
 }
Exemplo n.º 8
0
 private void ctlFilePickerOutput_PathChanged(string filePath)
 {
     _mongoImportExportCommand.FileName = filePath;
     OnCommandChange(new TextChangeEventArgs(string.Empty,
                                             MongoImportExportInfo.GetMongoImportExportCommandLine(_mongoImportExportCommand)));
 }