예제 #1
0
파일: Program.cs 프로젝트: minrogi/PLMPack
        static int Main(string[] args)
        {
            try
            {
                // set up a simple configuration that logs on the console.
               log4net.Config.XmlConfigurator.Configure();
                // command line parsing
                Options options = new Options();
                if (!CommandLine.Parser.Default.ParseArguments(args, options))
                {
                    Console.WriteLine(options.GetUsage());
                    return -1;
                }
                string dbPath = options.InputFile;
                _log.Info(string.Format("db path = {0}", dbPath));

                LegacyDBUploder uploader = new treeDiM.PLMPackLib.LegacyDBUploder();
                LoggingCallback callback = new LoggingCallback();
                uploader.DatabasePath = dbPath;
                uploader.UserName = options.UserName;
                uploader.Password = options.Password;
                uploader.ActuallyUpload = !options.Test;
                uploader.Upload(callback);
            }
            catch (Exception ex)
            {
                _log.Error(ex.ToString());
                return -1;
            }
            return 0;
        }
예제 #2
0
        static int Main(string[] args)
        {
            try
            {
                // set up a simple configuration that logs on the console.
                log4net.Config.XmlConfigurator.Configure();
                // command line parsing
                Options options = new Options();
                if (!CommandLine.Parser.Default.ParseArguments(args, options))
                {
                    Console.WriteLine(options.GetUsage());
                    return(-1);
                }
                string dbPath = options.InputFile;
                _log.Info(string.Format("db path = {0}", dbPath));

                LegacyDBUploder uploader = new treeDiM.PLMPackLib.LegacyDBUploder();
                LoggingCallback callback = new LoggingCallback();
                uploader.DatabasePath   = dbPath;
                uploader.UserName       = options.UserName;
                uploader.Password       = options.Password;
                uploader.ActuallyUpload = !options.Test;
                uploader.Upload(callback);
            }
            catch (Exception ex)
            {
                _log.Error(ex.ToString());
                return(-1);
            }
            return(0);
        }