Exemple #1
0
        public static void Main(string[] args)
        {
#if (DEBUG)
            args = new List <string> {
                "-fsp", "D:\\CrawlerReports"
            }.ToArray();
#else
            if (args.Length == 0)
            {
                Console.WriteLine("Please enter a argument -fsp to select a path to save file to be processed. Example -fsp C:/MyFolder.");

                Console.WriteLine("Press any key to exit.");
                Console.ReadKey();
            }
#endif
            if (args.Length > 0)
            {
                var argumentData = ArgumentService.CheckCommands(args);

                Console.WriteLine("\n\nPlease wait, the necessary data is being obtained.\n");
                RunAsync(argumentData).GetAwaiter().GetResult();

                Console.WriteLine("Press any key to exit.");
                Console.ReadKey();
            }
        }
 public AddWorkDoneForm(ApplicationDbContext context)
 {
     dbContext         = context;
     subjectService    = new SubjectService(dbContext);
     solidWasteService = new SolidWasteService(dbContext);
     argumentService   = new ArgumentService(dbContext);
     collectService    = new CollectService(dbContext);
     employeService    = new EmployeService(dbContext);
     InitializeComponent();
 }
Exemple #3
0
        public void Init()
        {
            _mockSettings          = new Mock <ISettings>();
            _mockArgService        = new Mock <IArgumentRepository>();
            _mockControllerService = new Mock <IControllerService>();

            _service = new ArgumentService(_mockSettings.Object,
                                           _mockArgService.Object);

            _mockSettings.Setup(s => s.HelpString()).Returns(_help);
            _mockSettings.Setup(s => s.ArgumentPrefix()).Returns(_pre);
        }
Exemple #4
0
        static void Main(string[] args)
        {
            ArgumentService parsing       = new ArgumentService();
            int             parsingresult = parsing.ParsingArguments(args);

            if (parsingresult == 1)
            {
                Console.WriteLine("\nUsage: DbConnect.exe <-ping|-sql> <database>\n");
                Environment.Exit(0);
            }

            string commandname  = args[0];
            string databasename = args[1];

            // Build the configuration settings to be used in this application.
            ConfigurationService service = new ConfigurationService(databasename);
            var configuration            = service.Configuration;

            DatabaseService database = new DatabaseService();

            // Get connection string from configuration source.
            string connectionstring = database.ConnectionString(configuration, databasename);

            switch (commandname)
            {
            case "-ping":

                // Get database status using the connection string from configuration source.
                string statusmessage = database.ConnectionStatus(connectionstring, databasename);
                Console.WriteLine(statusmessage);

                break;

            case "-sql":

                // Run SQL command using the connection string from configuration source.
                string commandstring = database.CommandString(configuration, databasename);
                database.Command(connectionstring, commandstring);

                break;
            }
        }
 public AddArgumentForm(ApplicationDbContext context)
 {
     dbContext       = context;
     argumentService = new ArgumentService(dbContext);
     InitializeComponent();
 }