public FluentRecordBase AddWorkerRequest(Worker worker = null, DateTime?datecreated = null, DateTime?dateupdated = null) { // // DEPENDENCIES _servWR = container.GetRequiredService <IWorkerRequestService>(); if (_wo == null) { AddWorkOrder(); } // // ARRANGE _wr = (WorkerRequest)Records.request.Clone(); //_wr.workOrder = (WorkOrder)_wo.Clone(); //_wr.workerRequested = (Worker)_w.Clone(); _wr.workOrder = _wo; _wr.workerRequested = worker ?? AddWorker(); if (datecreated != null) { _wr.datecreated = (DateTime)datecreated; } if (dateupdated != null) { _wr.dateupdated = (DateTime)dateupdated; } // ACT //huh? // var Wentry = _dbContext.Entry(_w); // var WOentry = _dbContext.Entry(_wo); // var WRentry = _dbContext.Entry(_wr); _servWR.Create(_wr, _user); return(this); }
/// <summary> /// Constructor /// </summary> /// <param name="woServ">Work Order service</param> /// <param name="wServ">Worker service</param> /// <param name="wrServ">Worker request service</param> public WorkOrderController(IWorkOrderService woServ, IWorkerService wServ, IWorkerRequestService wrServ, IDefaults def, IMapper map) { this.woServ = woServ; this.wServ = wServ; this.wrServ = wrServ; this.map = map; this.def = def; }
// public WorkerSigninService( IWorkerSigninRepository repo, IWorkerService wServ, IImageService iServ, IWorkerRequestService wrServ, IUnitOfWork uow, IMapper map, IConfigService cfg) : base(repo, wServ, iServ, wrServ, uow, map, cfg) { this.logPrefix = "WorkerSignin"; }
public WorkerSigninService( IWorkerSigninRepository repo, IWorkerService wServ, IImageService iServ, IWorkerRequestService wrServ, IUnitOfWork uow, IMapper map, IConfigService cfg, ITenantService tenantService ) : base(repo, wServ, iServ, wrServ, uow, map, cfg) { logPrefix = "WorkerSignin"; ClientTimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(tenantService.GetCurrentTenant().Timezone); }
/// <summary> /// Constructor /// </summary> /// <param name="woServ">Work Order service</param> /// <param name="waServ">Work Assignment service</param> /// <param name="eServ">Employer service</param> /// <param name="wServ">Worker service</param> /// <param name="wrServ">Worker request service</param> /// <param name="lcache">Lookup cache</param> public WorkOrderController(IWorkOrderService woServ, IWorkAssignmentService waServ, IEmployerService eServ, IWorkerService wServ, IWorkerRequestService wrServ, ILookupCache lcache) { this.woServ = woServ; this.eServ = eServ; this.wServ = wServ; this.waServ = waServ; this.wrServ = wrServ; this.lcache = lcache; }
public ActivitySigninService( IActivitySigninRepository asiRepo, IWorkerService wServ, IPersonService pServ, IImageService iServ, IWorkerRequestService wrServ, IUnitOfWork uow, IMapper map, IConfigService cfg) : base(asiRepo, wServ, iServ, wrServ, uow, map, cfg) { this.logPrefix = "ActivitySignin"; this.pServ = pServ; this.asiRepo = asiRepo; }
public ActivitySigninService( IActivitySigninRepository asiRepo, IWorkerService wServ, IPersonService pServ, IImageService iServ, IWorkerRequestService wrServ, IUnitOfWork uow, IMapper map, IConfigService cfg, ITenantService tenantService ) : base(asiRepo, wServ, iServ, wrServ, uow, map, cfg) { this.logPrefix = "ActivitySignin"; this.pServ = pServ; ClientTimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(tenantService.GetCurrentTenant().Timezone); }
/// <summary> /// The Work Order controller is responsible for handling all REST actions related to the /// creation, modification, processing and retaining of Work Orders created by staff or /// employers (hirers/2.0). /// </summary> /// <param name="woServ">Work Order service</param> /// <param name="reqServ">Req serv</param> /// <param name="defaults">Default config values</param> /// <param name="map">AutoMapper service</param> /// <param name="adaptor"></param> /// <param name="tenantService"></param> public WorkOrderController( IWorkOrderService woServ, IWorkerRequestService reqServ, IDefaults defaults, IMapper map, IModelBindingAdaptor adaptor, ITenantService tenantService ) { _woServ = woServ; _reqServ = reqServ; _map = map; _adaptor = adaptor; _defaults = defaults; _clientTimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(tenantService.GetCurrentTenant().Timezone); }
// // protected SigninServiceBase( IRepository <T> repo, IWorkerService wServ, IImageService iServ, IWorkerRequestService wrServ, IUnitOfWork uow, IMapper map, IConfigService cfg) : base(repo, uow) { this.wServ = wServ; this.wrServ = wrServ; this.iServ = iServ; this.map = map; this.logPrefix = "SigninServiceBase"; this.cfg = cfg; }
/// <summary> /// Constructor /// </summary> /// <param name="woServ">Work Order service</param> /// <param name="waServ">Work Assignment service</param> /// <param name="eServ">Employer service</param> /// <param name="wServ">Worker service</param> /// <param name="wrServ">Worker request service</param> /// <param name="lcache">Lookup cache</param> public WorkOrderController(IWorkOrderService woServ, IWorkAssignmentService waServ, IEmployerService eServ, IWorkerService wServ, IWorkerRequestService wrServ, ILookupCache lcache, IDefaults def, IMapper map) { this.woServ = woServ; this.eServ = eServ; this.wServ = wServ; this.waServ = waServ; this.wrServ = wrServ; this.lcache = lcache; this.map = map; this.def = def; }
/// <summary> /// Constructor /// </summary> /// <param name="repo"></param> /// <param name="waServ">Work Assignment service</param> /// <param name="uow">Unit of Work</param> public WorkOrderService(IWorkOrderRepository repo, IWorkAssignmentService waServ, ITransportProvidersService tpServ, IWorkerRequestService wrServ, IWorkerService wServ, ILookupRepository lRepo, IUnitOfWork uow, IMapper map, IConfigService cfg) : base(repo, uow) { this.waServ = waServ; this.wrServ = wrServ; this.wServ = wServ; this.map = map; this.lRepo = lRepo; this.cfg = cfg; this.tpServ = tpServ; this.logPrefix = "WorkOrder"; }
public FluentRecordBase AddWorkerRequest( DateTime?datecreated = null, DateTime?dateupdated = null ) { // // DEPENDENCIES _servWR = container.Resolve <IWorkerRequestService>(); if (_wo == null) { AddWorkOrder(); } if (_w == null) { AddWorker(); } // // ARRANGE _wr = (WorkerRequest)Records.request.Clone(); //_wr.workOrder = (WorkOrder)_wo.Clone(); //_wr.workerRequested = (Worker)_w.Clone(); _wr.workOrder = _wo; _wr.workerRequested = _w; if (datecreated != null) { _wr.datecreated = (DateTime)datecreated; } if (dateupdated != null) { _wr.dateupdated = (DateTime)dateupdated; } // // ACT var Wentry = _dbFactory.Get().Entry <Worker>(_w); var WOentry = _dbFactory.Get().Entry <WorkOrder>(_wo); var WRentry = _dbFactory.Get().Entry <WorkerRequest>(_wr); _servWR.Create(_wr, _user); return(this); }
/// <summary> /// Business logic object for WorkOrder record management. Contains logic specific /// to processing work orders, and not necessarily related to a web application. /// </summary> /// <param name="repo"></param> /// <param name="waServ">Work Assignment service</param> /// <param name="tpServ"></param> /// <param name="wrServ"></param> /// <param name="wServ"></param> /// <param name="lRepo"></param> /// <param name="uow">Unit of Work</param> /// <param name="map"></param> /// <param name="cfg"></param> /// <param name="tenantService"></param> public WorkOrderService(IWorkOrderRepository repo, IWorkAssignmentService waServ, ITransportProvidersService tpServ, IWorkerRequestService wrServ, IWorkerService wServ, ILookupRepository lRepo, IUnitOfWork uow, IMapper map, IConfigService cfg, ITenantService tenantService ) : base(repo, uow) { this.repo = repo; this.waServ = waServ; this.wrServ = wrServ; this.wServ = wServ; this.map = map; this.lRepo = lRepo; this.cfg = cfg; this.tpServ = tpServ; this.logPrefix = "WorkOrder"; _clientTimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(tenantService.GetCurrentTenant().Timezone); }
public static void waGrouping(viewOptions o, ref IQueryable <WorkerSignin> q, IWorkerRequestService wrServ) { switch (o.wa_grouping) { case "open": q = q.Where(p => p.WorkAssignmentID == null); break; case "assigned": q = q.Where(p => p.WorkAssignmentID != null); break; case "skilled": q = q .Where(wsi => wsi.WorkAssignmentID == null && wsi.worker.skill1 != null || wsi.worker.skill2 != null || wsi.worker.skill3 != null ); break; case "requested": if (o.date == null) { throw new MacheteIntegrityException("Date cannot be null for Requested filter"); } q = q.Where(p => p.WorkAssignmentID == null); q = q.Join(wrServ.GetAll(), //LINQ wsi => new { K1 = (int)wsi.WorkerID, K2 = wsi.dateforsignin.Date }, wr => new { K1 = wr.WorkerID, K2 = wr.workOrder.dateTimeofWork.Date }, (wsi, wr) => wsi); break; } }