private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); string strerror = ""; try { lberror.Text = ""; strerror = "Update Date =>"; CheckDateAndUpdateCurrentDate(); strerror = "GetPTArrived=>"; this.GetPTArrived(SourcePath, LocalPath, LocalPathSuccess, LocalPathError, LocalPathLog);//edit suriya 18/03/2015 } catch (Exception ex) { //ไม่แสดง Error กรณี Error lberror.Text = "Call Data Form Webservice :" + strerror + ex.Message; } if (DateTime.Now > new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 20, 00, 0, 0)) { try { using (InhCheckupDataContext cdc = new InhCheckupDataContext()) { cdc.proc_Clear_PatientArrived(); //cdc.tmp_getptarriveds.DeleteAllOnSubmit(cdc.tmp_getptarriveds); } } catch { } System.Environment.Exit(1); } timer1.Start(); GC.Collect(); }