Exemple #1
0
        static void Main(string[] args)
        {
            try
            {
                ClientProcess.RunAsync().GetAwaiter().GetResult();
            }
            catch (Exception)
            {
                Console.WriteLine("Api nedostupné");
            }
            JobsService.RunJobsClient().GetAwaiter().GetResult();
            //Console.ReadLine();


            Timer aTimer = new Timer();

            aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            aTimer.Interval = 60000;
            aTimer.Enabled  = true;

            //while (Console.Read() != 'q') ;
            while (true)
            {
                Console.WriteLine("avaiable jobs: ");
                var jobs = new List <JobsClientModel>(JobsManage.LoadJobs());
                for (int i = 0; i < jobs.Count; i++)
                {
                    Console.WriteLine(i);
                }
                Console.WriteLine("type jobid: ");
                int temp = Convert.ToInt32(Console.ReadLine());
                //try
                //{
                BackupLogic.DoBackup(jobs[temp]);
                //}
                //catch
                //{
                //    Console.WriteLine("job doesnt exists");
                //}
                Console.ReadLine();
            }
        }
 public FormComments(ICommentLogic logic, BackupLogic bLogic)
 {
     InitializeComponent();
     this.logic  = logic;
     this.bLogic = bLogic;
 }