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()); } } }
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()); } } }
private void NewPlayerForm_FormClosed(object sender, FormClosedEventArgs e) { String mes = WorkMethods.CleanRAWFiles(); if (!mes.Equals("ok")) { MessageBox.Show(mes); } }
protected void buttonOK_Click(object sender, EventArgs e) { MessageBox.Show(WorkMethods.Save(project)); WorkerXML.Serialize(project); }