Ejemplo n.º 1
0
        public static TargetFlow BuildTargetFlow(this TargetFlowInfo tfi)
        {
            if (tfi == null || tfi.TargetFlow == null)
            {
                return(null);
            }
            TargetFlow tflow = tfi.TargetFlow;

            tflow.Flow          = tfi.BizFlow.BuildBizFlow();
            tflow.TreatedStates = tfi.TargetStates.Where(o => o.TargetFlowId == tflow.TargetFlowId).ToArray();
            tflow.TreatedStates.ForEach(o =>
            {
                o.TargetIncomes  = tfi.TargetIncomes.Where(d => d.TargetStateId == o.TargetStateId).ToArray();
                o.TargetOutcomes = tfi.TargetOutcomes.Where(d => d.TargetStateId == o.TargetStateId).ToArray();
                o.State          = tflow.Flow.States.FirstOrDefault(s => s.StateId == o.StateId);
                o.Operation      = tflow.Flow.Operations.FirstOrDefault(p => p.OperationId == o.OperationId);
                o.TargetIncomes.ForEach(obj =>
                {
                    obj.Income = tflow.Flow.Incomes.FirstOrDefault(d => d.IncomeId == obj.IncomeId);
                });
                o.TargetOutcomes.ForEach(obj =>
                {
                    obj.Outcome = tflow.Flow.Outcomes.FirstOrDefault(d => d.OutcomeId == obj.OutcomeId);
                });
            });

            return(tflow);
        }
Ejemplo n.º 2
0
 public TargetFlowWrapper(TargetFlowInfo FlowInfo)
 {
     this.FlowInfo = FlowInfo;
 }
Ejemplo n.º 3
0
 private TargetFlowInfo GetTargetFlow(TargetFlow tflow)
 {
     if (tflow != null)
     {
         if (!string.IsNullOrEmpty(tflow.LastTargetFlowId))
             tflow.LastTargetFlow = repoTargetFlow.Query(o => o.TargetFlowId == tflow.LastTargetFlowId).FirstOrDefault();
         TargetFlowInfo tfi = new TargetFlowInfo();
         tfi.TargetFlow = tflow;
         tfi.BizFlow = GetBizFlow(tfi.TargetFlow.FlowId);
         tfi.TargetStates = repoTargetState.Query(o => o.TargetFlowId == tflow.TargetFlowId).ToArray();
         tfi.TargetIncomes = repoTargetIncome.Query(o => o.TargetState.TargetFlowId == tflow.TargetFlowId).ToArray();
         tfi.TargetOutcomes = repoTargetOutcome.Query(o => o.TargetState.TargetFlowId == tflow.TargetFlowId).ToArray();
         tfi.NextTargetStates = repoNextTargetState.Query(o => o.FromTargetState.TargetFlowId == tflow.TargetFlowId).ToArray();
         return tfi;
     }
     return null;
 }
Ejemplo n.º 4
0
 public TargetFlowWrapper(TargetFlowInfo FlowInfo)
 {
     this.FlowInfo = FlowInfo;
 }