public EntityPackTS ConstructFromMany(MultiOperationRequest request) { var type = request.type == null ? null : TypeLogic.GetType(request.type); var entity = OperationLogic.ServiceConstructFromMany(request.lites, type, request.operarionSymbol, request.args); return(SignumServer.GetEntityPack(entity)); }
public EntityPackTS?ConstructFromEntity([Required, FromBody] EntityOperationRequest request) { var op = request.GetOperationSymbol(request.entity.GetType()); var entity = OperationLogic.ServiceConstructFrom(request.entity, op, request.ParseArgs(op)); return(entity == null ? null : SignumServer.GetEntityPack(entity)); }
public EntityPackTS Construct(ConstructOperationRequest request) { var type = TypeLogic.GetType(request.type); var entity = OperationLogic.ServiceConstruct(type, request.operarionSymbol, request.args); return(SignumServer.GetEntityPack(entity)); }
public EntityPackTS ConstructFromMany(MultiOperationRequest request) { var type = request.lites.Select(l => l.EntityType).Distinct().Only() ?? TypeLogic.GetType(request.type); var entity = OperationLogic.ServiceConstructFromMany(request.lites, type, request.GetOperationSymbol(type), request.args); return(SignumServer.GetEntityPack(entity)); }
public EntityPackTS Construct(ConstructOperationRequest request) { var entityType = TypeLogic.GetType(request.type); var entity = OperationLogic.ServiceConstruct(entityType, request.GetOperationSymbol(entityType), request.args); return(entity == null ? null : SignumServer.GetEntityPack(entity)); }
public EntityPackTS?Construct([Required, FromBody] ConstructOperationRequest request) { var entityType = TypeLogic.GetType(request.Type); var entity = OperationLogic.ServiceConstruct(entityType, request.GetOperationSymbol(entityType), request.Args); return(entity == null ? null : SignumServer.GetEntityPack(entity)); }
public EntityPackTS?ConstructFromMany([Required, FromBody] MultiOperationRequest request) { var type = request.Lites.Select(l => l.EntityType).Distinct().Only() ?? TypeLogic.GetType(request.Type); var entity = OperationLogic.ServiceConstructFromMany(request.Lites, type, request.GetOperationSymbol(type), request.Args); return(entity == null ? null : SignumServer.GetEntityPack(entity)); }
public EntityPackTS ConstructFromMany([Required, FromBody] OperationController.MultiOperationRequest request) { var type = request.type == null ? null : TypeLogic.GetType(request.type); var entity = PackageLogic.CreatePackageOperation(request.lites, request.GetOperationSymbol(type !), request.args); return(SignumServer.GetEntityPack(entity)); }
public EntityPackTS GetEntityPack(string type, string id) { var entityType = TypeLogic.GetType(type); var primaryKey = PrimaryKey.Parse(id, entityType); var entity = Database.Retrieve(entityType, primaryKey); return(SignumServer.GetEntityPack(entity)); }
public EntityPackCaseFlow GetCaseFlowPack(string caseActivityId) { var lite = Lite.ParsePrimaryKey <CaseActivityEntity>(caseActivityId); var dbValues = lite.InDB(a => new { a.Case, a.WorkflowActivity }); return(new EntityPackCaseFlow { pack = SignumServer.GetEntityPack(dbValues.Case), workflowActivity = dbValues.WorkflowActivity, }); }
public EntityPackTS GetEntityPack(string type, string id) { var entityType = TypeLogic.GetType(type); var primaryKey = PrimaryKey.Parse(id, entityType); var entity = Database.Retrieve(entityType, primaryKey); using (ExecutionMode.ApiRetrievedScope(entity, "EntitiesController.GetEntityPack")) { return(SignumServer.GetEntityPack(entity)); } }
public EntityPackTS ExecuteEntity(EntityOperationRequest request) { Entity entity; try { entity = OperationLogic.ServiceExecute(request.entity, request.GetOperationSymbol(request.entity.GetType()), request.args); } catch (IntegrityCheckException ex) { GraphExplorer.SetValidationErrors(GraphExplorer.FromRoot(request.entity), ex); this.Validate(request, "request"); throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, this.ModelState)); } return(SignumServer.GetEntityPack(entity)); }
public ActionResult <EntityPackTS> ExecuteEntity([Required, FromBody] EntityOperationRequest request) { Entity entity; try { entity = OperationLogic.ServiceExecute(request.entity, request.GetOperationSymbol(request.entity.GetType()), request.args); } catch (IntegrityCheckException ex) { GraphExplorer.SetValidationErrors(GraphExplorer.FromRoot(request.entity), ex); this.TryValidateModel(request, "request"); return(BadRequest(this.ModelState)); } return(SignumServer.GetEntityPack(entity)); }
public ActionResult <EntityPackWithIssues> SaveWorkflow([Required, FromBody] EntityOperationRequest request) { WorkflowEntity entity; List <WorkflowIssue> issuesContainer = new List <WorkflowIssue>(); try { entity = ((WorkflowEntity)request.entity).Execute(WorkflowOperation.Save, (request.args.EmptyIfNull()).And(issuesContainer).ToArray()); } catch (IntegrityCheckException ex) { GraphExplorer.SetValidationErrors(GraphExplorer.FromRoot(request.entity), ex); this.TryValidateModel(request, "request"); this.ModelState.AddModelError("workflowIssues", JsonConvert.SerializeObject(issuesContainer, SignumServer.JsonSerializerSettings)); return(BadRequest(this.ModelState)); } return(new EntityPackWithIssues(SignumServer.GetEntityPack(entity), issuesContainer)); }
public EntityPackWorkflow GetEntity(string caseActivityId) { var lite = Lite.ParsePrimaryKey <CaseActivityEntity>(caseActivityId); var activity = CaseActivityLogic.RetrieveForViewing(lite); using (WorkflowActivityInfo.Scope(new WorkflowActivityInfo { CaseActivity = activity })) { var ep = SignumServer.GetEntityPack((Entity)activity.Case.MainEntity); return(new EntityPackWorkflow { activity = activity, canExecuteActivity = OperationLogic.ServiceCanExecute(activity).ToDictionary(a => a.Key.Key, a => a.Value), canExecuteMainEntity = ep.canExecute, Extension = ep.extension, }); } }
public EntityPackTS ExecuteLite([Required, FromBody] LiteOperationRequest request) { var entity = OperationLogic.ServiceExecuteLite(request.lite, request.GetOperationSymbol(request.lite.EntityType), request.args); return(SignumServer.GetEntityPack(entity)); }
public EntityPackTS?ConstructFromLite([Required, FromBody] LiteOperationRequest request) { var entity = OperationLogic.ServiceConstructFromLite(request.lite, request.GetOperationSymbol(request.lite.EntityType), request.args); return(entity == null ? null: SignumServer.GetEntityPack(entity)); }
public EntityPackTS ConstructFromEntity(EntityOperationRequest request) { var entity = OperationLogic.ServiceConstructFrom(request.entity, request.GetOperationSymbol(request.entity.GetType()), request.args); return(entity == null ? null: SignumServer.GetEntityPack(entity)); }
public EntityPackTS ExecuteLite(LiteOperationRequest request) { var entity = OperationLogic.ServiceExecuteLite(request.lite, request.operarionSymbol, request.args); return(SignumServer.GetEntityPack(entity)); }
public EntityPackTS GetEntityPackEntity(Entity entity) { return(SignumServer.GetEntityPack(entity)); }
public EntityPackTS ConstructFromEntity(EntityOperationRequest request) { var entity = OperationLogic.ServiceConstructFrom(request.entity, request.operarionSymbol, request.args); return(SignumServer.GetEntityPack(entity)); }
public EntityPackTS GetEntityPackEntity([Required, FromBody] Entity entity) { return(SignumServer.GetEntityPack(entity)); }
public EntityPackTS ConstructFromLite(LiteOperationRequest request) { var entity = OperationLogic.ServiceConstructFromLite(request.lite, request.operarionSymbol, request.args); return(entity == null ? null: SignumServer.GetEntityPack(entity)); }