Ejemplo n.º 1
0
        public Boolean SendFileCheck(string _filetofind)
        {
            Logger.DebugLog("SendFileCheck", false, false);


            if (SendFiles.CheckforFile(_filetofind) == true)
            {
                return(true);
            }
            else
            {
                Logger.DebugLog("***** Failed to send file *****", false, false);
                return(false);
            }
        }
        void Timer_Tick(object sender, EventArgs e)
        {
            //stop the timer to check for file
            timer.Enabled = false;


            //make sure the error log has not already been sent
            if (__fileErrorLogtofindSend == false)
            {
                //check to see if error file is there
                _fileLogErrorfound = SendFiles.CheckforErrorLog(_fileLogErrortofind);


                // if error log found send an email
                if (_fileLogErrorfound == true)
                {
                    //send the error log now
                    milldaily.SendErrorLog(_fileLogErrortofind);

                    //set to true so it will not be sent while the progrma is running.
                    __fileErrorLogtofindSend = true;
                }
            }



            if (_filetofindSend == false) //make sure the file has not been found

            {
                _filefound = SendFiles.CheckforFile(_filetofind); //check to see if file is there
                if (_filefound == true)
                {
                    // GO SEND THE FILES
                    _filetofindSend = true;  // file was found
                    milldaily.SendFilesNow(_fileErrortofindSend, _filesentfound, _filetofindSend, _fileErrortofind, _filetofind);



                    StopApplication();
                }



                //if (_fileErrortofindSend == false)  //make sure the error file has not been sent
                //{
                //    _fileErrorfound = SendFiles.CheckforFile(_fileErrortofind); //check to see if error file is there

                //    //looking for an pdf error file - this file may not always be there
                //    // if found an only an email will be sent later
                //    if (_fileErrorfound == true)
                //    {

                //        _fileErrortofindSend = true;
                //    }
                //}



                if (milldaily.CheckTimeExceeded(CheckMaxiumTimeToRun) == true)
                {
                    // need to send the files now
                    milldaily.SendFilesNow(_fileErrortofindSend, _filesentfound, _filetofindSend, _fileErrortofind, _filetofind);


                    StopApplication();
                }

                timer.Interval = (10) * (2000); // Timer will tick every 20 seconds
                timer.Enabled  = true;          //start timer back up
            }
        }