Exemplo n.º 1
0
        public bool GenerateWorkflow(GenerateWorkflowRequest req, ref string err)
        {
            err = "";
            bool logErr = false;

            try
            {
                WorkflowEvent e = new WorkflowEvent(WorkflowCmd.GenerateWorkflow, req);
                m_ThreadContext.Post(new SendOrPostCallback(ProcessRequest), e);

                err = "Your request is being processed. It'll take a moment to finish.";
                return(true);
            }
            catch (Exception ex)
            {
                err = string.Format("GenerateWorkflow, FileId={0}, Workflow Templ Id={1}, Exception: {2}", req.FileId, req.WorkflowTemplId, ex.Message);
                int Event_id = 7063;
                EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                return(false);
            }
            finally
            {
                if (logErr)
                {
                    int Event_id = 7064;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                }
            }
        }
Exemplo n.º 2
0
        public bool ImportUsers(string OU_Filter, int requestor, int reqId, ref string err)
        {
            err = "";
            bool logErr = false;

            try
            {
                UserManagerEvent e = new UserManagerEvent(reqId, UserMgrCommandType.ImportUsers, requestor);
                m_ThreadContext.Post(new SendOrPostCallback(ProcessRequest), e);
                err = "Your request is being processed. It'll take a few minutes to complete.";
            }
            catch (Exception ex)
            {
                err = "Failed to import user accounts, Exception:" + ex.Message;
                int Event_id = 6047;
                EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                return(false);
            }
            finally
            {
                if (logErr)
                {
                    int Event_id = 6048;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                }
            }
            return(true);
        }