Beispiel #1
0
 private void doLog(CENTRALLogMonitoring param)
 {
     try
     {
         param.seqID = getLogDetailSequence(param.processID);
         if (param.seqID.Equals("1"))
         {
             insertLogHeader(param);
         }
         insertLogDetail(param);
     }
     catch (Exception d)
     {
         throw d;
     }
 }
Beispiel #2
0
        public string getMessageContentAndLog(string msgID, string userID, string processID, string processName, string functionID, string remark, string[] param)
        {
            string result = "No message defined";

            try
            {
                CENTRALMessageDomain message = getMessage(msgID);
                if (message != null && message.MSG_DESC != null)
                {
                    result = message.MSG_DESC;
                    if (param != null)
                    {
                        for (int i = 0; i < param.Length; i++)
                        {
                            result = result
                                     .Replace("{" + i.ToString() + "}", param[i])
                                     .Replace("[" + i.ToString() + "]", param[i]);
                        }
                        message.MSG_DESC = result;
                    }
                    CENTRALLogMonitoring par = new CENTRALLogMonitoring();
                    par.seqID       = CENTRALMessageRepository.Instance.getLogDetailSequence(par.processID);
                    par.message     = message;
                    par.processID   = processID;
                    par.functionID  = functionID;
                    par.remark      = remark;
                    par.processName = processName;
                    par.userID      = userID;
                    doLog(par);
                }
            }
            catch (Exception e)
            {
                string msg = "";
                if (e.Message == null)
                {
                    msg = e.InnerException.Message;
                }
                else
                {
                    msg = e.Message;
                }
                result = result + " error " + msg;
            }

            return(result);
        }
Beispiel #3
0
        private bool insertLogDetail(CENTRALLogMonitoring param)
        {
            bool result = false;

            try
            {
                IDBContext db = DatabaseManager.Instance.GetContext();
                result = db.Execute("CENTRALMessage/CENTRALMessageInsertLogDetail", new
                {
                    LOG_SEQ    = param.seqID,
                    PROCESS_ID = param.processID,
                    MSG_ID     = param.message.MSG_ID,
                    LOCATION   = param.functionID,
                    MSG_DESC   = param.message.MSG_DESC,
                    CREATED_BY = param.userID
                }) > 0;

                db.Close();
            }
            catch
            {
            }
            return(result);
        }
Beispiel #4
0
        private bool insertLogHeader(CENTRALLogMonitoring param)
        {
            bool result = false;

            try
            {
                IDBContext db = DatabaseManager.Instance.GetContext();
                result = db.Execute("CENTRALMessage/CENTRALMessageInsertLogHeader", new
                {
                    PROCESS_ID   = param.processID,
                    USER_ID      = param.userID,
                    SUB_SYSTEMID = "",
                    FUNCTION_ID  = param.functionID,
                    STS          = param.message.MSG_TYPE
                }) > 0;

                db.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            return(result);
        }