Beispiel #1
0
        /// <summary>
        /// method to add message to queue to trigger request update
        /// </summary>
        /// <param name="request">takes request as input</param>
        public void TriggerRequestUpdate(RequestEntity request, string UserID)
        {
            string callerMethodName = string.Empty;

            try
            {
                //Get Caller Method name from CallerInformation class
                callerMethodName = CallerInformation.TrackCallerMethodName();
                UpdateTriggeringMessage updateTriggerMessage     = new UpdateTriggeringMessage();
                List <RequestUpdateMsg> updatetriggerrequestlist = new List <RequestUpdateMsg>();
                RequestUpdateMsg        triggerrequset           = new RequestUpdateMsg();
                //adding request to message object
                Request requestobj = new Request();
                requestobj.ID          = request.ID;
                requestobj.UserID      = UserID;
                triggerrequset.request = requestobj;

                //adding backend to queue message
                UpdateTriggerBackend backendobj = new UpdateTriggerBackend();
                backendobj.BackendID           = request.BackendID;
                triggerrequset.request.Backend = backendobj;
                //add requests to list which will be added to message
                updatetriggerrequestlist.Add(triggerrequset);
                updateTriggerMessage.Requests = updatetriggerrequestlist;
                updateTriggerMessage.GetPDFs  = Convert.ToBoolean(ConfigurationManager.AppSettings[CoreConstants.Config.GetPDFs]);
                //calling data access layer method to add message to queue
                PersonalizationDAL personalizationdal = new PersonalizationDAL();
                personalizationdal.AddUpdateTriggerMessageToQueue(updateTriggerMessage);
            }
            catch (DataAccessException DALexception)
            {
                throw DALexception;
            }
            catch (Exception exception)
            {
                InsightLogger.Exception(exception.Message, exception, callerMethodName);
                //LoggerHelper.WriteToLog(exception + " - Error in BL while formatting updatetriggering message : "
                //+ exception.ToString(), CoreConstants.Priority.High, CoreConstants.Category.Error);
                throw new BusinessLogicException();
            }
        }
 /// <summary>
 /// method to add message to queue to trigger request update
 /// </summary>
 /// <param name="requestID">takes requestid as input</param>
 /// <param name="UserID">takes userid as input</param>
 /// <param name="BackendID">takes backendid as input</param>
 public void RequestUpdateTrigger(string requestID, string UserID, string BackendID)
 {
     try
     {
         UpdateTriggeringMessage updateTriggerMessage     = new UpdateTriggeringMessage();
         List <RequestUpdateMsg> updatetriggerrequestlist = new List <RequestUpdateMsg>();
         RequestUpdateMsg        triggerrequset           = new RequestUpdateMsg();
         //adding request to message object
         RequestMsg requestobj = new RequestMsg();
         requestobj.ID          = requestID;
         requestobj.UserID      = UserID;
         triggerrequset.request = requestobj;
         //adding backend to queue message
         UpdateTriggerBackend backendobj = new UpdateTriggerBackend();
         backendobj.BackendID           = BackendID;
         triggerrequset.request.Backend = backendobj;
         //add requests to list which will be added to message
         updatetriggerrequestlist.Add(triggerrequset);
         updateTriggerMessage.Requests = updatetriggerrequestlist;
         //set VIP message flag to true
         updateTriggerMessage.VIP = true;
         //calling DAL method to update backend entity
         RequestUpdateDAL requestupdatedal = new RequestUpdateDAL();
         requestupdatedal.AddUpdateTriggerMessageToQueue(updateTriggerMessage);
     }
     catch (DataAccessException DALexception)
     {
         throw DALexception;
     }
     catch (Exception exception)
     {
         LoggerHelper.WriteToLog(exception + " - Error in BL while formatting updatetriggering message : "
                                 + exception.ToString(), CoreConstants.Priority.High, CoreConstants.Category.Error);
         throw new BusinessLogicException();
     }
 }