예제 #1
0
        private bool MonitorTasks(int fileId, ref string err)
        {
            List <Table.LoanTasks> taskList    = null;
            List <Table.LoanTasks> allTaskList = null;

            try
            {
                taskList = m_da.GetLoanTasks(fileId, false, false, ref err);
                if ((taskList != null) && (taskList.Count > 0))
                {
                    foreach (Table.LoanTasks task in taskList)
                    {
                        if (task.PrerequisiteTaskId > 0)
                        {
                            if (m_da.UpdateTaskDueDate(fileId, task, ref err) == false)
                            {
                                Trace.TraceError(err);
                                int Event_id = 7011;
                                EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                            }
                        }
                    }
                }

                allTaskList = m_da.GetLoanTasks(fileId, true, false, ref err);
                if ((allTaskList == null) || (allTaskList.Count <= 0))
                {
                    return(true);
                }
                foreach (Table.LoanTasks task in allTaskList)
                {
                    if (m_da.Check_SaveTaskAlert(fileId, task.LoanTaskId, ref err) == false)
                    {
                        int Event_id = 7012;
                        EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                err = "MonitorTasks, Exception: " + ex.Message;
                int Event_id = 7014;
                EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                return(false);
            }
            finally
            {
                if (taskList != null)
                {
                    taskList.Clear();
                    taskList = null;
                }
                if (allTaskList != null)
                {
                    allTaskList.Clear();
                    allTaskList = null;
                }
            }
        }