Esempio n. 1
0
        private void CalcuateDueDates_Internal(CalculateDueDatesRequest req)
        {
            bool   logErr = false;
            bool   fatal  = false;
            string err    = "";

            try
            {
                if ((req == null) || (req.hdr == null) || (req.UserId == null))
                {
                    err = "CalculateDueDatesRequest or its request header is null";
                    int Event_id = 7047;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                    return;
                }

                if (req.UserId < 0)
                {
                    err = "User Id in the CalculateDueDatesRequest is negative, userid=" + req.UserId;
                    int Event_id = 7048;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                    return;
                }

                if (req.FileId <= 0)
                {
                    err = "FileId in CalculateDueDatesRequest is invalid, FileId=" + req.FileId;
                    int Event_id = 7049;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                    return;
                }

                if (m_da.Save_EstCloseDate(req.FileId, req.NewEstCloseDate, req.UserId, ref err) == false)
                {
                    int Event_id = 7050;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                    return;
                }

                if (m_da.CalculateDueDates(req.FileId, req.NewEstCloseDate, ref err) == false)
                {
                    int Event_id = 7051;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                    return;
                }
            }
            catch (Exception ex)
            {
                err = "CalculateDueDates, Exception:" + ex.Message;
                int Event_id = 7052;
                EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                fatal = true;
            }
            finally
            {
                if (logErr)
                {
                    int Event_id = 7053;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                }
            }
        }