public WorkOrderService(IArsOrganizationContext context, ITechnicianService technicianService, IOptionSetHelper optionSetHelper, ILogger logger) { if (context == null) { throw new ArgumentNullException("context"); } if (technicianService == null) { throw new ArgumentNullException("technicianService"); } if (optionSetHelper == null) { throw new ArgumentNullException("optionSetHelper"); } if (logger == null) { throw new ArgumentNullException("logger"); } _context = context; _technicianService = technicianService; _optionSetHelper = optionSetHelper; _logger = logger; }
protected override void Execute(CodeActivityContext executionContext) { var tracingService = executionContext.GetExtension <ITracingService>(); var workflowContext = executionContext.GetExtension <IWorkflowContext>(); if (workflowContext == null) { throw new InvalidOperationException("Wokflow Context is null"); } IArsOrganizationContext serviceContext = null; try { var serviceFactory = executionContext.GetExtension <IOrganizationServiceFactory>(); IOrganizationService service = serviceFactory.CreateOrganizationService(workflowContext.UserId); serviceContext = executionContext.GetExtension <IServiceContextFactory>().CreateContext(service); HandleRequest(executionContext, serviceContext, workflowContext); } catch (Exception ex) { ThrowException(ex, tracingService, workflowContext); } finally { var disposable = serviceContext as IDisposable; if (disposable != null) { disposable.Dispose(); } } }
public LocationService(IArsOrganizationContext context) { if (context == null) { throw new ArgumentNullException("context"); } _context = context; }
protected EntityServiceBase(IArsOrganizationContext context) { if (context == null) { throw new ArgumentNullException("context"); } _context = context; }
public CrmTechnicianAuthenticationService(IArsOrganizationContext context) { if (context == null) { throw new ArgumentNullException("context"); } _context = context; }
public TimeService(IArsOrganizationContext context) { if (context == null) { throw new ArgumentNullException("context"); } _context = context; _timeZoneCode = new Lazy <int>(GetCurrentUserTimeZoneCode); }
public AppointmentService(IArsOrganizationContext context, ITimeService timeService) { if (context == null) { throw new ArgumentNullException("context"); } if (timeService == null) { throw new ArgumentNullException("timeService"); } _context = context; _timeService = timeService; }
public TechnicianService(IArsOrganizationContext context, ObjectCache cache) { if (context == null) { throw new ArgumentNullException("context"); } if (cache == null) { throw new ArgumentNullException("cache"); } _context = context; _cache = cache; }
public PurchaseOrderService(IArsOrganizationContext context, ITechnicianService technicianService) { if (context == null) { throw new ArgumentNullException("context"); } if (technicianService == null) { throw new ArgumentNullException("technicianService"); } _context = context; _technicianService = technicianService; }
public static void Main(string[] args) { _context = CreateOrganizationContext(); CreateWorkOrdersForToday(); }
protected abstract void HandleRequest(CodeActivityContext executionContext, IArsOrganizationContext serviceContext, IWorkflowContext workflowContext);