예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        public EntityPackTS Construct(ConstructOperationRequest request)
        {
            var type = TypeLogic.GetType(request.type);

            var entity = OperationLogic.ServiceConstruct(type, request.operarionSymbol, request.args);

            return(SignumServer.GetEntityPack(entity));
        }
예제 #4
0
        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));
        }
예제 #5
0
        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));
        }
예제 #6
0
        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));
        }
예제 #7
0
        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));
        }
예제 #8
0
        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));
        }
예제 #9
0
        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));
        }
예제 #10
0
        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,
            });
        }
예제 #11
0
        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));
            }
        }
예제 #12
0
        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));
        }
예제 #13
0
        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));
        }
예제 #14
0
        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));
        }
예제 #15
0
        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,
                });
            }
        }
예제 #16
0
        public EntityPackTS ExecuteLite([Required, FromBody] LiteOperationRequest request)
        {
            var entity = OperationLogic.ServiceExecuteLite(request.lite, request.GetOperationSymbol(request.lite.EntityType), request.args);

            return(SignumServer.GetEntityPack(entity));
        }
예제 #17
0
        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));
        }
예제 #18
0
        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));
        }
예제 #19
0
        public EntityPackTS ExecuteLite(LiteOperationRequest request)
        {
            var entity = OperationLogic.ServiceExecuteLite(request.lite, request.operarionSymbol, request.args);

            return(SignumServer.GetEntityPack(entity));
        }
예제 #20
0
 public EntityPackTS GetEntityPackEntity(Entity entity)
 {
     return(SignumServer.GetEntityPack(entity));
 }
예제 #21
0
        public EntityPackTS ConstructFromEntity(EntityOperationRequest request)
        {
            var entity = OperationLogic.ServiceConstructFrom(request.entity, request.operarionSymbol, request.args);

            return(SignumServer.GetEntityPack(entity));
        }
예제 #22
0
 public EntityPackTS GetEntityPackEntity([Required, FromBody] Entity entity)
 {
     return(SignumServer.GetEntityPack(entity));
 }
예제 #23
0
        public EntityPackTS ConstructFromLite(LiteOperationRequest request)
        {
            var entity = OperationLogic.ServiceConstructFromLite(request.lite, request.operarionSymbol, request.args);

            return(entity == null ? null: SignumServer.GetEntityPack(entity));
        }