public void Work(string param)
        {
            if (m_job.attempts == 5 && m_job.iscompleted == false)
            {
                Jobs.IncrementAttempts(m_job);
                SLXapi.Helpers.Email.SendEmail("*****@*****.**", "*****@*****.**", string.Empty, string.Empty, "An Outlook Event is Having Difficulty being created.", "The Job with ID: <b>" + m_job.jobid + "</b> has failed "+ m_job.attempts+" times to create. Please take a look.<br/>Error message from Job: "+m_job.report, true, false);

            }
            if (m_job.attempts >= 5)
            {
                return;
            }
            m_job.UpdateStatus("Working");
            string retaddcal = string.Empty;
            try
            {
                Jobs.IncrementAttempts(m_job);
                SLXCalendar.Calendar cal = new Calendar();
                retaddcal = cal.AddCalendar(m_job.objectid);
                if (retaddcal == "Failed to create Outlook Application")
                    throw new Exception("Failed to create Outlook Application");
                m_job.UpdateStatus("Completed");
                m_job.SetToComplete(m_jobid);
            }
               catch( Exception e)
            {
                m_job.UpdateStatus("Error");
                Jobs.UpdateMessage(m_jobid, e.Message);
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            List<SLXapi.Opportunity> opps = SLXapi.Opportunity.GetFuture();

            for (int i = 0; i < opps.Count; ++i)
            {
                SLXCalendar.Calendar calendar = new Calendar();
                calendar.AddCalendar(opps[i].OpportunityID);

            }
        }