コード例 #1
0
ファイル: Program.cs プロジェクト: radtek/MMRDS
        static async Task Main(string[] args)
        {
            if (args.Length > 0)
            {
                switch (args[0].ToLower())
                {
                case "help":
                case "h":
                case "-h":
                case "-help":
                    print_help();
                    break;

                case "backup":
                    var db_backup = new mmria.console.db.Backup();
                    await db_backup.Execute(args);

                    break;

                case "restore":
                    var db_retore = new mmria.console.db.Restore();
                    await db_retore.Execute(args);

                    break;

                case "import":
                    var db_import = new mmria.console.import_mmria_format();
                    await db_import.Execute(args);

                    break;

                case "export":
                    var db_export = new mmria.console.export_mmria_format();
                    await db_export.Execute(args);

                    break;

                case "convert":
                    var convert = new mmria.console.convert();
                    await convert.Execute(args);

                    break;

                default:
                    return;
                }
            }
            else
            {
                print_help();
                return;
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: radtek/MMRDS
        //import user_name:user1 password:password database_file_path:mapping-file-set/Maternal_Mortality.mdb url:http://localhost:12345
        //import user_name:user1 password:password database_file_path:mapping-file-set/Maternal_Mortality.mdb url:http://test.mmria.org
        //export user_name:user1 password:password url:http://localhost:12345
        //export-core user_name:user1 password:password url:http://localhost:12345

        //export user_name:user1 password:password url:http://test.mmria.org
        //export-core user_name:user1 password:password url:http://test.mmria.org
        //import user_name:user1 password:password database_file_path:c:\temp\Maternal_Mortality.mdb url:http://test.mmria.org
        //import user_name:user1 password:password database_file_path:c:\temp\Maternal_Mortality.mdb url:http://localhost:12345
        //import user_name:user1 password:password database_file_path:c:\temp\Import_TestCases_13Jun2017\Import_TestCases_13Jun2017.mdb url:http://test.mmria.org
        //import user_name:user1 password:password database_file_path:c:\temp\Mock_Review_Demo_Cases_May2017.mdb url:http://test.mmria.org

        //backup user_name:user1 password:password database_url:http://demodb.mmria.org/metadata backup_file_path:c:\temp\bk-meta.bk

        public static void Main(string[] args)
        {
            System.Net.ServicePointManager.CertificatePolicy = new mmria.console.util.NoCheckCertificatePolicy();


            if (args.Length > 0)
            {
                switch (args[0])
                {
                case "import":
                    var import_run = new mmria.console.import.mmrds_importer();
                    import_run.Execute(args);
                    break;

                case "export":
                    var exporter = new mmria.console.export.mmrds_exporter();
                    exporter.Execute(args);
                    break;

                case "export-core":
                    var core_exporter = new mmria.console.export.core_element_exporter();
                    core_exporter.Execute(args);
                    break;

                case "backup":
                    var db_backup = new mmria.console.db.Backup();
                    db_backup.Execute(args);
                    break;

                case "restore":
                    var db_retore = new mmria.console.db.Restore();
                    db_retore.Execute(args);
                    break;

                default:
                    return;
                }
            }
            else
            {
                System.Console.WriteLine("use:");
                System.Console.WriteLine("\timport");
                System.Console.WriteLine("\texport");
                System.Console.WriteLine("\texport-coere");
                System.Console.WriteLine("\tbackup");
                System.Console.WriteLine("\trestore");
                return;
            }
        }