コード例 #1
0
ファイル: EventTrackingManager.cs プロジェクト: ognjenm/egle
        /// <summary>
        /// Create a business event asynchronously
        /// </summary>
        /// <param name="businessId">The long id of the business</param>
        /// <param name="eventType">The type of business event</param>
        /// <param name="reference">The reference - usually the id related to the event type</param>
        /// <param name="notes">Notes if applicable</param>
        public void CreateBusinessEventAsync(long businessId, BusinessEventTypesEnum eventType, string reference, string notes = null)
        {
            
            var businessEvent = new BusinessEvent
            {
                BusinessId = businessId,
                EventType = new EnumEntity { Code = eventType.GetCode() },
                Reference = reference,
                Notes = notes
            };

            // Multithread it
            Task.Factory.StartNew(() => businessEventDao.CreateAsync(businessEvent));
        }
コード例 #2
0
ファイル: EventTrackingManager.cs プロジェクト: ognjenm/egle
 /// <summary>
 /// Create a business event
 /// </summary>
 /// <param name="businessId">The long id of the business</param>
 /// <param name="eventType">The type of business event</param>
 /// <param name="reference">The reference - as an int</param>
 /// <param name="notes">Notes if applicable</param>
 public void CreateBusinessEventAsync(long businessId, BusinessEventTypesEnum eventType, int reference,
                                  string notes = null)
 {
     CreateBusinessEventAsync(businessId, eventType, reference.ToString(CultureInfo.InvariantCulture), notes);
 }
コード例 #3
0
ファイル: EventTrackingManager.cs プロジェクト: ognjenm/egle
        /// <summary>
        /// Create a business event synchronously, use if you need the results back immediately
        /// </summary>
        /// <param name="businessId">The long id of the business</param>
        /// <param name="eventType">The type of business event</param>
        /// <param name="reference">The reference - usually the id related to the event type</param>
        /// <param name="notes">Notes if applicable</param>
        public void CreateBusinessEvent(long businessId, BusinessEventTypesEnum eventType, string reference, string notes = null)
        {

            var businessEvent = new BusinessEvent
            {
                BusinessId = businessId,
                EventType = new EnumEntity { Code = eventType.GetCode() },
                Reference = reference,
                Notes = notes
            };

            // single thread it
            businessEventDao.Create(businessEvent);
        }