Пример #1
0
        static void ReturnThread()
        {
            CultureInfo ci = new CultureInfo("en-us");

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            System.Object lockThis = new System.Object();
            while (true)
            {
                try
                {
                    lock (lockThis)
                    {
                        if (DateTime.Now.Hour > 8 && DateTime.Now.Hour < 19 && DateTime.Now.Minute > 20 && DateTime.Now.Minute < 30 && DateTime.Now.Hour != lastUpHourRT)
                        {
                            WorkMethods.ReturnReception();
                            FTP.GetFiles4Returns();
                            lastUpHourRT = DateTime.Now.Hour;
                        }
                        System.Threading.Thread.Sleep(80000);
                        //System.Threading.Thread.Sleep(600000);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("{0} Exception caught.", ex);
                    Logs.ErrorLog(ex.ToString());
                }
            }
        }
Пример #2
0
        static void IncomingThread()
        {
            CultureInfo ci = new CultureInfo("en-us");

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            System.Object lockThis = new System.Object();
            while (true)
            {
                try
                {
                    lock (lockThis)
                    {
                        if (DateTime.Now.Hour != lastUpHourIn)
                        {
                            WorkMethods.IncomingReception();
                            FTP.GetFiles4Incomings(dayOffset: -1);
                            lastUpHourIn = DateTime.Now.Hour;
                        }
                        System.Threading.Thread.Sleep(90000);
                        //System.Threading.Thread.Sleep(600000);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("{0} Exception caught.", ex);
                    Logs.ErrorLog(ex.ToString());
                }
            }
        }
Пример #3
0
        private void NewPlayerForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            String mes = WorkMethods.CleanRAWFiles();

            if (!mes.Equals("ok"))
            {
                MessageBox.Show(mes);
            }
        }
Пример #4
0
 protected void buttonOK_Click(object sender, EventArgs e)
 {
     MessageBox.Show(WorkMethods.Save(project));
     WorkerXML.Serialize(project);
 }