コード例 #1
0
 public void CancelBreakRequest(UserAuth auth, string sessionId)
 {
     try
     {
         var startTIme = DateTime.Now;
         var client    = new refResourceProxy.ResourceProxyServicesClient();
         client.CancelStatusChangeRequestCompleted += (s, e) =>
         {
             try
             {
                 Logger.Instance.LogMessage(Logger.LoggerFiles.DuoLogger1, string.Format("CancelBreakRequest-CancelStatusChangeRequestCompleted. Time Take :{0} , {1}", DateTime.Now.Subtract(startTIme).TotalMilliseconds, e.Result), Logger.LogLevel.Info);
                 if (OnStatusUpdatedMessage != null)
                 {
                     OnStatusUpdatedMessage(e.Result);
                 }
                 if (OnCancelStatusChangeRequestCompleted != null)
                 {
                     OnCancelStatusChangeRequestCompleted(e.Result);
                 }
             }
             catch (Exception exception)
             {
                 Logger.Instance.LogMessage(Logger.LoggerFiles.DuoLogger1, "ResourceRegistration[CancelStatusChangeRequestCompleted]", exception, Logger.LogLevel.Error);
             }
         };
         client.CancelStatusChangeRequestAsync(auth.SecurityToken, string.Empty, string.Empty, string.Empty, CommunicationModes.WebService, auth.guUserId.ToString(), string.Empty);
         Logger.Instance.LogMessage(Logger.LoggerFiles.DuoLogger1, string.Format("CancelBreakRequest. Time Take :{0} ", DateTime.Now.Subtract(startTIme).TotalMilliseconds), Logger.LogLevel.Info);
     }
     catch (Exception exception)
     {
         Logger.Instance.LogMessage(Logger.LoggerFiles.DuoLogger1, "CancelBreakRequest[-------ResourceProxy-----------]", exception, Logger.LogLevel.Error);
     }
 }
コード例 #2
0
        public void CancelBreakRequest(UserAuth auth, string sessionId)
        {
            var id = Guid.NewGuid();

            try
            {
                var startTIme = DateTime.Now;
                var client    = new refResourceProxy.ResourceProxyServicesClient();
                client.CancelStatusChangeRequestCompleted += (s, e) =>
                {
                    try
                    {
                        Logger.Instance.LogMessage(Logger.LogAppender.DuoLogger1, string.Format("CancelBreakRequest-CancelStatusChangeRequestCompleted. Time Take :{0} ,id: {1}, {2}", DateTime.Now.Subtract(startTIme).TotalMilliseconds, id, e.Result), Logger.LogLevel.Info);
                        if (OnStatusUpdatedMessage != null)
                        {
                            OnStatusUpdatedMessage(e.Result);
                        }
                        if (OnCancelBreakRequestCompleted != null)
                        {
                            OnCancelBreakRequestCompleted(e.Result);
                        }
                    }
                    catch (Exception exception)
                    {
                        Logger.Instance.LogMessage(Logger.LogAppender.DuoLogger1, string.Format("ResourceRegistration[CancelStatusChangeRequestCompleted], id : {0}", id), exception, Logger.LogLevel.Error);
                    }
                };
                var sqid = SequenceNumberGenerator.Instance.GetNextNo();
                client.CancelStatusChangeRequestAsync(auth.SecurityToken, string.Empty, string.Empty, string.Empty, CommunicationModes.WebService, sqid, auth.guUserId.ToString(), string.Empty);
                Logger.Instance.LogMessage(Logger.LogAppender.DuoLogger1, string.Format("CancelBreakRequest. Time Take :{0}, id : {1}, SID : {2}, sqid : {3}", DateTime.Now.Subtract(startTIme).TotalMilliseconds, id, sessionId, sqid), Logger.LogLevel.Info);
            }
            catch (Exception exception)
            {
                Logger.Instance.LogMessage(Logger.LogAppender.DuoLogger1, string.Format("CancelBreakRequest[-------ResourceProxy-----------], id : {0}", id), exception, Logger.LogLevel.Error);
            }
        }